setup-finished.jsp 3.71 KB
Newer Older
1 2 3 4 5
<%--
  -	$Revision: 1644 $
  -	$Date: 2005-07-19 09:05:10 -0700 (Tue, 19 Jul 2005) $
--%>

6 7 8 9
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>

<%@ page import="org.jivesoftware.util.JiveGlobals,
10
                 java.util.Map,
11
                 org.jivesoftware.openfire.XMPPServer"
12
%>
13 14 15 16 17 18 19 20 21
<%@ page import="org.jivesoftware.util.LocaleUtils"%>

<%
	// Redirect if we've already run setup:
	if (!XMPPServer.getInstance().isSetupMode()) {
        response.sendRedirect("setup-completed.jsp");
        return;
    }
%>
22 23 24

<%
    // First, update with XMPPSettings
25 26 27
    Map<String,String> xmppSettings = (Map<String,String>)session.getAttribute("xmppSettings");
    for (String name : xmppSettings.keySet()) {
        String value = xmppSettings.get(name);
28 29
        JiveGlobals.setProperty(name, value);
    }
30 31 32
    Map<String,String> xmlSettings = (Map<String,String>)session.getAttribute("xmlSettings");
    for (String name : xmlSettings.keySet()) {
        String value = xmlSettings.get(name);
33 34
        JiveGlobals.setXMLProperty(name, value);
    }
35 36
    // Notify that the XMPP server that setup is finished.
    XMPPServer.getInstance().finishSetup();
37 38
%>

39 40 41
<html>
    <head>
        <title><fmt:message key="setup.finished.title" /></title>
42
        <meta name="currentStep" content="5"/>
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
        <script type="text/javascript">

        function showhide(id){
            var obj = document.getElementById(id);
            if (obj.style.display == "none"){
                obj.style.display = "";
            } else {
                obj.style.display = "none";
            }
        }

        function toggleDivs() {
            showhide('loginlink');
            showhide('logintext');
        }
        </script>
59
    </head>
60
<body onload="setTimeout('toggleDivs()', 1500);">
61

62 63 64 65 66 67 68 69 70
	<h1>
	<fmt:message key="setup.finished.title" />
	</h1>

	<p>
	<fmt:message key="setup.finished.info">
	    <fmt:param value="<%= LocaleUtils.getLocalizedString("title") %>" />
	</fmt:message>
	</p>
71

72
<%
73 74 75 76 77 78
    String authorizedUsernames = JiveGlobals.getXMLProperty("admin.authorizedUsernames");
    String authorizedJIDS = JiveGlobals.getXMLProperty("admin.authorizedJIDs");

    boolean useAdmin = authorizedJIDS == null  && authorizedUsernames == null;
    String parameters = useAdmin ? "?username=admin" : "";

79 80 81 82 83 84 85 86 87
    // Figure out the URL that the user can use to login to the admin console.
    String url;
    if (XMPPServer.getInstance().isStandAlone()) {
        String server = request.getServerName();
        int plainPort = JiveGlobals.getXMLProperty("adminConsole.port", 9090);
        int securePort = JiveGlobals.getXMLProperty("adminConsole.securePort", 9091);
        // Use secure login if we're currently secure (and the secure port isn't disabled)
        // or if the user disabled the plain port.
        if ((request.isSecure() && securePort > 0) || plainPort < 0) {
88
            url = "https://" + server + ":" + securePort + "/login.jsp"+parameters;
89 90
        }
        else {
91
            url = "http://" + server + ":" + plainPort + "/login.jsp"+parameters;
92 93 94 95
        }
    }
    else {
        url = request.getRequestURL().toString();
96
        url = url.replace("setup/setup-finished.jsp", "login.jsp"+parameters);
97 98
    }
%>
99 100

<br><br>
101
	<div id="loginlink" style="display:none;" class="jive_setup_launchAdmin">
102 103
		<a href="<%= url %>"><fmt:message key="setup.finished.login" /></a>
	</div>
104

105 106 107
	<div id="logintext" class="jive_setup_launchAdmin">
		<fmt:message key="setup.finished.wait" /> <img src="../images/working-16x16.gif" alt="<fmt:message key="setup.finished.wait" />" width="16" height="16">
	</div>
108

109 110
</body>
</html>