Jump to content

Recommended Posts

Posted

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

Posted

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

 

fooby

data_mapping.doc

Posted

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

 

:D

  • 1 year later...
Posted

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.

Posted
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.

Posted
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.
  • 2 years later...
Posted

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

  • 2 weeks later...
Posted (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 by zbjsy
Posted
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!

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...