74,7 → 74,8 |
$l_ldap_test_dn_ok = "Le DN de la base semble correct"; |
$l_ldap_error = "erreur LDAP"; |
$l_ldap_entries = "entrées dans la base"; |
$l_check = "Vérifier cette configuration"; |
$l_check = "Vérifier cette configuration"; |
$l_checkingConf = "Vérification de cette configuration..."; |
} else { // English |
$l_ldap_update = "LDAP settings updated"; |
$l_ldap_title = "External authentication : LDAP"; |
101,11 → 102,12 |
$l_ldap_test_connection_ok = "A LDAP connexion is established"; |
$l_ldap_test_bind_failed = "LDAP authentication failed (check the LDAP user and password)"; |
$l_ldap_test_bind_ok = "Successful authentication"; |
$l_ldap_test_dn_failed = "DN of the base seems to be wrong (check it)"; |
$l_ldap_test_dn_ok = "DN of the base seems to be ok"; |
$l_ldap_test_dn_failed = "DN of the base seems to be wrong (check it)"; |
$l_ldap_test_dn_ok = "DN of the base seems to be ok"; |
$l_ldap_error = "LDAP error"; |
$l_ldap_entries = "entries in the base"; |
$l_check = "Check this config"; |
$l_check = "Check this config"; |
$l_checkingConf = "Checking this configuration..."; |
} |
|
|
216,19 → 218,6 |
$ldap_uid = $conf['LDAP_UID']; |
$ldap_base_filter = $conf['LDAP_FILTER']; |
|
// TODO : check LDAP PHP extension loaded? |
// if (!extension_loaded('ldap')) { |
// exit(); |
// } |
|
$pos = strpos($ldap_server, '//'); |
if ($pos !== false) { |
// TODO : useless? |
$new_ldap_server = explode('//', $ldap_server); // pour discriminer le host et le protocole dans la notation "ldap://192.168.182.10" ou "ldaps://monldap.monentreperise.com" |
} else { |
$new_ldap_server = $ldap_server; |
} |
|
// AJAX LDAP configuration checker |
if (isset($_GET['conf_check'])) { |
$response = [ |
318,7 → 307,7 |
// Format HTTP POST data |
var post_data = Object.keys(ldap_config).map( function (k) { return encodeURIComponent(k) + '=' + encodeURIComponent(ldap_config[k]) } ).join('&'); |
|
messagesElem.innerHTML = '<?= 'Checking configuration...' /* TODO: need to translate */ ?>'; |
messagesElem.innerHTML = '<?= $l_checkingConf ?>'; |
|
var xhr = new XMLHttpRequest(); |
xhr.onreadystatechange = function() { |
406,7 → 395,7 |
<?= $l_ldap_server_text ?> |
</dt> |
<dd> |
<input id="ldap_server" size="40" name="ldap_server" value="<?= htmlspecialchars($ldap_server) ?>" oninput="onLdapStatusChange();"> |
<input type="text" id="ldap_server" size="40" name="ldap_server" value="<?= htmlspecialchars($ldap_server) ?>" oninput="onLdapStatusChange();"> |
</dd> |
</dl> |
<dl> |
415,7 → 404,7 |
<?= $l_ldap_base_dn_text ?> |
</dt> |
<dd> |
<input id="ldap_dn" size="40" name="ldap_base_dn" value="<?= htmlspecialchars($ldap_base_dn) ?>" oninput="onLdapStatusChange();"> |
<input type="text" id="ldap_dn" size="40" name="ldap_base_dn" value="<?= htmlspecialchars($ldap_base_dn) ?>" oninput="onLdapStatusChange();"> |
</dd> |
</dl> |
<dl> |
424,7 → 413,7 |
<?= $l_ldap_uid_text ?> |
</dt> |
<dd> |
<input id="ldap_uid" size="40" name="ldap_uid" value="<?= htmlspecialchars($ldap_uid) ?>" oninput="onLdapStatusChange();"> |
<input type="text" id="ldap_uid" size="40" name="ldap_uid" value="<?= htmlspecialchars($ldap_uid) ?>" oninput="onLdapStatusChange();"> |
</dd> |
</dl> |
<dl> |
433,7 → 422,7 |
<?= $l_ldap_base_filter_text ?> |
</dt> |
<dd> |
<input id="ldap_base_filter" size="40" name="ldap_base_filter" value="<?= htmlspecialchars($ldap_base_filter) ?>" oninput="onLdapStatusChange();"> |
<input type="text" id="ldap_base_filter" size="40" name="ldap_base_filter" value="<?= htmlspecialchars($ldap_base_filter) ?>" oninput="onLdapStatusChange();"> |
</dd> |
</dl> |
<dl> |
442,7 → 431,7 |
<?= $l_ldap_user_text ?> |
</dt> |
<dd> |
<input id="ldap_user" size="40" name="ldap_user" value="<?= htmlspecialchars($ldap_user) ?>" oninput="onLdapStatusChange();"> |
<input type="text" id="ldap_user" size="40" name="ldap_user" value="<?= htmlspecialchars($ldap_user) ?>" oninput="onLdapStatusChange();"> |
</dd> |
</dl> |
<dl> |
451,12 → 440,12 |
<?= $l_ldap_password_text ?> |
</dt> |
<dd> |
<input id="ldap_password" type="password" size="40" name="ldap_password" value="<?= htmlspecialchars($ldap_password) ?>" oninput="onLdapStatusChange();"> |
<input type="text" id="ldap_password" type="password" size="40" name="ldap_password" value="<?= htmlspecialchars($ldap_password) ?>" oninput="onLdapStatusChange();"> |
</dd> |
</dl> |
<p> |
<button id="btn-checkconf" onclick="checkConfig(); return false;"><?= $l_check ?></button> |
<input id="submit" type="submit" value="<?= $l_ldap_submit ?>" name="submit" title="<?= 'You need to check before submit' /* TODO: need to translate */ ?>"> |
<input id="submit" type="submit" value="<?= $l_ldap_submit ?>" name="submit"> |
</p> |
</fieldset> |
</form> |