FN-GM Posted August 15, 2012 Posted August 15, 2012 Hi, When we rename users in AD (normally when they get married) in Moodle they are given fresh accounts rather than renaming the old one. Does anyone know how to make it rename? maybe @penfold_99 knows Thanks
Marci Posted August 16, 2012 Posted August 16, 2012 (edited) Nope, not afaia - the tie is done on username so if the username changes, then it's new account time. When a user logs in to an LDAP-enabled Moodle, it looks at the username you've tried to log in with and checks whether it exists in Moodle. If it doesn't, it checks against AD and if it finds it there then it creates a new Moodle account. The only way is to manually change the Moodle username BEFORE they next login to Moodle but after you've changed their account in AD. I use MySQLFront and BulkADUsers on desktop which makes it quick n' easy to change both tables via GUI. Alternatively, you could use ADLDAP for PHP and knock up a web interface to enter the change thru, and let the PHP pixies make the changes in both AD and MySQL/PostgreSQL simultaneously... Edited August 16, 2012 by Marci
FN-GM Posted August 16, 2012 Author Posted August 16, 2012 Nope - the tie is done on username so if the username changes, then it's new account time. When a user logs in to an LDAP-enabled Moodle, it looks at the username you've tried to log in with and checks whether it exists in Moodle. If it doesn't, it checks against AD and if it finds it there then it creates a new Moodle account. The only way is to manually change the Moodle username BEFORE they next login to Moodle but after you've changed their account in AD. I use MySQLFront and BulkADUsers on desktop which makes it quick n' easy to change both tables via GUI. Alternatively, you could use ADLDAP for PHP and knock up a web interface to enter the change thru, and let the PHP pixies make the changes in both AD and MySQL/PostgreSQL simultaneously... Ah the problem is AD is automatically updated when SIMS is. Might have to find another way around this.
FN-GM Posted August 16, 2012 Author Posted August 16, 2012 Can you get it look for a different AD attribute please?
Marci Posted August 16, 2012 Posted August 16, 2012 (edited) What version of moodle? There are ldap sync scripts kicking about that you could use... trigger it via cron every evening to keep things up to date... Using Moodle: LDAP sync users - what to do if LDAP search limits the # of records it'll return Using Moodle: LDAP Mass sync users Set up a bookmark for your data team to load whenever they change a username for instance. Have a look at the ldap authentication settings guide at http://docs.moodle.org/23/en/LDAP_authentication - you can change the user attribute to look at a different field in AD if required. Edited August 16, 2012 by Marci
FN-GM Posted August 16, 2012 Author Posted August 16, 2012 We are on 2.2 i already run the LDAP sync every night. What would i change to make it look at something else other than the usernames for the user accounts?
glennda Posted August 16, 2012 Posted August 16, 2012 Not tried this is 2.x but in 1.x you could edit the username in the database directly using something like phpmyadmin. You would just need to delete the second account.
FN-GM Posted August 16, 2012 Author Posted August 16, 2012 Not tried this is 2.x but in 1.x you could edit the username in the database directly using something like phpmyadmin. You would just need to delete the second account. You can do it within moodle. But AD accounts are automatically renamed, it wold be good to have something that will be fully automated.
penfold_99 Posted August 16, 2012 Posted August 16, 2012 You can do it within moodle. But AD accounts are automatically renamed, it wold be good to have something that will be fully automated. I believe it's possible to automate this but it would need additional applications in place to manage it. There is a logical way to match everything together but would need to know the use case more to understand if there were exceptions to the rules.
FN-GM Posted August 16, 2012 Author Posted August 16, 2012 (edited) Well each of our users has a unique attribute in AD. Can we use this instead of the username to cross reference to accounts? Then they will be no problems when the accounts are automatically renamed in AD. Thanks Edited August 16, 2012 by FN-GM
Marci Posted August 17, 2012 Posted August 17, 2012 Do your users know what that unique attribute is(?), as that would have to become their Moodle log in, then you just change the User Attribute within LDAP Settings to match that unique attribute.
FN-GM Posted August 17, 2012 Author Posted August 17, 2012 Do your users know what that unique attribute is(?), as that would have to become their Moodle log in, then you just change the User Attribute within LDAP Settings to match that unique attribute. They dont no, i would rather use the proper username as the login. Thanks
Marci Posted August 17, 2012 Posted August 17, 2012 Can't change it then... best suggestion I can make without delving into a full-on PHP automated solution is the bookmark to the sync script, and get whoever manages data to hit it whenever they've made a change.
FN-GM Posted August 17, 2012 Author Posted August 17, 2012 What a pain. I have booked a meeting with other people in School to see if we can change all staff usernames to a system where they wont change at all. Students user names are all numbers so we dont have this issue. Thanks
SYNACK Posted August 17, 2012 Posted August 17, 2012 What a pain. I have booked a meeting with other people in School to see if we can change all staff usernames to a system where they wont change at all. Students user names are all numbers so we dont have this issue. Thanks This is why we just use first names unless there is more than one of the same for teachers as they have this nasty habit of getting married, changing their names and screaching about their email addresses and logons the very next day. Much easier to just use first names as they hardly ever change.
FN-GM Posted August 17, 2012 Author Posted August 17, 2012 This is why we just use first names unless there is more than one of the same for teachers as they have this nasty habit of getting married, changing their names and screaching about their email addresses and logons the very next day. Much easier to just use first names as they hardly ever change. Our school seems to have a habit of employing people with the same first name! I think i would go down the route of numbers as usernames.
SYNACK Posted August 17, 2012 Posted August 17, 2012 Our school seems to have a habit of employing people with the same first name! I think i would go down the route of numbers as usernames. Who gets 666
FN-GM Posted August 17, 2012 Author Posted August 17, 2012 Who gets 666 Oh i have someone in mind!! I think i might give myself 007
penfold_99 Posted August 17, 2012 Posted August 17, 2012 What application do you use to create your accounts from SIMS.net? If you could add the user's local id (admission number for students) from SIMS to a active directory field you could then have a custom plugin written that extends the moodle ldap plugin to search for this id before creating a new account. If it finds the id it can rename the moodle account.
FN-GM Posted August 17, 2012 Author Posted August 17, 2012 What application do you use to create your accounts from SIMS.net? If you could add the user's local id (admission number for students) from SIMS to a active directory field you could then have a custom plugin written that extends the moodle ldap plugin to search for this id before creating a new account. If it finds the id it can rename the moodle account. Getting that populated in AD shouldn't be a problem. Where would i get the app written please?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now