addusr.php3 5.91 KB
Newer Older
1
<?php
2 3
include("defs.php3");

4 5
PAGEHEADER("New User");

6 7 8 9 10 11 12
$uid = "";
if ( ereg("php3\?([[:alnum:]]+)",$REQUEST_URI,$Vals) ) {
  $uid=$Vals[1];
  addslashes($uid);
} else {
  unset($uid);
}
13 14

#
15 16 17
# If a uid came in, then we check to see if the login is valid.
# If the login is not valid, then quit cause we don't want to display the
# personal information for some random ?uid argument.
18 19
#
if (isset($uid)) {
20 21 22
    if (CHECKLOGIN($uid) != 1) {
        USERERROR("You are not logged in. Please log in and try again.", 1);
    }
23 24 25 26 27 28 29 30 31 32 33
    $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];
Leigh B. Stoller's avatar
Leigh B. Stoller committed
34
    $usr_URL     = $row[usr_URL];
35 36 37 38 39 40
    $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];
41 42

    $returning = 1;
43
}
44 45 46 47
else {
    $returning = 0;
}
?>
48

49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
<table align="center" border="1"> 
<tr>
    <td colspan="2">
        <h1 align="center">Apply for Project Membership</h1></td>
</tr>

<tr>
    <td align="center" colspan="2">
        Fields marked with * are required.</td>
</tr>
<form action="usradded.php3" method="post">

<?php
if ($returning) {
    echo "<tr>
64
              <td>*Username (no blanks):</td>
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
              <td class=\"left\">
                  <input type=\"readonly\" name=\"uid\" value=\"$uid\"></td>
          </tr>\n";

    echo "<tr>
              <td>*Full Name:</td>
              <td class=\"left\">
                  <input type=\"readonly\" name=\"usr_name\"
                         value=\"$usr_name\"></td>
          </tr>\n";

    echo "<tr>
              <td>*Title/Position:</td>
              <td class=\"left\">
                  <input type=\"readonly\" name=\"usr_title\"
                         value=\"$usr_title\"></td>
          </tr>\n";
    
    echo "<tr>
              <td>*Institutional<br>Affiliation:</td>
              <td class=\"left\">
                  <input type=\"readonly\" name=\"usr_affil\"
                         value=\"$usr_affil\"></td>
          </tr>\n";

    echo "<tr>
              <td>*Email Address:</td>
              <td class=\"left\">
                  <input type=\"readonly\" name=\"usr_email\"
                         value=\"$usr_email\"></td>
          </tr>\n";

Leigh B. Stoller's avatar
Leigh B. Stoller committed
97 98 99 100 101 102 103
    echo "<tr>
              <td>Home Page URL:</td>
              <td class=\"left\">
                  <input type=\"readonly\" name=\"usr_url\"
                         value=\"$usr_URL\"></td>
          </tr>\n";

104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
    echo "<tr>
              <td>Mailing Address:</td>
              <td class=\"left\">
                  <input type=\"readonly\" name=\"usr_addr\"
                         value=\"$usr_addr\"></td>
          </tr>\n";

    echo "<tr>
              <td>Phone #:</td>
              <td class=\"left\">
                  <input type=\"readonly\" name=\"usr_phone\"
                         value=\"$usr_phone\"></td>
          </tr>\n";

    echo "<tr>
              <td>Expiration date:</td>
              <td class=\"left\">
                  <input type=\"readonly\" name=\"usr_expires\"
                         value=\"$usr_expires\"</td>
          </tr>\n";
}
else {
    echo "<tr>
              <td>*Username:</td>
              <td class=\"left\">
129 130
                  <input type=\"text\" name=\"uid\"
                         size=$TBDB_UIDLEN maxlength=$TBDB_UIDLEN></td>
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
          </tr>\n";

    echo "<tr>
              <td>*Full Name:</td>
              <td class=\"left\">
                  <input type=\"text\" name=\"usr_name\" size=30></td>
          </tr>\n";

    echo "<tr>
              <td>*Title/Position:</td>
              <td class=\"left\">
                  <input type=\"text\" name=\"usr_title\" size=30></td>
          </tr>\n";

    echo "<tr>
              <td>*Institutional<br>Affiliation:</td>
              <td class=\"left\">
                  <input type=\"text\" name=\"usr_affil\" size=40></td>
          </tr>\n";

    echo "<tr>
              <td>*Email Address:</td>
              <td class=\"left\">
                  <input type=\"text\" name=\"usr_email\" size=30></td>
          </tr>\n";

Leigh B. Stoller's avatar
Leigh B. Stoller committed
157 158 159 160 161 162
    echo "<tr>
              <td>Home Page URL:</td>
              <td class=\"left\">
                  <input type=\"text\" name=\"usr_url\" size=45></td>
          </tr>\n";

163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
    echo "<tr>
              <td>Mailing Address:</td>
              <td class=\"left\">
                  <input type\"text\" name=\"usr_addr\" size=40></td>
          </tr>\n";

    echo "<tr>
              <td>Phone #:</td>
              <td class=\"left\">
                  <input type=\"text\" name=\"usr_phone\" size=16></td>
          </tr>\n";

    $expiretime = date("m/d/Y", time() + (86400 * 90)); #add 90 days
    echo "<tr>
              <td>Expiration date:</td>
              <td class=\"left\">
                  <input type=\"text\" name=\"usr_expires\" size=10
                         value=\"$expiretime\"></td>
          </tr>\n";

    echo "<tr>
              <td>*Password:</td>
              <td><input type=\"password\" name=\"password1\" size=12></td>
          </tr>
          
          <tr>
              <td>*Retype Password:</td>
              <td><input type=\"password\" name=\"password2\" size=12></td>
          </tr>\n";
192
}
193 194 195 196

#
# The only common field!
#
197
# Note PID max length.
198 199 200 201
# 
echo "<tr>
          <td>*Project:</td>
          <td class=\"left\">
202 203
              <input type=\"text\" name=\"pid\"
                     size=$TBDB_PIDLEN maxlength=$TBDB_PIDLEN></td>
204 205
      </tr>\n";

206
?>
207
<td colspan="2" align="center">
208
<b><input type="submit" value="Submit"></b></td></tr>
209 210 211
</form>
</table>

212 213 214 215 216 217
<?php
#
# Standard Testbed Footer
# 
PAGEFOOTER();
?>