profile-settings.jsp 5.76 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" %>
Gaston Dombiak's avatar
Gaston Dombiak committed
3 4 5 6 7
<%--
  -	$RCSfile$
  -	$Revision: $
  -	$Date: $
  -
8
  - Copyright (C) 2005-2008 Jive Software. All rights reserved.
Gaston Dombiak's avatar
Gaston Dombiak committed
9
  -
10 11 12 13 14 15 16 17 18 19 20
  - 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
21 22
--%>

23 24
<%@ 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
25 26 27

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

<html>
    <head>
        <title><fmt:message key="profile-settings.title"/></title>
        <meta name="pageID" content="profile-settings"/>
    </head>
    <body>
    <%
42
        boolean isLDAP = "org.jivesoftware.openfire.ldap.LdapAuthProvider".equals(
43
                JiveGlobals.getProperty("provider.auth.className"));
Gaston Dombiak's avatar
Gaston Dombiak committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57
    %>
    <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>
58 59
                        <input type="radio" <%= (isLDAP) ? "disabled" : "readonly"%>
                        <%= ((isLDAP) ? "" : "checked") %>>
Gaston Dombiak's avatar
Gaston Dombiak committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
                    </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) { %>
75 76 77 78 79 80 81 82 83 84 85 86 87
                <%
                    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
88 89 90 91 92 93 94 95 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
                <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>
135 136
                    <tr>
                        <td colspan="2" align="center">
137
                            <input type="submit" name="ldapedit" value="<fmt:message key="server.properties.edit" />">
138 139
                        </td>
                    </tr>
140
                <% } %>
Gaston Dombiak's avatar
Gaston Dombiak committed
141 142 143 144 145 146 147 148
            </tbody>
            </table>
        </div>
    </form>

</body>
</html>