russdev Posted December 15, 2006 Posted December 15, 2006 I have got moodle integrated into AD but what want to do is set some fields like location and country to default if not set in activedir does that make sense. Russ
fooby Posted December 15, 2006 Posted December 15, 2006 Half-code fooby-madeup if exist value for location in active directory set location == active_directory(location) else set location == "default_location" end if (not real code) Is this the logic you are looking for? There is a line in the Data Mapping section that states If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead. however where these "defaults" are I couldn't find in my install. I have included the data mapping settings from my setup here foobydata_mapping.doc
alan-d Posted December 15, 2006 Posted December 15, 2006 or if exist value for location in active directory set location == active_directory(location) else set location == "go home - it's friday anyway" end if
fooby Posted December 15, 2006 Posted December 15, 2006 If any of my line managers ask, alan-d said I can go home! woo!! fooby
Wildebeaste Posted March 13, 2008 Posted March 13, 2008 I've often had a problem with AD attributes transfering into Moodle. I'm setting up a new Moodle server (1.9) and LDAP auth works fine. Everyone can log on using their AD uername. However, I can't get the first name and surname attributes into Moodle. 'givenName', 'displayName' and 'sn' just put the log-on name (equivalent of 'sAMAccountName') into the fields. Other AD attributes such as 'mail', 'userPrincipleName' or 'sAMAccountName' put the appropriate information in. Am I missing something simple? I would've thought that if LDAP was authenticating properly, then these attributes would 'just work'. Any advice? Ta.
Jona Posted March 13, 2008 Posted March 13, 2008 I've often had a problem with AD attributes transfering into Moodle. I'm setting up a new Moodle server (1.9) and LDAP auth works fine. Everyone can log on using their AD uername. However, I can't get the first name and surname attributes into Moodle. 'givenName', 'displayName' and 'sn' just put the log-on name (equivalent of 'sAMAccountName') into the fields. Other AD attributes such as 'mail', 'userPrincipleName' or 'sAMAccountName' put the appropriate information in. Am I missing something simple? I would've thought that if LDAP was authenticating properly, then these attributes would 'just work'. Any advice? Ta. Use this utility to browse your ldap server http://www-unix.mcs.anl.gov/~gawor/ldap/ and see if you can locate the fields required.
andyrite Posted March 13, 2008 Posted March 13, 2008 http://www.computerperformance.co.uk/Logon/LDAP_attributes_active_directory.htm sn should be the surname. Don't understand why thats not working. I import all my users with a csv file and set them to ldap as authentication. Bit of a long way round but it gets my fields populated as I want.
Geoff Posted March 13, 2008 Posted March 13, 2008 The LDAP fields will only work if the LDAP user moodle is using to connect can update the fields on the LDAP server. Mere 'Domain User' access is insufficient for this.
ipmonkey Posted May 28, 2010 Posted May 28, 2010 Hi Guys. Any ideas... I too am trying to use the Data Mapping, my Bind user is Dom Admin so priviledges should be sufficient. However, when changing the LDAP fields to eg. 'givenName', 'sn' etc it refuses to save. Well, not refuses, but saves and deletes all the entries. It refuses to keep the changes. Other changes work fine. Are there any pre requisites to enable data mapping changes from default? regards
zbjsy Posted June 8, 2010 Posted June 8, 2010 (edited) I have got moodle integrated into AD but what want to do is set some fields like location and country to default if not set in activedir does that make sense. Russ It's easy to do, but you need to remember to edit the code after every update. edit: moodle\auth\ldap\auth.php search for : function get_userinfo($username) { at end of this you will see : $this->ldap_close(); return $result; add before : $result['country'] = 'GB'; $result['city'] = 'CHANGE TO WHAT YOU WANT'; Edited June 8, 2010 by zbjsy
zbjsy Posted June 8, 2010 Posted June 8, 2010 I've often had a problem with AD attributes transfering into Moodle. I'm setting up a new Moodle server (1.9) and LDAP auth works fine. Everyone can log on using their AD uername. However, I can't get the first name and surname attributes into Moodle. 'givenName', 'displayName' and 'sn' just put the log-on name (equivalent of 'sAMAccountName') into the fields. Other AD attributes such as 'mail', 'userPrincipleName' or 'sAMAccountName' put the appropriate information in. Am I missing something simple? I would've thought that if LDAP was authenticating properly, then these attributes would 'just work'. Any advice? Ta. First name: givenName Surname: sn Email address: mail Make sure the accounts have first name and last name filled in when you view them in ad users and computers!
Geoff Posted June 8, 2010 Posted June 8, 2010 Yes, ensure your AD is filled out with the correct info. If not you can get either moodle to ask the user to fill it out, or better yet, bulk import the data into AD on the windows side and just have moodle update it when users log in.
ipmonkey Posted June 8, 2010 Posted June 8, 2010 Cheers for your help guys, all seems OK now. Regards
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