How to set up users without email addresses?

How to set up users without email addresses?

by Steve Rainwater -
Number of replies: 11
We use Moodle for an organization that includes elementary and pre-school children. It's uncommon for pre-schoolers to have email addresses. However, the Moodle user form requires an email address to create a student for a class room. I'm sure I can't be the first to hit this problem but I'm not having any luck finding the solution. It seems like there should just be an admin option to make the email address not be a required field. What are other schools doing for students that don't have email? Should I just use fake email addresses or is there a more elegant solution?
Average of ratings: -
In reply to Steve Rainwater

Re: How to set up users without email addresses?

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
The easiest option is to make fake emails.
In reply to Steve Rainwater

Re: How to set up users without email addresses?

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Steve,

Please see the documentation No email for various solutions.
In reply to Helen Foster

Re: How to set up users without email addresses?

by Wendy Muse -

Thanks for the link.

So to confirm, there is no way to turn off the security that requires an email for each new user?

Thanks

In reply to Steve Rainwater

Re: How to set up users without email addresses?

by Mel Ausman -

I just upload students from a spreadsheet file setting the emailstop value at 1.  Than, when your CSV is excepted it will ask you for a default email.  I use temp@temp.com, you could use anything.  This works fine.

You can get more information here:
http://docs.moodle.org/en/Upload_users

In reply to Mel Ausman

Re: How to set up users without email addresses?

by Daniel Wright -

I'm using Moodle 2.0.2. 

Is there still no way to simply not require an email address?  I have this need as well.  Users are created through an upload from Active Directory and authenticated through LDAP, and some do not have email addresses. 

I followed the instructions found in this thread: http://moodle.org/mod/forum/discuss.php?d=155913

I was able to make the profile page *appear* that email was not required, as it no longer shows up in red with an asterisk, etc.  However, you still cannot save a profile without an email address - it just gives you the "invalid email address" prompt.  So it is still a required field, even though it says it isn't. 

Also, I could not find the moodlelib.php file noted in this discussion.  Perhaps it has changed in 2.x?

Thanks for any help,

Dan

In reply to Daniel Wright

Re: How to set up users without email addresses?

by Daniel Wright -

I was able to edit the user/edit_form.php file to comment out the "invalid email address" error so that the user can now save the profile without an address.  Now looking to make it so that the user is not prompted to update the profile when no email address exists.

Average of ratings:Useful (1)
In reply to Daniel Wright

Re: How to set up users without email addresses?

by Iván Melgrati -

Dan,

The moodlelib.php file is located in the /lib folder. You should be able to edit the validation rules by following this tutorial.

Iván

Average of ratings:Useful (2)
In reply to Iván Melgrati

Re: How to set up users without email addresses?

by Daniel Wright -

Ivan - this worked perfectly!  Thank you so, so much for pointing me in the right direction.

In reply to Daniel Wright

Re: How to set up users without email addresses?

by Iván Melgrati -

I'm glad I could help. The real merit goes to the ones who figured it out in the first place.

Kind regards,

Iván

In reply to Iván Melgrati

Re: How to set up users without email addresses?

by Thomas Hanley -

Hi,

Thanks to everyone who have offered the above workarounds. For data confidentiality reasons I also need to configure Moodle so that our users cannot see eachothers email addresses.

I have just tried the PHP hacks using Moodle 2.03 and couldn't get this to work. I then requested help from Sean Keogh from our Moodle Partner Remote Learner who advised that a setting could be changed within Moodle's internal user database:

You can alter the field called emaildisplay. It defaults to the value 2 (presumably to allow emails to be visible).

However, this default can be changed in to 0, so that whenever a new account is created, whether manually or via the databae authentication, the email address of the user should be hidden from all other users.

Where there were existing users in the database whose record for emaildisplay was set to 2 Sean did a search and replace on them to make them all have 0 in that field. The post below by Noveck Gowandan also suggest this as a solution:

http://moodle.org/mod/forum/discuss.php?d=67723#p617062

~thomas

In reply to Thomas Hanley

Re: How to set up users without email addresses?

by Simon Allison -

ok so I did the changes in this post but now, all the images have gone and left a placeholder  on Moodle 2.5  what happened?   I think I will revert changes