Some robustness

This commit is contained in:
moodler
2003-01-20 07:13:02 +00:00
parent dde4495df4
commit 37208cd23a
4 changed files with 19 additions and 13 deletions
+2
View File
@@ -189,6 +189,8 @@ function data_submitted($url="") {
/// checks the referer against the given url (it uses
/// the current page if none was specified.
global $CFG;
if (empty($_POST)) {
return false;
+2 -2
View File
@@ -81,8 +81,8 @@
<P><? print_string("loginsteps", "", "signup.php") ?></P>
</FONT>
<CENTER>
<FORM NAME="form4" ACTION="signup.php" METHOD=post>
<INPUT type="submit" NAME="Submit" VALUE="<? print_string("startsignup") ?>">
<FORM NAME="form4" ACTION="signup.php" METHOD=get>
<INPUT type="submit" VALUE="<? print_string("startsignup") ?>">
</FORM>
</CENTER>
<? break;
+6 -2
View File
@@ -15,6 +15,8 @@
$user->firstaccess = time();
$user->secret = random_string(15);
$db->debug = true;
if (! ($user->id = insert_record("user", $user)) ) {
error("Could not add your record to the database!");
}
@@ -33,8 +35,10 @@
}
}
if ($err) {
$focus = 'form.' . array_shift(array_flip(get_object_vars($err)));
if (!empty($err)) {
$focus = "form.".array_shift(array_flip(get_object_vars($err)));
} else {
$focus = "";
}
if (empty($user->country) and !empty($CFG->country)) {
+9 -9
View File
@@ -9,13 +9,13 @@
<tr valign=top>
<td><P><? print_string("username") ?>:</td>
<td><input type="text" name="username" size=12 value="<? p($user->username) ?>">
<? formerr($err->username) ?>
<? if (!empty($err->username)) { formerr($err->username); } ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("password") ?>:</td>
<td><input type="password" name="password" size=12 value="<? p($user->password) ?>">
<? formerr($err->password) ?>
<? if (!empty($err->password)) { formerr($err->password); } ?>
</td>
</tr>
<tr valign=top>
@@ -24,43 +24,43 @@
<tr valign=top>
<td><P><? print_string("email") ?>:</td>
<td><input type="text" name="email" size=25 value="<? p($user->email) ?>">
<? formerr($err->email) ?>
<? if (!empty($err->email)) { formerr($err->email); } ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("firstname") ?>:</td>
<td><input type="text" name="firstname" size=25 value="<? p($user->firstname) ?>">
<? formerr($err->firstname) ?>
<? if (!empty($err->firstname)) { formerr($err->firstname);} ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("lastname") ?>:</td>
<td><input type="text" name="lastname" size=25 value="<? p($user->lastname) ?>">
<? formerr($err->lastname) ?>
<? if (!empty($err->lastname)) { formerr($err->lastname);} ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("idnumber") ?>:</td>
<td><input type="text" name="idnumber" size=25 value="<? p($user->idnumber) ?>"> (<? print_string("optional") ?>)
<? formerr($err->idnumber) ?>
<? if (!empty($err->idnumber)) { formerr($err->idnumber);} ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("phone") ?>:</td>
<td><input type="text" name="phone" size=25 value="<? p($user->phone) ?>"> (<? print_string("optional") ?>)
<? formerr($err->phone) ?>
<? if (!empty($err->phone)) { formerr($err->phone);} ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("city") ?>:</td>
<td><input type="text" name="city" size=25 value="<? p($user->city) ?>">
<? formerr($err->city) ?>
<? if (!empty($err->city)) { formerr($err->city);} ?>
</td>
</tr>
<tr valign=top>
<td><P><? print_string("country") ?>:</td>
<td><? choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry"), "", "") ?>
<? formerr($err->country) ?>
<? if (!empty($err->country)) { formerr($err->country);} ?>
</td>
</tr>
<tr>