Skip to content
Browse files

Ask for email address again to help avoid typos

  • Loading branch information...
1 parent fbf60b0 commit 24157e96c01d99f93c94c04ce8e87fc72f9db61e moodler committed Dec 23, 2003
Showing with 37 additions and 15 deletions.
  1. +2 −0 lang/en/moodle.php
  2. +22 −8 login/signup.php
  3. +13 −7 login/signup_form.html
View
2 lang/en/moodle.php
@@ -238,6 +238,7 @@
$string['editthiscategory'] = 'Edit this category';
$string['edituser'] = 'Edit user accounts';
$string['email'] = 'Email address';
+$string['emailagain'] = 'Email (again)';
$string['emailconfirm'] = 'Confirm your account';
$string['emailconfirmation'] = 'Hi $a->firstname,
@@ -620,6 +621,7 @@
$string['preferredlanguage'] = 'Preferred language';
$string['preview'] = 'Preview';
$string['previeworchoose'] = 'Preview or choose a theme';
+$string['previous'] = 'Previous';
$string['publicdirectory'] = 'Public directory';
$string['publicdirectory0'] = 'Please do not publish this site';
$string['publicdirectory1'] = 'Publish the site name only';
View
30 login/signup.php
@@ -94,31 +94,45 @@ function validate_form($user, &$err) {
}
- if (empty($user->password))
+ if (empty($user->password)) {
$err->password = get_string("missingpassword");
+ }
- if (empty($user->firstname))
+ if (empty($user->firstname)) {
$err->firstname = get_string("missingfirstname");
+ }
- if (empty($user->lastname))
+ if (empty($user->lastname)) {
$err->lastname = get_string("missinglastname");
+ }
- if (empty($user->email))
+ if (empty($user->email)) {
$err->email = get_string("missingemail");
- else if (! validate_email($user->email))
+ } else if (! validate_email($user->email)) {
$err->email = get_string("invalidemail");
- else if (record_exists("user", "email", $user->email))
+ } else if (record_exists("user", "email", $user->email)) {
$err->email = get_string("emailexists")." <A HREF=forgot_password.php>".get_string("newpassword")."?</A>";
+ }
+
+ if (empty($user->email2)) {
+ $err->email2 = get_string("missingemail");
- if (empty($user->city))
+ } else if ($user->email2 != $user->email) {
+ $err->email2 = get_string("invalidemail");
+ }
+
+
+ if (empty($user->city)) {
$err->city = get_string("missingcity");
+ }
- if (empty($user->country))
+ if (empty($user->country)) {
$err->country = get_string("missingcountry");
+ }
return;
}
View
20 login/signup_form.html
@@ -30,13 +30,13 @@
<td colspan="2"><p><b><?php print_string("createuserandpass") ?>:</b></p></td>
</tr>
<tr valign="top">
- <td><p><?php print_string("username") ?>:</p></td>
+ <td align=right><p><?php print_string("username") ?>:</p></td>
<td><input type="text" name="username" size="12" value="<?php p($user->username) ?>" />
<?php if (!empty($err->username)) { formerr($err->username); } ?>
</td>
</tr>
<tr valign="top">
- <td><p><?php print_string("password") ?>:</p></td>
+ <td align=right><p><?php print_string("password") ?>:</p></td>
<td><input type="password" name="password" size="12" value="<?php p($user->password) ?>" />
<?php if (!empty($err->password)) { formerr($err->password); } ?>
</td>
@@ -48,31 +48,37 @@
</td>
</tr>
<tr valign="top">
- <td><p><?php print_string("email") ?>:</p></td>
+ <td align=right><p><?php print_string("email") ?>:</p></td>
<td><input type="text" name="email" size="25" value="<?php p($user->email) ?>" />
<?php if (!empty($err->email)) { formerr($err->email); } ?>
</td>
</tr>
<tr valign="top">
- <td><p><?php print_string("firstname") ?>:</p></td>
+ <td align=right><p><?php print_string("emailagain") ?>:</p></td>
+ <td><input type="text" name="email2" size="25" value="<?php p($user->email2) ?>" />
+ <?php if (!empty($err->email2)) { formerr($err->email2); } ?>
+ </td>
+</tr>
+<tr valign="top">
+ <td align=right><p><?php print_string("firstname") ?>:</p></td>
<td><input type="text" name="firstname" size="25" value="<?php p($user->firstname) ?>" />
<?php if (!empty($err->firstname)) { formerr($err->firstname);} ?>
</td>
</tr>
<tr valign="top">
- <td><p><?php print_string("lastname") ?>:</p></td>
+ <td align=right><p><?php print_string("lastname") ?>:</p></td>
<td><input type="text" name="lastname" size="25" value="<?php p($user->lastname) ?>" />
<?php if (!empty($err->lastname)) { formerr($err->lastname);} ?>
</td>
</tr>
<tr valign="top">
- <td><p><?php print_string("city") ?>:</p></td>
+ <td align=right><p><?php print_string("city") ?>:</p></td>
<td><input type="text" name="city" size="25" value="<?php p($user->city) ?>" />
<?php if (!empty($err->city)) { formerr($err->city);} ?>
</td>
</tr>
<tr valign="top">
- <td><p><?php print_string("country") ?>:</p></td>
+ <td align=right><p><?php print_string("country") ?>:</p></td>
<td><?php choose_from_menu (get_list_of_countries(), "country", $user->country, get_string("selectacountry"), "", "") ?>
<?php if (!empty($err->country)) { formerr($err->country);} ?>
</td>

0 comments on commit 24157e9

Please sign in to comment.
Something went wrong with that request. Please try again.