Commit 0578c1f6 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Title and Affiliation changes.

parent 5cf1ef67
......@@ -55,6 +55,10 @@ $expiretime = date("m/d/Y", time() + (86400 * 90));
</tr>
<?php
#
# Name: and Username:
#
echo "<tr>
<td>*Name (no blanks):</td>
<td><input type=\"text\" name=\"gid\" value=\"ucb-omcast\"></td>
......@@ -71,6 +75,9 @@ else {
echo " </td>
</tr>\n";
#
# Long Name: and Full Name:
#
echo "<tr>
<td>*Long name:</td>
<td><input type=\"text\" name=\"grp_name\"
......@@ -87,6 +94,9 @@ if ($row) {
echo " </td>
</tr>\n";
#
# URL: and Title/Position:
#
echo "<tr>
<td>+URL:</td>
<td><input type=\"text\" name=\"grp_URL\"
......@@ -104,6 +114,9 @@ if ($row) {
echo " </td>
</tr>\n";
#
# Expires: and Affiliation:
#
echo "<tr>
<td>When do&nbsp;you<br>
expect&nbsp;to&nbsp;be&nbsp;done<br>
......@@ -123,6 +136,9 @@ if ($row) {
echo " </td>
</tr>\n";
#
# Blank and Email:
#
echo "<tr>
<td></td>
<td></td>
......@@ -139,8 +155,7 @@ echo " </td>
</tr>\n";
#
# If a new usr, then provide a second password confirmation field.
# Otherwise, a blank spot.
# PawwordL and Postal Address:
#
echo "<tr>
<td>*Password:</td>
......@@ -157,7 +172,10 @@ if ($row) {
echo " </td>
</tr>\n";
#
# If a new usr, then provide a second password confirmation field.
# Otherwise, a blank spot.
#
echo "<tr>";
if (! $row) {
echo "<td>*Retype<br>New Password:</td>
......
......@@ -5,6 +5,8 @@
</head>
<body>
<?php
include("defs.php3");
$uid = "";
if ( ereg("php3\?([[:alnum:]]+)",$REQUEST_URI,$Vals) ) {
$uid=$Vals[1];
......@@ -12,6 +14,30 @@ if ( ereg("php3\?([[:alnum:]]+)",$REQUEST_URI,$Vals) ) {
} else {
unset($uid);
}
#
# If a uid came in, verify that it is known in the database
#
if (isset($uid)) {
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM users WHERE uid='$uid'");
if (! $query_result) {
$err = mysql_error();
TBERROR("Database Error confirming user $uid: $err\n", 1);
}
if (($row = mysql_fetch_array($query_result)) == 0) {
USERERROR("You do not appear to have an account!", 1);
}
$usr_expires = $row[usr_expires];
$usr_email = $row[usr_email];
$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];
}
echo "<h1>Apply for Project Membership</h1>\n";
echo "<table align=\"center\" border=\"1\">\n";
echo "<tr><td align='center' colspan=\"4\">\n";
......@@ -21,27 +47,31 @@ if (isset($uid)) {
echo "<input type=\"hidden\" name=\"logged_in\" value=\"true\">";
echo "<tr><td>*Username:</td><td class=\"left\">";
echo "<input type=\"readonly\" name=\"uid\" value=\"$uid\"></td>";
$query = mysql_db_query("tbdb","select usr_expires,usr_email,usr_addr,usr_name,usr_phone,usr_pswd from users where uid='$uid'");
$row = mysql_fetch_row($query);
echo "<td>Expiration date:</td>";
echo "<td class=\"left\"><input type=\"readonly\" name=\"usr_expires\" ";
echo "value=\"$row[0]\"</td></tr>\n";
echo "value=\"$usr_expires\"</td></tr>\n";
echo "<tr><td>*Email Address:</td><td class=\"left\"><input type=\"readonly\" ";
echo "name=\"usr_email\" value=\"$row[1]\"></td>";
echo "name=\"usr_email\" value=\"$usr_email\"></td>";
echo "<td>Mailing Address:</td><td class=\"left\">";
echo "<input type=\"readonly\" name=\"usr_addr\" ";
echo "value=\"$row[2]\"></td></tr>";
echo "value=\"$usr_addr\"></td></tr>";
echo "<tr><td>*Full Name:</td><td class=\"left\">";
echo "<input type=\"readonly\" name=\"usr_name\" ";
echo "value=\"$row[3]\"></td>";
echo "value=\"$usr_name\"></td>";
echo "<td>Phone #:</td><td class=\"left\">";
echo "<input type=\"readonly\" name=\"usr_phone\" ";
echo "value=\"$row[4]\"></td></tr>";
echo "value=\"$usr_phone\"></td></tr>";
echo "<tr><td>*Password:</td><td>";
echo "<input type=\"password\" name=\"password1\"></td></tr>";
echo "<tr><td>*Retype<br>Password:</td><td>";
echo "<input type=\"hidden\" name=\"password2\" ";
echo "value=\"$row[5]\">&nbsp;</td></tr>";
echo "<input type=\"password\" name=\"password1\"></td>";
echo "<td>*Title/Position:</td><td class=\"left\">";
echo "<input type=\"readonly\" name=\"usr_title\"";
echo "value=\"$usr_title\"></td>";
echo "</tr>";
echo "<tr><td></td><td></td>";
echo "<td>*Institutional<br>Affiliation:</td><td class=\"left\">";
echo "<input type=\"readonly\" name=\"usr_affil\"";
echo "value=\"$usr_affil\"></td>";
echo "</tr>";
} else {
echo "<form action=\"usradded.php3\" method=\"post\">\n";
echo "<tr><td>*Username:</td><td><input type=\"text\" name=\"uid\"></td>";
......@@ -57,9 +87,15 @@ if (isset($uid)) {
echo "<td>Phone #:</td><td>";
echo "<input type=\"text\" name=\"usr_phone\"></td></tr>";
echo "<tr><td>*Password:</td><td>";
echo "<input type=\"password\" name=\"password1\"></td></tr>";
echo "<input type=\"password\" name=\"password1\"></td>";
echo "<td>*Title/Position:</td>";
echo "<td><input type=\"text\" name=\"usr_title\"></td>";
echo "</tr>";
echo "<tr><td>*Retype<br>Password:</td><td>";
echo "<input type=\"password\" name=\"password2\"></td></tr>";
echo "<input type=\"password\" name=\"password2\"></td>";
echo "<td>*Institutional<br>Affiliation:</td>";
echo "<td><input type=\"text\" name=\"usr_affil\"></td>";
echo "</tr>";
}
echo "<tr><td>*Project:</td><td>";
echo "<input type=\"text\" name=\"grp\"></td>";
......
......@@ -32,12 +32,20 @@ if (!isset($grp) ||
strcmp($grp, "") == 0) {
$formerror = "Project";
}
if (!isset($usr_affil) ||
strcmp($usr_affil, "") == 0) {
$formerror = "Institutional Afilliation";
}
if (!isset($usr_title) ||
strcmp($usr_title, "") == 0) {
$formerror = "Title/Position";
}
#
# Not sure about the passwd. If the user is already known, then is he
# supposed to plug his passwd in?
# The first password field must always be filled in. The second only
# if a new user, and we will catch that later.
#
if ((!isset($password1) || strcmp($password1, "") == 0) ||
(!isset($password2) || strcmp($password2, "") == 0)) {
if (!isset($password1) ||
strcmp($password1, "") == 0) {
$formerror = "Password";
}
......@@ -118,9 +126,10 @@ if (! $returning) {
$newuser_command = "INSERT INTO users ".
"(uid,usr_created,usr_expires,usr_name,usr_email,usr_addr,".
"usr_phone,usr_pswd,unix_uid,status) ".
"usr_phone,usr_title,usr_affil,usr_pswd,unix_uid,status) ".
"VALUES ('$uid',now(),'$usr_expires','$usr_name','$usr_email',".
"'$usr_addr','$usr_phone','$encoding','$unix_uid','newuser')";
"'$usr_addr','$usr_phone','$usr_title','$usr_affil',".
"'$encoding','$unix_uid','newuser')";
$newuser_result = mysql_db_query($TBDBNAME, $newuser_command);
if (! $newuser_result) {
$err = mysql_error();
......
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