Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.9.2, 1.9.3, 1.9.4
-
Fix Version/s: None
-
Component/s: Authentication
-
Labels:None
-
Environment:Not Operating System Dependent tested with PHP 4.3 and 5.25
-
Database:MySQL
-
Difficulty:Moderate
-
Affected Branches:MOODLE_19_STABLE
Description
Currently when a user exists in extauth (auth='ldap' ) and in the mdl_user table but using a different
authentication method like manual that username will not be included by auth.php sync_users. Simply the
sync_users script will skip this user rather than convert the user to auth='ldap' and update.
This issue has been known to cause users whom were once in extauth not to be able to authicate via
ldap successfully because their password was not stored in user table. User
account can be switched to manual and not revisited before a student tries to login. This
condition can be taken care of by sync_users.
I created the auth_ldap_convert_users.patch against my source and auth/ldap/auth.php Branch: MOODLE_19_STABLE .
Just thought I should share this idea with others whom may want to avoid allot of help desk calls over
students not being able to login due to users not being converted to the correct active/default authentication method.
Here is an overview of a test sync and exactly what will happen during auth_ldap_sync_users .
Configuring temp table
Creating temp table mdl_extuser
Connecting to ldap...
Search Filter: (&(sAMaccountName=*) (objectClass=user))
Searching Context: ou=Students,dc=rl,dc=kota,dc=net
+ 3 users
Got 3 records from LDAP
No user entries to be removed
No user entries to be revived
Validating user authentication method for LDAP users.
No users found to be updated!
User entries to update: 3
Updating user jdoe id 3
Updating user janedoe id 4
Updating user donduck id 5
No users to be added
Conversion Run:
Configuring temp table
Creating temp table mdl_extuser
Connecting to ldap...
Search Filter: (&(sAMaccountName=*)(objectClass=user))
Searching Context: ou=Students,dc=rl,dc=kota,dc=net
+ 3 users
Got 3 records from LDAP
No user entries to be removed
No user entries to be revived
Validating user authentication method for LDAP users.
User entries to update with ldap auth: 1
Updating user donduck id 5
User entries to update: 3
Updating user jdoe id 3
Updating user janedoe id 4
Updating user donduck id 5
No users to be added
oh - automatic conversion could create major problems here,
when you are migrating to ldap it is very easy to bulk change auth type by sql query
thanks for the report, it might be interesting for some ppl