~julian-lam/maccms/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php 

	session_start();
	
	# Variables
	$prefix = "..";				# Prefix for relative links
	$title = "Modify Existing User";	# Title of the page
	
	# Including includes
	include "$prefix/config/config.php";	# General configuration file for all pages
	include "$prefix/includes/db.inc";	# DB access
	include "$prefix/includes/other.inc";	# Other scripts (secure access, etc)
	include "$prefix/includes/header.inc";	# Including HTML headers, etc

	secure_page("admin");
	
	# Pull pertinent information
	$studentno = $_POST['studentno'];
	db_connect();
	$pullinfo = mysql_query("SELECT * FROM authz WHERE studentno='$studentno'");
	$row = mysql_fetch_row($pullinfo);
	db_close();

?>

					<hr />
				</td>
			</tr>
			<tr colspan="2">
				<td>
					<div class="registerform">
						<p>
							<strong>Please fill in the following information below.</strong>
							<br />Note that only Superusers can create
							Administrators or other Superusers.
						</p>
						<form action="users.php" method="post" name="registerform">
							<p><label for="studentno">Student Number:</label><input type="text" name="studentno" value="<?=$row[0]?>" /></p>
							<input type="hidden" name="oldstudentno" value="<?=$row[0]?>" />
							<p><label for="name">Full Name:</label><input type="text" name="name" value="<?=$row[3]?>" /></p>
							<p><label for="password">Account Password <sup>1</sup>:</label><input type="password" name="password" /></p>
							<p><label for="repeat">Repeat Password:</label><input type="password" name="repeat" /></p>
							<p><label for="address">Address:</label><input type="text" name="address" size="40" value="<?=$row[5]?>" /></p>
							<p><label for="cityprov">City and Province:</label><input type="text" name="cityprov" value="<?=$row[6]?>" /></p>
							<p><label for="phone">Phone:</label><input type="text" name="phone" value="<?=$row[7]?>" /></p>
							<p><label for="email">E-mail Address:</label><input type="text" name="email" value="<?=$row[8]?>" /></p>
							<p><label for="type">Type of Account:</label>
							<select name="type">
								<option value="student" <?php if ($row[4] == "student") echo 'selected' ?>>Student</option>
								<option value="admin" <?php if ($row[4] == "admin") echo 'selected' ?>>Administrator</option>
								<option value="superuser" <?php if ($row[4] == "superuser") echo 'selected' ?>>Superuser</option>
							</select>
							<div class="buttons" style="display: table; margin: auto;">
								<button type="submit" name="action" value="edit" class="positive">
									<img src="/images/reload.png" title="" />
									Modify User Information
								</button>
								<a href="/admin/users.php" class="negative">
									<img src="/images/cancel.png" title="" />
									Discard Changes
								</a>
							</div>
						</form>
					</div>
					<p style="font-size: 75%;">
						<sup>1</sup> This field is optional &ndash; if you wish to change the password, enter a new one there, now.
					</p>
				</td>
			</tr>
		</table>

<?php

	# Including includes
	include "$prefix/includes/footer.inc";

?>