LDAP Authentication

LDAP Authentication

by elena caldirola -
Number of replies: 4

Hi everybody,

the student of my university can access Moodle inserting the same credentials used for digital services (LDAP authentication). All is OK.

But: Our LDAP has NOT fields like CITY/TOWN and STATE.

In Administration > Location I put as default value for State: Italy, but it works only if I create a new user as Administrator.

So, once logged, in the case of an authenticated user via LDAP, these user fields (CITY/TOWN and STATE) are empty. If the user updates his/her profile with photo, Moodle doesn't save, and the reason is lack of CITY/TOWN and STATE. I know why, students don't... and they say that Moodle doesn't allow photo updating.

How can I manage in order to give to these fields a default value (i. e. the city of my university and the state where we live) ?

Average of ratings: -
In reply to elena caldirola

Svar: LDAP Authentication

by Flosi Kristjánsson -

It is possible, in Moodle 2.0.2, to set both default country and default city. These can both be changed by anyone authorized to access the user's credentials.

Got to Administration > Location > Location settings

The third and fourth fields are where you can choose a country from a drop-down menu and write in the name of the default city.

In reply to Flosi Kristjánsson

Re: Svar: LDAP Authentication

by elena caldirola -
Thank you Flosi for your help. Unfortunately, my Moodle version is 1.9.2. Any other suggestion? Thx E.
In reply to elena caldirola

Re: Svar: LDAP Authentication

by Les Ingleby -

How about writing a PHP script that inserts the default information after you do the user sync with LDAP?

In reply to elena caldirola

Re: Svar: LDAP Authentication

by Rosario Carcò -

Elena, if you use LDAP to an Active Directory from Microsoft, like I do, then you have to map the fiels correctly.

The First Name maps to givenName

The surname maps to sn

The email address maps to email

The city maps to L (only the letter L, maybe for Location)

The country maps to co

These are the names of the attributes/variables in Active Directory. You can discover such names with utilities like ldp.exe or other AD-browsers.

Of course, if you use LDAP to another type of directory, you must map to those names.

Rosario (dalla Svizzera, saluti)