Issue Details (XML | Word | Printable)

Key: MDL-7525
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Jay Lee
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

auth_sync_users() only knows mysql and postgres

Created: 14/Nov/06 04:06 AM   Updated: 05/Mar/07 08:17 PM
Return to search
Component/s: Authentication
Affects Version/s: 1.7
Fix Version/s: 1.8, 1.9

File Attachments: 1. Text File ldap_sync.patch (6 kB)

Environment:
-Patch tested on WinXP/Apache/PHP 5.1/MSSQL Server
-Oracle code has not been tested and probably needs work (suspect Oracle also does not support multiple inserts)
-eDirectory is only LDAP Server I've tested against but LDAP specific stuff should remain unchanged in this patch
Issue Links:
Dependency
 
Duplicate
 
Relates
 

Database: Microsoft SQL, Oracle
Participants: Eloy Lafuente (stronk7), Iñaki Arenaza, Jay Lee and Petr Skoda
Security Level: None
Resolved date: 05/Mar/07
Affected Branches: MOODLE_17_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
auth_sync_users() in auth/ldap/lib.php needs to create a temporary table so that it can quickly determine which external ldap accounts exist or don't exist in moodle. The code currently only knows how to create temporary tables for mysql and postgres. This patch should add support for doing it in mssql and oracle. A few comments:

  -this is my first patch submission attempt so go easy on me, I'd really appreciate constructive criticism
  -I looked but was unable to find a way to abstract the temporary table creation with adodb, if anyone knows of a way, it would be much prettier than the switch case statement I have now. As it stands, this will need updating with every new database system moodle supports.
  -It seemed to me that mssql was not dropping the temporary table when I ran the script multiple times within a few minutes of each other so I added the DROP table command at the end to be sure each run would be working with fresh data.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 17/Feb/07 10:24 AM
sync_users() now working both under MSSQL and Oracle. Big credits to
Jay Lee for his cool patch about MDL-7525 MDL-8023 MDL-8153
MODIFY auth/ldap/auth.php   Rev. 1.6.2.1    (+59 -20 lines)
Eloy Lafuente (stronk7) committed 1 file to 'Moodle CVS' - 17/Feb/07 10:26 AM
sync_users() now working both under MSSQL and Oracle. Big credits to
Jay Lee for his cool patch about MDL-7525 MDL-8023 MDL-8153

Merged from MOODLE_18_STABLE
MODIFY auth/ldap/auth.php   Rev. 1.7    (+59 -20 lines)