Configuration LDAP
Editer le fichier de configuration "config_inc.php" et ajouter les paramètres de connexion LDAP$g_login_method = LDAP;
$g_ldap_server = 'ldap://adresseIPserveur/';
$g_ldap_port = 389;
$g_ldap_root_dn = 'DC=???,DC=???';
$g_ldap_uid_field = 'sAMAccountName';
$g_ldap_realname_field = 'cn';
$g_ldap_bind_dn = 'nomUser';
$g_ldap_bind_passwd = 'password';
$g_use_ldap_email = ON;
$g_use_ldap_realname = OFF;
$g_ldap_protocol_version = 3;
$g_ldap_follow_referrals = OFF;
Configuration Authentification LDAP & MD5 à la fois
Editer le fichier "\core\authentication_api.php" et modifier la fonction "auth_does_password_match"function auth_does_password_match( $p_user_id, $p_test_password ) {
$t_configured_login_method = config_get( 'login_method' );
$t_password = user_get_field( $p_user_id, 'password' );
$t_login_methods = Array(MD5, CRYPT, PLAIN);
foreach ( $t_login_methods as $t_login_method ) {
# pass the stored password in as the salt
if ( auth_process_plain_password( $p_test_password, $t_password, $t_login_method ) == $t_password ) {
# Check for migration to another login method and test whether the password was encrypted
# with our previously insecure implemention of the CRYPT method
if ( ( $t_login_method != $t_configured_login_method ) ||
( ( CRYPT == $t_configured_login_method ) && substr( $t_password, 0, 2 ) == substr( $p_test_password, 0, 2 ) ) ) {
user_set_password( $p_user_id, $p_test_password, true );
}
return true;
}
}
if ( LDAP == $t_configured_login_method ) {
return ldap_authenticate( $p_user_id, $p_test_password );
}
return false;
}
Aucun commentaire:
Enregistrer un commentaire