Permalink
Browse files

Merge branch 'w13_MDL-26795_21_emailchange' of git://github.com/skoda…

…k/moodle
  • Loading branch information...
2 parents ce8b66c + c6a074f commit d2c4a97a70f6f3edae11a5e7e5e4d26431de35c9 Sam Hemelryk committed Mar 28, 2011
Showing with 23 additions and 26 deletions.
  1. +0 −15 auth/email/lang/en/auth_email.php
  2. +1 −1 auth/ldap/auth.php
  3. +1 −0 auth/ldap/lang/en/auth_ldap.php
  4. +11 −0 lang/en/auth.php
  5. +3 −3 user/edit.php
  6. +2 −2 user/editlib.php
  7. +5 −5 user/emailupdate.php
@@ -24,23 +24,8 @@
*/
$string['auth_emaildescription'] = 'Email confirmation is the default authentication method. When the user signs up, choosing their own new username and password, a confirmation email is sent to the user\'s email address. This email contains a secure link to a page where the user can confirm their account. Future logins just check the username and password against the stored values in the Moodle database.';
-$string['auth_emailchangecancel'] = 'Cancel email change';
-$string['auth_emailchangepending'] = 'Change pending. Open the link sent to you at {$a->preference_newemail}.';
$string['auth_emailnoemail'] = 'Tried to send you an email but failed!';
-$string['auth_emailnoinsert'] = 'Could not add your record to the database!';
-$string['auth_emailnowexists'] = 'The email address you tried to assign to your profile has been assigned to someone else since your original request. Your request for change of email address is hereby cancelled, but you may try again with a different address.';
$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the signup page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://recaptcha.net/learnmore.html for more details. <br /><em>PHP cURL extension is required.</em>';
$string['auth_emailrecaptcha_key'] = 'Enable reCAPTCHA element';
$string['auth_emailsettings'] = 'Settings';
-$string['auth_emailupdate'] = 'Email address update';
-$string['auth_emailupdatemessage'] = 'Dear {$a->fullname},
-
-You have requested a change of your email address for your user account at {$a->site}. Please open the following URL in your browser in order to confirm this change.
-
-{$a->url}';
-$string['auth_emailupdatesuccess'] = 'Email address of user <em>{$a->fullname}</em> was successfully updated to <em>{$a->email}</em>.';
-$string['auth_emailupdatetitle'] = 'Confirmation of email update at {$a->site}';
-$string['auth_changingemailaddress'] = 'You have requested a change of email address, from {$a->oldemail} to {$a->newemail}. For security reasons, we are sending you an email message at the new address to confirm that it belongs to you. Your email address will be updated as soon as you open the URL sent to you in that message.';
-$string['auth_invalidnewemailkey'] = 'Error: if you are trying to confirm a change of email address, you may have made a mistake in copying the URL we sent you by email. Please copy the address and try again.';
-$string['auth_outofnewemailupdateattempts'] = 'You have run out of allowed attempts to update your email address. Your update request has been cancelled.';
$string['pluginname'] = 'Email-based self-registration';
View
@@ -502,7 +502,7 @@ function user_signup($user, $notify=true) {
events_trigger('user_created', $user);
if (! send_confirmation_email($user)) {
- print_error('auth_emailnoemail', 'auth_email');
+ print_error('noemail', 'auth_ldap');
}
if ($notify) {
@@ -114,6 +114,7 @@
$string['needbcmath'] = 'You need the BCMath extension to use grace logins with Active Directory';
$string['needmbstring'] = 'You need the mbstring extension to change passwords in Active Directory';
$string['nodnforusername'] = 'Error in user_update_password(). No DN for: {$a->username}';
+$string['noemail'] = 'Tried to send you an email but failed!';
$string['notcalledfromserver'] = 'Should not be called from the web server!';
$string['noupdatestobedone'] = "No updates to be done\n";
$string['nouserentriestoremove'] = "No user entries to be removed\n";
View
@@ -60,6 +60,17 @@
$string['auth_usernameexists'] = 'Selected username already exists. Please choose a new one.';
$string['auto_add_remote_users'] = 'Auto add remote users';
$string['createpasswordifneeded'] = 'Create password if needed';
+$string['emailchangecancel'] = 'Cancel email change';
+$string['emailchangepending'] = 'Change pending. Open the link sent to you at {$a->preference_newemail}.';
+$string['emailnowexists'] = 'The email address you tried to assign to your profile has been assigned to someone else since your original request. Your request for change of email address is hereby cancelled, but you may try again with a different address.';
+$string['emailupdate'] = 'Email address update';
+$string['emailupdatemessage'] = 'Dear {$a->fullname},
+
+You have requested a change of your email address for your user account at {$a->site}. Please open the following URL in your browser in order to confirm this change.
+
+{$a->url}';
+$string['emailupdatesuccess'] = 'Email address of user <em>{$a->fullname}</em> was successfully updated to <em>{$a->email}</em>.';
+$string['emailupdatetitle'] = 'Confirmation of email update at {$a->site}';
$string['enterthenumbersyouhear'] = 'Enter the numbers you hear';
$string['enterthewordsabove'] = 'Enter the words above';
$string['errormaxconsecutiveidentchars'] = 'Passwords must have at most {$a} consecutive identical characters.';
View
@@ -169,7 +169,7 @@
$usernew->preference_newemailattemptsleft = 3;
$a->oldemail = $usernew->email = $user->email;
- $email_changed_html = $OUTPUT->box(get_string('auth_changingemailaddress', 'auth_email', $a), 'generalbox', 'notice');
+ $email_changed_html = $OUTPUT->box(get_string('auth_changingemailaddress', 'auth', $a), 'generalbox', 'notice');
$email_changed_html .= $OUTPUT->continue_button("$CFG->wwwroot/user/view.php?id=$user->id&amp;course=$course->id");
$email_changed = true;
}
@@ -225,8 +225,8 @@
$a->site = $SITE->fullname;
$a->fullname = fullname($user, true);
- $emailupdatemessage = get_string('auth_emailupdatemessage', 'auth_email', $a);
- $emailupdatetitle = get_string('auth_emailupdatetitle', 'auth_email', $a);
+ $emailupdatemessage = get_string('emailupdatemessage', 'auth', $a);
+ $emailupdatetitle = get_string('emailupdatetitle', 'auth', $a);
//email confirmation directly rather than using messaging so they will definitely get an email
if (!$mail_results = email_to_user($temp_user, get_admin(), $emailupdatetitle, $emailupdatemessage)) {
View
@@ -106,9 +106,9 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
// Do not show email field if change confirmation is pending
if (!empty($CFG->emailchangeconfirmation) and !empty($user->preference_newemail)) {
- $notice = get_string('auth_emailchangepending', 'auth_email', $user);
+ $notice = get_string('emailchangepending', 'auth', $user);
$notice .= '<br /><a href="edit.php?cancelemailchange=1&amp;id='.$user->id.'">'
- . get_string('auth_emailchangecancel', 'auth_email') . '</a>';
+ . get_string('emailchangecancel', 'auth') . '</a>';
$mform->addElement('static', 'emailpending', get_string('email'), $notice);
} else {
$mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"');
View
@@ -40,7 +40,7 @@
$preferences = get_user_preferences(null, null, $user->id);
$a = new stdClass();
$a->fullname = fullname($user, true);
-$stremailupdate = get_string('auth_emailupdate', 'auth_email', $a);
+$stremailupdate = get_string('emailupdate', 'auth', $a);
$PAGE->set_title(format_string($SITE->fullname) . ": $stremailupdate");
$PAGE->set_heading(format_string($SITE->fullname) . ": $stremailupdate");
@@ -52,7 +52,7 @@
} elseif ($preferences['newemailattemptsleft'] < 1) {
cancel_email_update($user->id);
- $stroutofattempts = get_string('auth_outofnewemailupdateattempts', 'auth_email');
+ $stroutofattempts = get_string('auth_outofnewemailupdateattempts', 'auth');
echo $OUTPUT->box($stroutofattempts, 'center');
} elseif ($key == $preferences['newemailkey']) {
@@ -62,7 +62,7 @@
// Detect duplicate before saving
if ($DB->get_record('user', array('email' => $user->email))) {
- $stremailnowexists = get_string('auth_emailnowexists', 'auth_email');
+ $stremailnowexists = get_string('emailnowexists', 'auth');
echo $OUTPUT->box($stremailnowexists, 'center');
echo $OUTPUT->continue_button("$CFG->wwwroot/user/view.php?id=$user->id");
} else {
@@ -72,15 +72,15 @@
$authplugin->user_update($olduser, $user);
events_trigger('user_updated', $user);
$a->email = $user->email;
- $stremailupdatesuccess = get_string('auth_emailupdatesuccess', 'auth_email', $a);
+ $stremailupdatesuccess = get_string('emailupdatesuccess', 'auth', $a);
echo $OUTPUT->box($stremailupdatesuccess, 'center');
echo $OUTPUT->continue_button("$CFG->wwwroot/user/view.php?id=$user->id");
}
} else {
$preferences['newemailattemptsleft']--;
set_user_preference('newemailattemptsleft', $preferences['newemailattemptsleft'], $user->id);
- $strinvalidkey = get_string('auth_invalidnewemailkey', 'auth_email');
+ $strinvalidkey = get_string('auth_invalidnewemailkey', 'auth');
echo $OUTPUT->box($strinvalidkey, 'center');
}

0 comments on commit d2c4a97

Please sign in to comment.