setup-finished.jsp 2.98 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.wildfire.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
    </head>
<body>
45

46 47 48 49 50 51 52 53 54
	<h1>
	<fmt:message key="setup.finished.title" />
	</h1>

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

56
<%
57 58 59 60 61 62
    String authorizedUsernames = JiveGlobals.getXMLProperty("admin.authorizedUsernames");
    String authorizedJIDS = JiveGlobals.getXMLProperty("admin.authorizedJIDs");

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

63 64 65 66 67 68 69 70 71
    // 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) {
72
            url = "https://" + server + ":" + securePort + "/login.jsp"+parameters;
73 74
        }
        else {
75
            url = "http://" + server + ":" + plainPort + "/login.jsp"+parameters;
76 77 78 79
        }
    }
    else {
        url = request.getRequestURL().toString();
80
        url = url.replace("setup/setup-finished.jsp", "login.jsp"+parameters);
81 82
    }
%>
83 84 85 86 87

<br><br>
	<div class="jive_setup_launchAdmin">
		<a href="<%= url %>"><fmt:message key="setup.finished.login" /></a>
	</div>
88

89

90 91
</body>
</html>