Allow LDAP logic to be reused by other modules

This commit is contained in:
martinlanghoff
2005-03-15 20:52:34 +00:00
parent 638b0186c9
commit 56cfbcd5c9
+8 -2
View File
@@ -37,6 +37,12 @@
* @param string $password
*
*/
// LDAP functions are reused by other auth libs
if (!defined('AUTH_LDAP_NAME')) {
define('AUTH_LDAP_NAME', 'ldap');
}
function auth_user_login ($username, $password) {
global $CFG;
@@ -288,7 +294,7 @@ function auth_get_users($filter='*', $dontlistcreated=false) {
//quick way to get around binarystrings
$user->guid=bin2hex($user->guid);
//add authentication source stamp
$user->auth='ldap';
$user->auth = AUTH_LDAP_NAME;
$fresult[$user->username]=$user;
}
@@ -568,7 +574,7 @@ function auth_sync_users ($bulk_insert_records = 1000, $do_updates=1) {
// prep a few params
$user->modified = time();
$user->confirmed = 1;
$user->auth = 'ldap';
$user->auth = AUTH_LDAP_NAME;
// insert it
$old_debug=$CFG->debug;