profile-settings.jsp 8.12 KB
Newer Older
Gaston Dombiak's avatar
Gaston Dombiak committed
1
<%@ page import="org.jivesoftware.util.JiveGlobals" %>
2
<%@ page import="org.jivesoftware.openfire.ldap.LdapManager" %>
3
<%@ page import="org.jivesoftware.openfire.clearspace.ClearspaceManager" %>
Gaston Dombiak's avatar
Gaston Dombiak committed
4 5 6 7 8
<%--
  -	$RCSfile$
  -	$Revision: $
  -	$Date: $
  -
9
  - Copyright (C) 2005-2008 Jive Software. All rights reserved.
Gaston Dombiak's avatar
Gaston Dombiak committed
10
  -
11 12 13 14 15 16 17 18 19 20 21
  - Licensed under the Apache License, Version 2.0 (the "License");
  - you may not use this file except in compliance with the License.
  - You may obtain a copy of the License at
  -
  -     http://www.apache.org/licenses/LICENSE-2.0
  -
  - Unless required by applicable law or agreed to in writing, software
  - distributed under the License is distributed on an "AS IS" BASIS,
  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - See the License for the specific language governing permissions and
  - limitations under the License.
Gaston Dombiak's avatar
Gaston Dombiak committed
22 23
--%>

24 25
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
Gaston Dombiak's avatar
Gaston Dombiak committed
26 27 28

<%
    // Get parameters
29
    if (request.getParameter("ldapedit") != null) {
Gaston Dombiak's avatar
Gaston Dombiak committed
30 31 32 33
        // Redirect to first step.
        response.sendRedirect("ldap-server.jsp");
        return;
    }
34 35 36 37 38
    else if (request.getParameter("clearspaceedit") != null) {
        // Redirect to clearspace setup.
        response.sendRedirect("clearspace-integration.jsp");
        return;
    }
Gaston Dombiak's avatar
Gaston Dombiak committed
39 40 41 42 43 44 45 46 47
%>

<html>
    <head>
        <title><fmt:message key="profile-settings.title"/></title>
        <meta name="pageID" content="profile-settings"/>
    </head>
    <body>
    <%
48
        boolean isLDAP = "org.jivesoftware.openfire.ldap.LdapAuthProvider".equals(
49
                JiveGlobals.getProperty("provider.auth.className"));
50
        boolean isCLEARSPACE = "org.jivesoftware.openfire.clearspace.ClearspaceAuthProvider".equals(
51
                JiveGlobals.getProperty("provider.auth.className"));
Gaston Dombiak's avatar
Gaston Dombiak committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65
    %>
    <p>
    <fmt:message key="profile-settings.info"/>
    </p>

    <form action="profile-settings.jsp" method="post">
        <!--<div class="jive-contentBoxHeader">

        </div>-->
        <div class="jive-contentBox" style="-moz-border-radius: 3px;">
            <table cellpadding="3" cellspacing="3" border="0">
            <tbody>
                <tr>
                    <td width="1%" nowrap>
66 67
                        <input type="radio" <%= (isLDAP || isCLEARSPACE) ? "disabled" : "readonly"%>
                        <%= ((isLDAP || isCLEARSPACE) ? "" : "checked") %>>
Gaston Dombiak's avatar
Gaston Dombiak committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
                    </td>
                    <td width="99%">
                        <b><fmt:message key="setup.profile.default" /></b> - <fmt:message key="setup.profile.default_description" />
                    </td>
                </tr>
                <tr>
                    <td width="1%" nowrap>
                        <input type="radio" <%= isLDAP ? "readonly" : "disabled"%>
                        <%= (isLDAP ? "checked" : "") %>>
                    </td>
                    <td width="99%">
                        <b><fmt:message key="setup.profile.ldap" /></b> - <fmt:message key="setup.profile.ldap_description" />
                    </td>
                </tr>
                <% if (isLDAP) { %>
83 84 85 86 87 88 89 90 91 92 93 94 95
                <%
                    StringBuilder sb = new StringBuilder();
                    for (String host : LdapManager.getInstance().getHosts()) {
                        sb.append(host).append(", ");
                    }
                    String hosts = sb.toString();
                    if (hosts.trim().length() > 0) {
                        hosts = hosts.substring(0, hosts.length()-2);
                    }
                    int port = LdapManager.getInstance().getPort();
                    String baseDN = LdapManager.getInstance().getBaseDN();
                    String adminDN = LdapManager.getInstance().getAdminDN();
                %>
Gaston Dombiak's avatar
Gaston Dombiak committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
                <tr>
                    <td width="1%" nowrap>
                        &nbsp;
                    </td>
                    <td width="99%">
                        <table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="98%" align="right">
                        <thead>
                            <tr>
                                <th colspan="2"><fmt:message key="profile-settings.ldap_mapping_info" /></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td class="c1">
                                    <fmt:message key="setup.ldap.server.host" />:
                                </td>
                                <td class="c2">
                                    <%= hosts %>
                                </td>
                            </tr>
                            <tr>
                                <td class="c1">
                                    <fmt:message key="setup.ldap.server.port" />:
                                </td>
                                <td class="c2">
                                    <%= port %>
                                </td>
                            </tr>
                            <tr>
                                <td class="c1">
                                     <fmt:message key="setup.ldap.server.basedn" />:
                                </td>
                                <td class="c2">
                                    <%= baseDN %>
                                </td>
                            </tr>
                            <tr>
                                <td class="c1">
                                    <fmt:message key="setup.ldap.server.admindn" />:
                                </td>
                                <td class="c2">
                                    <%= adminDN %>
                                </td>
                            </tr>
                        </tbody>
                        </table>
                    </td>
143 144
                    <tr>
                        <td colspan="2" align="center">
145
                            <input type="submit" name="ldapedit" value="<fmt:message key="server.properties.edit" />">
146 147
                        </td>
                    </tr>
148 149 150 151 152 153 154 155 156
                <% } %>
                <tr>
                    <td width="1%" nowrap>
                        <input type="radio" <%= isCLEARSPACE ? "readonly" : "disabled"%>
                        <%= (isCLEARSPACE ? "checked" : "") %>>
                    </td>
                    <td width="99%">
                        <b><fmt:message key="setup.profile.clearspace" /></b> - <fmt:message key="setup.profile.clearspace_description" />
                    </td>
Gaston Dombiak's avatar
Gaston Dombiak committed
157
                </tr>
158 159
                <% if (isCLEARSPACE) { %>
                <%
160
                    String uri = ClearspaceManager.getInstance().getConnectionURI();
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
                %>
                <tr>
                    <td width="1%" nowrap>
                        &nbsp;
                    </td>
                    <td width="99%">
                        <table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="98%" align="right">
                        <thead>
                            <tr>
                                <th colspan="2"><fmt:message key="profile-settings.clearspace_mapping_info" /></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td class="c1">
176
                                    <fmt:message key="setup.clearspace.service.uri" />:
177 178
                                </td>
                                <td class="c2">
179
                                    <%= uri %>
180 181 182 183 184 185 186 187 188 189
                                </td>
                            </tr>
                        </tbody>
                        </table>
                    </td>
                    <tr>
                        <td colspan="2" align="center">
                            <input type="submit" name="clearspaceedit" value="<fmt:message key="server.properties.edit" />">
                        </td>
                    </tr>
Gaston Dombiak's avatar
Gaston Dombiak committed
190 191 192 193 194 195 196 197 198
                <% } %>
            </tbody>
            </table>
        </div>
    </form>

</body>
</html>