I run a moodle website for a local school district, and we use LDAP and Active Directory to authenticate our users. We'd like to make entering an email address optional, because a lot of the younger students don't have their own email address, and also wouldn't be able to check it from school anyway. We just upgraded to 1.7 and I was hoping it would be an option in the new version. When we had 1.5.3, I changed some code to make it work, but It messed some other things up and I'd like to not have to do that again. Any options? Has this been a problem for anyone else?
Thanks!
Steven
Hi Rob
We tried something similar but found that when Moodle tried to send the mail to the fake address (like when the user contributed to a forum) the moodle admin got a load of mails notifying of undeliverable mail. If we were to do this college wide (our students don't have a college provided email address) we would get unmanageable amounts of mail.
Any ways around this that you have found?
username, password, firstname, lastname, country, email, emailstop
test1, test1, Test, Eins, GB, test1@mail.com, 0
test2, test2, Test, Zwei, AU, test2@nomail.xy, 1
test3, test3, Test, Drei, US, test3@nomail.xy, 1
test4, test4, Test, Vier, DE, test4@mail.com, 0
The parameter "emailstop" must be set to 1 if the mail address should NOT work. If you set it to 0 then the mail address is switched on. If you want to have all the mail addresses activ then you do not need the additional parameter in your upload file. In my example you see test1 and test4 active and this users will get mails. The mail addresses of test2 and test3 are NOT active and both do not get mails.
I wanted to get this parameter, too. At school we often have users who do not have a mail address when we start with a new Moodle class. Now it's possible to upload ALL users and switch off mailings for those with dummy addresses.
This works in Moodle 1.8.2+ and 1.9 dev after you updated your server with a new version.
Thanks! Ralf
Here's what I'm using:
username,password,firstname,lastname,email,emailstop,lang,idnumber,autosubscribe,maildisplay
test1,secret,bob,mctest,mctest@example.com,1,en_us,34543,0,0
I upload this and get:
"emailstop" is not a valid field name.
Using 1.8.2+
This doesnt make sense! See the conversation I was replying to.
Plus, MoodleDocs has the following:
Turn email off: The parameter emailstop must be set to 1 if the email address should not work. If you set it to 0 then the email address is switched on. If you want to have all the email addresses active then you do not need the additional parameter in your upload file.
Source: http://docs.moodle.org/en/Upload_users
Am I missing something?
Reference: http://moodle.org/mod/forum/discuss.php?d=33371
This did the trick.
Anyway, I added it the same way emailstop was added here.
Jason
We had a smiliar problem... when adding users manually after our initial upload. I blocked the following lines in edit.php in the "user" folder to cause Moodle 1.7 to ignore checking to see if email addresses were the same as an existing user. Please use at your own risk, as I'm not sure if there are possible negative side effects to doing this. Our specific problem was new students with the same email address (their parents):
lines 457 - 467
// } else if ($otheruser = get_record("user", "email", $usernew->email)) {
// if ($otheruser->id <> $user->id) {
// $err["email"] = get_string("emailexists");
// }
}
// if (empty($err["email"]) and !has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
// if ($error = email_is_not_allowed($usernew->email)) {
// $err["email"] = $error;
// }
// }
If you have upgraded to 1.9, I'm curious whether the same code still applies. We have 1.9, and the same problem, as some of our overseas students all receive email through a single proctor's email address. Did this code fix work even after upgrading your version of Moodle?
Thanks for the help,
Bethany
NationsUniversity