How to set up users without email addresses?

How to set up users without email addresses?

Steve Rainwater -
回帖数: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?
回复Steve Rainwater

Re: How to set up users without email addresses?

Helen Foster -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像 Translators的头像
Hi Steve,

Please see the documentation No email for various solutions.
回复Helen Foster

Re: How to set up users without email addresses?

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

回复Steve Rainwater

Re: How to set up users without email addresses?

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

回复Mel Ausman

Re: How to set up users without email addresses?

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

回复Daniel Wright

Re: How to set up users without email addresses?

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.

回复Daniel Wright

Re: How to set up users without email addresses?

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

回复Iván Melgrati

Re: How to set up users without email addresses?

Daniel Wright -

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

回复Daniel Wright

Re: How to set up users without email addresses?

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

回复Iván Melgrati

Re: How to set up users without email addresses?

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

回复Thomas Hanley

Re: How to set up users without email addresses?

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