LDAP/SSO and Moodle email field - does it have to be mandatory?

LDAP/SSO and Moodle email field - does it have to be mandatory?

by Alek Steva -
Number of replies: 2

Hi all,

I have set up successfully LDAP SSO Moodle functionality against company's AD. For small number of employees, who have AD account but don't have email address, they are stuck at the profile page and cannot forward to the courses. It would not be too convenient to ask from them to put some fake addresses, it would not be professional.

 

What would be the best approach to the problem? Is there a way to setup Moodle (ver 3.1.9) not to skip somehow email as mandatory field or in some other way. I would like to keep LDAP with these accounts if possible.

 

Thanks in advance and kind regards.


Average of ratings: -
In reply to Alek Steva

Re: LDAP/SSO and Moodle email field - does it have to be mandatory?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The only way I know of is by editing lib/moodlelib.php, and changing function user_not_full_set_up(). There is a check there to make sure firstname, lastname and email are set.

But then again Moodle assumes all over the place that users have a (ideally working) email address. So you might get unexpected behaviour when performing some actions that rely on those addresses being there.

Saludos. Iñaki.

In reply to Iñaki Arenaza

Re: LDAP/SSO and Moodle email field - does it have to be mandatory?

by Alek Steva -

Thanks a lot Iñaki.

I've ended up giving fake email addresses in AD to users previously w/o email addresses.

But, really, there is a strong use case that sometimes email addresses could be null for users.

Kind regards