<%
/**
 *	$RCSfile: global.jsp,v $
 *	$Revision: 1.5 $
 *	$Date: 2001/07/31 10:19:30 $
 */
%>

<%	// Security check
	Authorization authToken = (Authorization)session.getAttribute("jive.admin.authorization");
	if (authToken == null) {
		response.sendRedirect("login.jsp");
		return;
	} else {
        // check for an anonymous user token
        if (authToken.isAnonymous()) {
		    response.sendRedirect("login.jsp");
		    return;
        }
    }

    // Get the forum factory object.
    ForumFactory forumFactory = ForumFactory.getInstance(authToken);
    // Get the user of this page
    User pageUser = null;
    try {
        forumFactory.getUserManager().getUser(authToken.getUserID());
    }
    catch (Exception e) {
		response.sendRedirect("login.jsp");
		return;
    }

    String onload = "";
%>

<%! // Global vars/methods for the entire skin

    static final String tableBorderColor = "#999999";
    static final String errorColor = "#ff0000";
    static final String messageColor = "#006600";

    private String getOneTimeMessage(HttpSession session, String name) {
        String message = (String)session.getAttribute("admin."+name);
        if (message != null) {
            session.removeAttribute("admin."+name);
            return message;
        }
        return null;
    }

    private void setOneTimeMessage(HttpSession session, String name, String value) {
        session.setAttribute("admin."+name, value);
    }
%>