diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 3590b746d7d..efcb1dde463 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -117,6 +117,14 @@ if ($_GET["action"] == 'setvalue' && $user->admin) ('LDAP_CONTACT_DN','".$_POST["contact"]."',0);"; $db->query($sql); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'LDAP_SERVER_PROTOCOLVERSION';"; + $db->query($sql); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible) VALUES + ('LDAP_SERVER_PROTOCOLVERSION','".$_POST["version"]."',0);"; + $db->query($sql); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'LDAP_SERVER_TYPE';"; $db->query($sql); @@ -148,90 +156,92 @@ print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").' '; print "\n"; - if (defined("LDAP_SERVER_HOST") && LDAP_SERVER_HOST) - { - print ''.$langs->trans("LDAPServer").''.LDAP_SERVER_HOST.''; - } +if (defined("LDAP_SERVER_HOST") && LDAP_SERVER_HOST) +{ + print ''.$langs->trans("LDAPServer").''.LDAP_SERVER_HOST.''; +} +else +{ + print ''.$langs->trans("LDAPServer").''.$langs->trans("LDAPServerExample").''; +} +if (defined("LDAP_SERVER_PORT") && LDAP_SERVER_PORT) +{ + print ''.$langs->trans("LDAPServerPort").''.LDAP_SERVER_PORT.''; +} +else +{ + print ''.$langs->trans("LDAPServerPort").''.$langs->trans("LDAPServerPortExample").''; +} + +//suppression pour compatibilité divers config ldap +// +//if (defined("LDAP_SUFFIX_DN") && LDAP_SUFFIX_DN) +//{ +// print ''.$langs->trans("LDAPSuffix").''.LDAP_SUFFIX_DN.''; +//} +//else +//{ +// print ''.$langs->trans("LDAPSuffix").''.$langs->trans("LDAPSuffixExample").''; +//} + +if (defined("LDAP_ADMIN_DN") && LDAP_ADMIN_DN) +{ + print ''.$langs->trans("DNAdmin").''.LDAP_ADMIN_DN.''; +} +else +{ + print ''.$langs->trans("DNAdmin").''.$langs->trans("DNAdminExample").''; +} +if (defined("LDAP_ADMIN_PASS") && LDAP_ADMIN_PASS) +{ + print ''.$langs->trans("LDAPPassword").'********'; +} +else +{ + print ''.$langs->trans("LDAPPassword").''.$langs->trans("LDAPPasswordExample").''; +} +if (defined("LDAP_USER_DN") && LDAP_USER_DN) +{ + print ''.$langs->trans("DNUser").''.LDAP_USER_DN.''; +} +else +{ + print ''.$langs->trans("DNUser").''.$langs->trans("DNUserExample").''; +} +if (defined("LDAP_GROUP_DN") && LDAP_GROUP_DN) +{ + print ''.$langs->trans("DNGroup").''.LDAP_GROUP_DN.''; +} +else +{ + print ''.$langs->trans("DNGroup").''.$langs->trans("DNGroupExample").''; +} +if (defined("LDAP_CONTACT_ACTIVE") && LDAP_CONTACT_ACTIVE) +{ + print ''.$langs->trans("DNContactActive").''.$langs->trans("DNContactActiveYes").''; +} +else +{ + print ''.$langs->trans("DNContactActive").''.$langs->trans("DNContactActiveExample").''; +} +if (defined("LDAP_CONTACT_DN") && LDAP_CONTACT_DN) +{ + print ''.$langs->trans("DNContact").''.LDAP_CONTACT_DN.''; +} +else +{ + print ''.$langs->trans("DNContact").''.$langs->trans("DNContactExample").''; +} +if (defined("LDAP_SERVER_TYPE") && LDAP_SERVER_TYPE) +{ + print ''.$langs->trans("Type").''.LDAP_SERVER_TYPE.''; +} else - { - print ''.$langs->trans("LDAPServer").''.$langs->trans("LDAPServerExample").''; - } - if (defined("LDAP_SERVER_PORT") && LDAP_SERVER_PORT) - { - print ''.$langs->trans("LDAPServerPort").''.LDAP_SERVER_PORT.''; - } - else - { - print ''.$langs->trans("LDAPServerPort").''.$langs->trans("LDAPServerPortExample").''; - } - - //suppression pour compatibilité divers config ldap - // - //if (defined("LDAP_SUFFIX_DN") && LDAP_SUFFIX_DN) - //{ - // print ''.$langs->trans("LDAPSuffix").''.LDAP_SUFFIX_DN.''; - //} - //else - //{ - // print ''.$langs->trans("LDAPSuffix").''.$langs->trans("LDAPSuffixExample").''; - //} - - if (defined("LDAP_ADMIN_DN") && LDAP_ADMIN_DN) - { - print ''.$langs->trans("DNAdmin").''.LDAP_ADMIN_DN.''; - } - else - { - print ''.$langs->trans("DNAdmin").''.$langs->trans("DNAdminExample").''; - } - if (defined("LDAP_ADMIN_PASS") && LDAP_ADMIN_PASS) - { - print ''.$langs->trans("LDAPPassword").'********'; - } - else - { - print ''.$langs->trans("LDAPPassword").''.$langs->trans("LDAPPasswordExample").''; - } - if (defined("LDAP_USER_DN") && LDAP_USER_DN) - { - print ''.$langs->trans("DNUser").''.LDAP_USER_DN.''; - } - else - { - print ''.$langs->trans("DNUser").''.$langs->trans("DNUserExample").''; - } - if (defined("LDAP_GROUP_DN") && LDAP_GROUP_DN) - { - print ''.$langs->trans("DNGroup").''.LDAP_GROUP_DN.''; - } - else - { - print ''.$langs->trans("DNGroup").''.$langs->trans("DNGroupExample").''; - } - if (defined("LDAP_CONTACT_ACTIVE") && LDAP_CONTACT_ACTIVE) - { - print ''.$langs->trans("DNContactActive").''.$langs->trans("DNContactActiveYes").''; - } - else - { - print ''.$langs->trans("DNContactActive").''.$langs->trans("DNContactActiveExample").''; - } - if (defined("LDAP_CONTACT_DN") && LDAP_CONTACT_DN) - { - print ''.$langs->trans("DNContact").''.LDAP_CONTACT_DN.''; - } - else - { - print ''.$langs->trans("DNContact").''.$langs->trans("DNContactExample").''; - } - if (defined("LDAP_SERVER_TYPE") && LDAP_SERVER_TYPE) - { - print ''.$langs->trans("Type").''.LDAP_SERVER_TYPE.''; - } - else - { - print ''.$langs->trans("Type").''.$langs->trans("TypeExample").''; - } +{ + print ''.$langs->trans("Type").''.$langs->trans("TypeExample").''; +} + +print ''.$langs->trans("Version").''.LDAP_SERVER_PROTOCOLVERSION.''; print ''; @@ -255,11 +265,11 @@ print ''; print ''.$langs->trans("LDAPServerPort").''; if (defined("LDAP_SERVER_PORT") && LDAP_SERVER_PORT) { - print ''; + print ''; } else { - print ''; + print ''; } print ''; @@ -279,7 +289,7 @@ if (defined("LDAP_ADMIN_PASS") && LDAP_ADMIN_PASS) } else { - print ''; + print ''; } print ''; print ''.$langs->trans("DNUser").''; @@ -291,7 +301,7 @@ print ''; print ''.$langs->trans("DNContactActive").''; if (defined("LDAP_SERVER_TYPE") && LDAP_SERVER_TYPE == activedirectory) { - print '