Commit 91f7493f authored by Leigh B. Stoller's avatar Leigh B. Stoller

Changes for new title/affiliation fields.

parent a4406706
......@@ -92,14 +92,15 @@ echo "<tr>
<td><input type=\"text\" name=\"grp_URL\"
value=\"http://www.cs.berkeley.edu/netgrp/omcast/\"></td>
<td>*Email<br>Address:</td>
<td>*Title/Position:</td>
<td class=\"left\">
<input name=\"email\"";
<input name=\"usr_title\"";
if ($row) {
echo " type=\"readonly\" value=\"$row[usr_email]\">";
echo " type=\"readonly\" value=\"$row[usr_title]\">";
} else {
echo " type=\"text\">";
echo " type=\"text\" value=\"Professor\">";
}
echo " </td>
</tr>\n";
......@@ -110,48 +111,74 @@ echo "<tr>
<td><input type=\"text\" name=\"grp_expires\"
value=\"$expiretime\"></td>
<td>*Postal<br>Address:</td>
<td class=\"left\">
<input name=\"usr_addr\"";
<td>*Institutional<br>Affiliation:</td>
<td class=\"left\">
<input name=\"usr_affil\"";
if ($row) {
echo " type=\"readonly\" value=\"$row[usr_addr]\">";
echo " type=\"readonly\" value=\"$row[usr_affil]\">";
} else {
echo " type=\"text\">";
echo " type=\"text\" value=\"UCB Networks Group\">";
}
echo " </td>
</tr>\n";
echo "<tr>
<td>*Your institutional<br>affiliation:</td>
<td><input type=\"text\" name=\"grp_affil\"
value=\"UCB Networks Group\"></td>
<td>*Phone #:</td>
<td></td>
<td></td>
<td>*Email<br>Address:</td>
<td class=\"left\">
<input name=\"usr_phones\"";
<input name=\"email\"";
if ($row) {
echo " type=\"readonly\" value=\"$row[usr_phone]\">";
echo " type=\"readonly\" value=\"$row[usr_email]\">";
} else {
echo " type=\"text\">";
}
echo " </td>
</tr>\n";
#
# If a new usr, then provide a second password confirmation field.
# Otherwise, a blank spot.
#
echo "<tr>
<td>*Password:</td>
<td><input type=\"password\" name=\"password1\"></td>
</tr>\n";
#
# If a new usr, then provide a second password confirmation field.
#
<td>*Postal<br>Address:</td>
<td class=\"left\">
<input name=\"usr_addr\"";
if ($row) {
echo " type=\"readonly\" value=\"$row[usr_addr]\">";
} else {
echo " type=\"text\">";
}
echo " </td>
</tr>\n";
echo "<tr>";
if (! $row) {
echo "<tr>
<td>Retype<br>New Password:</td>
<td class=\"left\">
<input type=\"password\" name=\"password2\"></td>
</tr>\n";
echo "<td>*Retype<br>New Password:</td>
<td class=\"left\">
<input type=\"password\" name=\"password2\"></td>";
}
else {
echo "<td></td>
<td></td>";
}
echo " <td>*Phone #:</td>
<td class=\"left\">
<input name=\"usr_phones\"";
if ($row) {
echo " type=\"readonly\" value=\"$row[usr_phone]\">";
} else {
echo " type=\"text\">";
}
echo " </td>
</tr>\n";
?>
<tr>
......
......@@ -44,9 +44,13 @@ if (!isset($usr_addr) ||
strcmp($usr_addr, "") == 0) {
$formerror = "Postal Address";
}
if (!isset($grp_affil) ||
strcmp($grp_affil, "UCB Networks Group") == 0) {
$formerror = "Research Afilliation";
if (!isset($usr_affil) ||
strcmp($usr_affil, "UCB Networks Group") == 0) {
$formerror = "Institutional Afilliation";
}
if (!isset($usr_title) ||
strcmp($usr_title, "Professor") == 0) {
$formerror = "Title/Position";
}
if (!isset($usr_phones) ||
strcmp($usr_phones, "") == 0) {
......@@ -140,9 +144,10 @@ if (! $returning) {
$encoding = crypt("$password1");
$newuser_command = "INSERT INTO users ".
"(uid,usr_created,usr_expires,usr_name,usr_email,usr_addr,".
"usr_phone,usr_pswd,unix_uid,status) ".
"usr_title,usr_affil,usr_phone,usr_pswd,unix_uid,status) ".
"VALUES ('$grp_head_uid', now(), '$grp_expires', '$usr_name', ".
"'$email', '$usr_addr', '$usr_phones', '$encoding', ".
"'$email', '$usr_addr', '$usr_title', '$usr_affil', ".
"'$usr_phones', '$encoding', ".
"'$unix_uid', 'newuser')";
$newuser_result = mysql_db_query($TBDBNAME, $newuser_command);
if (! $newuser_result) {
......
......@@ -64,6 +64,8 @@ $usr_addr = $row[usr_addr];
$usr_name = $row[usr_name];
$usr_phone = $row[usr_phone];
$usr_passwd = $row[usr_pswd];
$usr_title = $row[usr_title];
$usr_affil = $row[usr_affil];
#
# Generate the form.
......@@ -109,6 +111,10 @@ echo "<tr>
<td class=\"left\">
<input type=\"password\" name=\"old_password\"></td>
<td>*Title/Position:</td>
<td class=\"left\">
<input type=\"text\" name=\"usr_title\"
value=\"$usr_title\"></td>
</tr>\n";
echo "<tr>
......@@ -116,6 +122,10 @@ echo "<tr>
<td class=\"left\">
<input type=\"password\" name=\"new_password1\"></td>
<td>*Institutional<br>Affiliation:</td>
<td class=\"left\">
<input type=\"text\" name=\"usr_affil\"
value=\"$usr_affil\"></td>
</tr>\n";
echo "<tr>
......
......@@ -36,6 +36,14 @@ if (!isset($usr_phone) ||
strcmp($usr_phone, "") == 0) {
$formerror = "Phone #";
}
if (!isset($usr_title) ||
strcmp($usr_title, "") == 0) {
$formerror = "Title/Position";
}
if (!isset($usr_affil) ||
strcmp($usr_affil, "") == 0) {
$formerror = "Institutional Affiliation";
}
if (!isset($old_password) || strcmp($old_password, "") == 0) {
$formerror = "Old Password";
}
......@@ -115,7 +123,9 @@ $insert_result = mysql_db_query($TBDBNAME,
"usr_email=\"$usr_email\", ".
"usr_addr=\"$usr_addr\", ".
"usr_phone=\"$usr_phone\", ".
"usr_expires=\"$usr_expires\" ".
"usr_expires=\"$usr_expires\", ".
"usr_title=\"$usr_title\", ".
"usr_affil=\"$usr_affil\" ".
"WHERE uid=\"$uid\"");
if (! $insert_result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment