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

4
PAGEHEADER("Start a New Testbed Project");
5

6
7
8
9
#
# Get current user.
# 
$uid = GETLOGIN();
10

11
12
13
14
15
#
# 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.
#
16
if ($uid) {
17
18
19
    if (CHECKLOGIN($uid) != 1) {
        USERERROR("You are not logged in. Please log in and try again.", 1);
    }
20
21
22
23
24
25
26
27
    $query_result = mysql_db_query($TBDBNAME,
		"SELECT * FROM users WHERE uid=\"$uid\"");
    if (! $query_result) {
        $err = mysql_error();
	TBERROR("Database Error getting info for $uid: $err\n", 1);
    }
    $row = mysql_fetch_array($query_result);
}
28
29
30
31
32
33
else {
    #
    # No uid, so must be new.
    #
    $row = 0;
}
34

35
$expiretime = date("Y:m:d", time() + (86400 * 120));
36

37
38
?>
<table align="center" border="1"> 
39
<tr>
40
41
42
43
44
45
46
    <td colspan="2" align="center">
        <h1>Apply to Use the Utah Network Testbed</h1>
        <font size="+1">
               If you are a student
               <font color="red">(undergrad or graduate)</font>, please
               <a href="auth.html">read this first</a>!
        </font>
47
48
    </td>
</tr>
49
50
<tr></tr>
<tr></tr>
51
52

<tr>
53
    <td align="center" colspan="2">
54
        Fields marked with * are required;
55
        those marked + are highly recommended.</td>
56
57
</tr>

58
<form action=newproject.php3 method="post">
59
<?php
60

61
62
63
64
65
66
67
68
69
70
71
72
73
#
# User information.
#
echo "<tr>
          <td colspan=2>
              Project Head Information
          </td>
      </tr>\n";

#
# UserName:
#
echo "<tr>
74
          <td>*Username (no blanks, lowercase):</td>
75
          <td class=\"left\">
76
              <input name=\"proj_head_uid\"";
77
78
79
80
if ($row) {
    echo     "type=\"readonly\" value=\"$row[uid]\">";
}
else {
81
    echo     "type=\"text\" size=$TBDB_UIDLEN maxlength=$TBDB_UIDLEN>";
82
83
84
85
}
echo "     </td>
      </tr>\n";

86
#
87
# Full Name
88
#
89
90
91
92
93
94
echo "<tr>
          <td>*Full Name:</td>
          <td class=\"left\">
              <input name=\"usr_name\"";
if ($row) {
    echo "           type=\"readonly\" value=\"$row[usr_name]\">";
95
} else {
96
    echo "           type=\"text\" size=\"30\">";
97
}
98
99
100
echo "     </td>
      </tr>\n";

101
#
102
103
# Title/Position:
# 
104
echo "<tr>
105
         <td>*Title/Position:</td>
106
         <td class=\"left\">
107
             <input name=\"usr_title\"";
108
if ($row) {
109
    echo "          type=\"readonly\" value=\"$row[usr_title]\">";
110
} else {
111
    echo "          type=\"text\" size=\"30\">";
112
}
113

114
115
116
echo "     </td>
      </tr>\n";

117
#
118
# Affiliation:
119
#
120
echo "<tr>
121
122
123
         <td>*Institutional<br>Affiliation:</td>
         <td class=\"left\">
             <input name=\"usr_affil\"";
124
if ($row) {
125
    echo "          type=\"readonly\" value=\"$row[usr_affil]\">";
126
} else {
127
    echo "          type=\"text\" size=\"40\">";
128
}
129

130
131
132
echo "     </td>
      </tr>\n";

Leigh B. Stoller's avatar
Leigh B. Stoller committed
133
134
135
136
137
138
139
140
141
142
#
# User URL
#
echo "<tr>
         <td>Home Page URL:</td>
         <td class=\"left\">
             <input name=\"usr_url\"";
if ($row) {
    echo "          type=\"readonly\" value=\"$row[usr_URL]\">";
} else {
143
    echo "          value=\"http://\" type=\"text\" size=\"45\">";
Leigh B. Stoller's avatar
Leigh B. Stoller committed
144
145
146
147
}

echo "     </td>
      </tr>\n";
148

149
#
150
# Email:
151
#
152
echo "<tr>
153
         <td>*Email<br>Address:</td>
154
         <td class=\"left\">
155
             <input name=\"usr_email\"";
156
if ($row) {
157
    echo "          type=\"readonly\" value=\"$row[usr_email]\">";
158
} else {
159
    echo "          type=\"text\" size=\"30\">";
160
}
161

162
163
164
echo "    </td>
      </tr>\n";

