Ask for email address again to help avoid typos

This commit is contained in:
moodler
2003-12-23 11:58:41 +00:00
parent fbf60b0194
commit 24157e96c0
3 changed files with 37 additions and 15 deletions
+2
View File
@@ -238,6 +238,7 @@ $string['editthisactivity'] = 'Edit this activity';
$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['potentialteachers'] = 'Potential teachers';
$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';
+22 -8
View File
@@ -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");
} else if ($user->email2 != $user->email) {
$err->email2 = get_string("invalidemail");
}
if (empty($user->city))
if (empty($user->city)) {
$err->city = get_string("missingcity");
}
if (empty($user->country))
if (empty($user->country)) {
$err->country = get_string("missingcountry");
}
return;
}
+13 -7
View File
@@ -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>