-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_user.php
More file actions
executable file
·96 lines (71 loc) · 3.35 KB
/
edit_user.php
File metadata and controls
executable file
·96 lines (71 loc) · 3.35 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/********************************************************
*
* phpAbstracts
* http://www.phpabstracts.com
*
* For copyright and license information, see readme.txt
*
*********************************************************/
//Include header template
include('header.php');
//Only ADMINs can view this page
if ($admin) {
//Grab user_id passed in
$user_id = $_GET['x'];
//Database Connection Variables
include('db.php');
//Connect to database
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
//Select all users
$query = "SELECT * FROM users WHERE user_id = '$user_id'";
$result = mysql_query($query);
$user_id = mysql_result($result, 0, "user_id");
$login = mysql_result($result, 0, "login");
$password = mysql_result($result, 0, "password");
$name = mysql_result($result, 0, "name");
$email = mysql_result($result, 0, "email");
$role = mysql_result($result, 0, "role");
//Close database
mysql_close();
//Output breadcrumbs
echo "<div class='breadcrumbs'><a href='list.php'>" . $home_title . "</a> /<a href='list_users.php'>" . $user_mgmt_title . "</a> / " .
$edit_user_title . "</div>";
?>
<div class="leftcol">
<h1><?php echo $edit_user_title; ?></h1>
<p>You can edit users for the system here.</p>
<br />
<form method="post" action="edit_user_process.php" class="aform">
<input type="hidden" class="hidden" name="user_id" id="user_id" value="<?php echo $user_id; ?>" />
<input type="hidden" class="hidden" name="login" id="login" value="<?php echo $login; ?>" />
<label for "login2">Login</label>
<span id="login2"><?php echo $login; ?></span><br />
<label for "password">Password</label>
<input type="text" id="pw" name="pw" size="30" value="<?php echo $password; ?>" /><br />
<label for "name">Name</label>
<input type="text" id="name" name="name" size="30" value="<?php echo $name; ?>" /><br />
<label for "email">E-mail</label>
<input type="text" id="email" name="email" size="30" value="<?php echo $email; ?>" /><br />
<label for "role">Role</label>
<select id="role" name="role">
<option <?php if ($role == "USER") echo "selected"; ?>>USER</option>
<option <?php if ($role == "ADMIN") echo "selected"; ?>>ADMIN</option>
</select><br /><br />
<label for "submit"> </label><input type="submit" value="Edit User" name="submit" />
</form>
</div>
<div class="rightcol">
<h2>Editing Users</h2>
<p>An e-mail will automatically be generated and sent to the e-mail address specified, with the new login information.</p>
<p style="font-weight:bold;">Roles</p>
<p>Admins have the ability to assign abstracts for review, edit and delete abstracts, and set master status.</p>
<p>Users can only view and rate the abstracts assigned to them.</p>
</div>
<div class="breaker"> </div>
<?php
} //end if
//Include footer template
include('footer.php');
?>