Moodle

Adding data mapping for custom user fields

Details

  • Affected Branches:
    MOODLE_20_STABLE

Description

I'd like having the possibility to add data mapping for custom user fields when I use LDAP or DB auth modules

  1. customfields.patch
    03/Jun/11 2:57 AM
    981 kB
    Gilles-Philippe Leblanc
  2. patch2.patch
    20/Aug/09 3:47 AM
    13 kB
    Olav Jordan

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Sounds logical for me. Assigning to Martin for his consideration. Addressing for Moodle 2.0, perhaps as part of the auth/enrol rework?. Adding some specialists in custom profile fields & authentication/enrolments.

Thanks for report. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Sounds logical for me. Assigning to Martin for his consideration. Addressing for Moodle 2.0, perhaps as part of the auth/enrol rework?. Adding some specialists in custom profile fields & authentication/enrolments. Thanks for report. Ciao
Hide
Martin Dougiamas added a comment -

Yes, absolutely.

This would be part of the general process of converting most of of the fixed user profile fields into custom user fields in Moodle 2.0, which solves a lot of things. There is a bug for this somewhere ..... Shane?

Show
Martin Dougiamas added a comment - Yes, absolutely. This would be part of the general process of converting most of of the fixed user profile fields into custom user fields in Moodle 2.0, which solves a lot of things. There is a bug for this somewhere ..... Shane?
Hide
Domenico Pontari added a comment -

We already developed this feature for Moodle 1.8
If you think it could be useful for Moodle's developers I can post our hack.
However if you are planning a rework for auth component, it's better if you don't think about the code you wrote before.

Show
Domenico Pontari added a comment - We already developed this feature for Moodle 1.8 If you think it could be useful for Moodle's developers I can post our hack. However if you are planning a rework for auth component, it's better if you don't think about the code you wrote before.
Hide
Shane Elliott added a comment -

Related issue is: MDL-10908

Show
Shane Elliott added a comment - Related issue is: MDL-10908
Hide
Fernando Martin added a comment -

Hi there!

Finally I found a post related to my requirement. (happy for that)

Look, I'm connecting Moodle to an LDAP previously authenticated against a CAS server.
Among the fields in the LDAP tree I'm storing the userRoleID, which is quite suggesting of what is its purpose, don't you think?
Well... Now I need to find a way to bind that roleID to Moodle's roleIDs.

The problem here is that our client is a bit in a hurry and maybe he couldn't wait till v2.0

Is there any way / help / code you could give me in order to solve this?
Sorry, but I'm no familiar to Moodle's code even though I'm PHP dev.

Any guidelines will be very appreciated!

Thnx for reading.
Fernando Martin (aka "Pampa")

Show
Fernando Martin added a comment - Hi there! Finally I found a post related to my requirement. (happy for that) Look, I'm connecting Moodle to an LDAP previously authenticated against a CAS server. Among the fields in the LDAP tree I'm storing the userRoleID, which is quite suggesting of what is its purpose, don't you think? Well... Now I need to find a way to bind that roleID to Moodle's roleIDs. The problem here is that our client is a bit in a hurry and maybe he couldn't wait till v2.0 Is there any way / help / code you could give me in order to solve this? Sorry, but I'm no familiar to Moodle's code even though I'm PHP dev. Any guidelines will be very appreciated! Thnx for reading. Fernando Martin (aka "Pampa")
Hide
Petr Škoda (skodak) added a comment -

Please use moodle.org forums for general support, this might not be the best place

Show
Petr Škoda (skodak) added a comment - Please use moodle.org forums for general support, this might not be the best place
Hide
Fernando Martin added a comment -

Ok Petr.. sorry for my bad.

I came here Googling
I'll re-post my message.

Kind regards!
Pampa

Show
Fernando Martin added a comment - Ok Petr.. sorry for my bad. I came here Googling I'll re-post my message. Kind regards! Pampa
Hide
Olav Jordan added a comment -

Just wanted to say I made a patch for this issues in moodle 1.9

Show
Olav Jordan added a comment - Just wanted to say I made a patch for this issues in moodle 1.9
Hide
Olav Jordan added a comment -

patch for custom fields mapping to LDAP in moodle 1.9

Show
Olav Jordan added a comment - patch for custom fields mapping to LDAP in moodle 1.9
Hide
Michael Hughes added a comment -

Olav, I have got your patch working, kinda. The trouble is, unless there are already entries in user_info_data for the relevant custom fields, they are never updated on login. Should there be a bit somewhere that says 'if entries not present then create them before updating them from active directory fields'?

Show
Michael Hughes added a comment - Olav, I have got your patch working, kinda. The trouble is, unless there are already entries in user_info_data for the relevant custom fields, they are never updated on login. Should there be a bit somewhere that says 'if entries not present then create them before updating them from active directory fields'?
Hide
Pawel Suwinski added a comment -

Here is my refactored patch suited for 1.9.5 version: MDL-24252

Show
Pawel Suwinski added a comment - Here is my refactored patch suited for 1.9.5 version: MDL-24252
Hide
tommy do added a comment -

Hi everyone,

can anyone tell me if this patch works on moodle 2.0? I tried to apply this patch manually ( not run through GnuWin32 by adding the "+ row" and deactivating the "- row" which are described in the patch. Is that the right way to apply patches? Besides i would be appreciate if someone who has successfully done that could show me some screenshots of data mapping after adding fields.

Show
tommy do added a comment - Hi everyone, can anyone tell me if this patch works on moodle 2.0? I tried to apply this patch manually ( not run through GnuWin32 by adding the "+ row" and deactivating the "- row" which are described in the patch. Is that the right way to apply patches? Besides i would be appreciate if someone who has successfully done that could show me some screenshots of data mapping after adding fields.
Hide
Howard Miller added a comment -

It appears to be a patch for 1.9. It won't work in 2.0 (2.0 handles these fields differently AFAIK)

Show
Howard Miller added a comment - It appears to be a patch for 1.9. It won't work in 2.0 (2.0 handles these fields differently AFAIK)
Hide
Eloy Lafuente (stronk7) added a comment -

NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.

Show
Eloy Lafuente (stronk7) added a comment - NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.
Hide
Gilles-Philippe Leblanc added a comment -

Here is the patch for Moodle 2

Show
Gilles-Philippe Leblanc added a comment - Here is the patch for Moodle 2
Hide
Steve Bubb added a comment -

Hi all
I would like to try use this patch. Do I just use the linux patch command in the moodle directory?
Should this patch also work with moodle 2.1?
I only have very basic php code knowledge.
Thanks
Steve

Show
Steve Bubb added a comment - Hi all I would like to try use this patch. Do I just use the linux patch command in the moodle directory? Should this patch also work with moodle 2.1? I only have very basic php code knowledge. Thanks Steve
Hide
Christine Stange added a comment -

Steve - I was able to apply customfields.patch to 2.1.3 and it worked fine, as far as I can tell. I did a careful comparison though between the files before deciding what to merge. There were some differences between 2.0 and 2.1.3. If you only apply the custom fields related code (they're pretty obvious), then you should be okay. There were some files that were much more straightforward than others (ex. the 2 HTML files).

Show
Christine Stange added a comment - Steve - I was able to apply customfields.patch to 2.1.3 and it worked fine, as far as I can tell. I did a careful comparison though between the files before deciding what to merge. There were some differences between 2.0 and 2.1.3. If you only apply the custom fields related code (they're pretty obvious), then you should be okay. There were some files that were much more straightforward than others (ex. the 2 HTML files).