165
#
166
# Postal Address
167
#
168
echo "<tr>
169
170
171
172
173
174
         <td>*Postal<br>Address:</td>
         <td class=\"left\">
              <input name=\"usr_addr\"";
if ($row) {
    echo "           type=\"readonly\" value=\"$row[usr_addr]\">";
} else {
175
    echo "           type=\"text\" size=\"40\">";
176
177
178
179
}
echo "    </td>
      </tr>\n";

180
#
181
# Phone
182
#
183
184
185
186
187
188
echo "    <td>*Phone #:</td>
          <td class=\"left\">
              <input name=\"usr_phones\"";
if ($row) {
    echo "           type=\"readonly\" value=\"$row[usr_phone]\">";
} else {
189
    echo "           type=\"text\" size=\"15\">";
190
191
192
193
}
echo "    </td>
      </tr>\n";

194
#
195
196
# If a new usr, then provide a second password confirmation field.
# Otherwise, a blank spot.
197
#
198
if (! $row) {
199
200
echo "<tr>
         <td>*Password:</td>
201
         <td><input type=\"password\" name=\"password1\" size=\"8\"></td>
202
203
204
      </tr>\n";

echo "<tr>
205
          <td>*Retype Password:</td>
206
          <td class=\"left\">
207
              <input type=\"password\" name=\"password2\" size=\"8\"></td>
208
209
210
      </tr>\n";
}

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
#
# Project information
#
echo "<tr><td colspan='2'><hr></td></tr>\n";

echo "<tr>
         <td colspan='2'>
             Project Information <em>(replace the example entries)</em>
         </td>
      </tr>\n";

#
#  Project Name:
#
echo "<tr>
          <td>*Name (no blanks):</td>
227
          <td><input type=\"text\" name=\"pid\"
228
                     size=$TBDB_PIDLEN maxlength=$TBDB_PIDLEN></td>
229
230
231
232
233
234
235
      </tr>\n";

#
#  Long Name
#
echo "<tr>
          <td>*Long name:</td>
236
          <td><input type=\"text\" name=\"proj_name\"
237
                     size=\"40\"></td>
238
239
240
241
242
243
      </tr>\n";

#
#  URL
#
echo "<tr>
244
         <td>*URL:</td>
245
246
         <td><input type=\"text\" name=\"proj_URL\"
                    value=\"http://\" size=\"45\"></td>
247
248
      </tr>\n";

249
250
251
252
253
254
255
256
257
258
259
260
261
#
# Publiclly visible.
# 
echo "<tr>
         <td>*Can we list your URL publicly as an \"Emulab User?\":
             <br>
             (See our <a href=\"projectlist.php3\" target=\"Users\">Users</a> page)
             </td>
         <td><input type=radio name=proj_public value=yes checked>Yes &nbsp
             <input type=radio name=proj_public value=no>No
             </td>
      </tr>\n";

262
263
264
265
266
267
268
269
270
#
#  Funders/Grant numbers
#
echo "<tr>
         <td>*Funding Sources and Grant Numbers:<br>
              (Type \"none\" if not funded)</td>
         <td><input type=\"text\" name=\"proj_funders\" size=\"45\"></td>
      </tr>\n";

271
#
272
# Nodes and PCs and Users
273
# 
274
275
276
277
278
echo "<tr>
         <td>*Estimated #of Project Members:</td>
         <td><input type=\"text\" name=\"proj_members\" size=\"4\"></td>
      </tr>\n";

279
280
echo "<tr>
         <td>*Estimated #of PCs:</td>
281
         <td><input type=\"text\" name=\"proj_pcs\" size=\"4\"></td>
282
283
284
285
      </tr>\n";

echo "<tr>
         <td>*Estimated #of Sharks:</td>
286
         <td><input type=\"text\" name=\"proj_sharks\" size=\"4\"
287
                    value=\"0\"></td>
288
289
290
291
292
293
      </tr>\n";

#
#  Expires
#
echo "<tr>
294
295
296
          <td>When do you expect to be done<br>
              using the testbed (YYYY:MM:DD):</td>
          <td><input type=\"text\" name=\"proj_expires\" size=\"10\"
297
298
299
300
                     value=\"$expiretime\"></td>
      </tr>\n";


301
?>
302

303
<tr>
304
    <td colspan="2">
305
        *Please describe how and why you'd like to use the testbed.</td>
306
</tr>
307

308
<tr>
309
    <td colspan="2" align="center" class="left">
310
        <textarea name="proj_why" rows="10" cols="60"></textarea></td>
311
312
313
</tr>

<tr>
314
    <td colspan="2" align="center">
315
316
        <b><input type="submit" value="Submit"></b></td>
</tr>
317
</form>
318
</table>
319

320
321
322
323
324
325
<?php
#
# Standard Testbed Footer
# 
PAGEFOOTER();
?>