From 56cfbcd5c95a3aa0967217368cd241e82f38c097 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Tue, 15 Mar 2005 20:52:34 +0000 Subject: [PATCH] Allow LDAP logic to be reused by other modules --- auth/ldap/lib.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/auth/ldap/lib.php b/auth/ldap/lib.php index afb3b257aea..4de65b06dec 100644 --- a/auth/ldap/lib.php +++ b/auth/ldap/lib.php @@ -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;