%
/**
* Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
%>
<%
String userMappings = ParamUtil.getString(request, "userMappings", PrefsPropsUtil.getString(company.getCompanyId(), PropsKeys.LDAP_USER_MAPPINGS));
String[] userMappingArray = userMappings.split("\n");
String userMappingScreenName = StringPool.BLANK;
String userMappingPassword = StringPool.BLANK;
String userMappingEmailAddress = StringPool.BLANK;
String userMappingFullName = StringPool.BLANK;
String userMappingFirstName = StringPool.BLANK;
String userMappingLastName = StringPool.BLANK;
String userMappingJobTitle = StringPool.BLANK;
String userMappingGroup = StringPool.BLANK;
for (int i = 0 ; i < userMappingArray.length ; i++) {
if (userMappingArray[i].indexOf("=") == -1) {
continue;
}
String mapping[] = userMappingArray[i].split("=");
if (mapping.length != 2) {
continue;
}
if (mapping[0].equals("screenName")) {
userMappingScreenName = mapping[1];
}
else if (mapping[0].equals("password")) {
userMappingPassword = mapping[1];
}
else if (mapping[0].equals("emailAddress")) {
userMappingEmailAddress = mapping[1];
}
else if (mapping[0].equals("fullName")) {
userMappingFullName = mapping[1];
}
else if (mapping[0].equals("firstName")) {
userMappingFirstName = mapping[1];
}
else if (mapping[0].equals("lastName")) {
userMappingLastName = mapping[1];
}
else if (mapping[0].equals("jobTitle")) {
userMappingJobTitle = mapping[1];
}
else if (mapping[0].equals("group")) {
userMappingGroup = mapping[1];
}
mapping[1] = "";
}
String groupMappings = ParamUtil.getString(request, "groupMappings", PrefsPropsUtil.getString(company.getCompanyId(), PropsKeys.LDAP_GROUP_MAPPINGS));
String[] groupMappingArray = groupMappings.split("\n");
String groupMappingGroupName = StringPool.BLANK;
String groupMappingDescription = StringPool.BLANK;
String groupMappingUser = StringPool.BLANK;
for (int i = 0 ; i < groupMappingArray.length ; i++) {
if (userMappingArray[i].indexOf("=") == -1) {
continue;
}
String mapping[] = groupMappingArray[i].split("=");
if (mapping.length != 2) {
continue;
}
if (mapping[0].equals("groupName")) {
groupMappingGroupName = mapping[1];
}
else if (mapping[0].equals("description")) {
groupMappingDescription = mapping[1];
}
else if (mapping[0].equals("user")) {
groupMappingUser = mapping[1];
}
}
%>
Apache Directory Server
Fedora Directory Server
Microsoft Active Directory Server
Novell eDirectory
OpenLDAP
" onClick="updateDefaultLdap();" />
" onClick="testSettings('ldapConnection');" />
" onClick="testSettings('ldapUsers');" />
" onClick="testSettings('ldapGroups');" />
<%
long importInterval = ParamUtil.getLong(request, "importInterval", PrefsPropsUtil.getLong(company.getCompanyId(), PropsKeys.LDAP_IMPORT_INTERVAL));
%>