Menu

[r52]: / html / edituser.php  Maximize  Restore  History

Download this file

123 lines (122 with data), 3.5 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
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
session_start();
$user_ID=$_SESSION[user_ID];
if (!$user_ID || $user_ID=='0')
{
header('location: index.php');
die('Login failed');
}
require("util.php");
$sql = new MySQL_class;
$sql->Create("generator");
$esql = new MySQL_class;
$esql->Create("generator");
if ($_GET[user]) { $_SESSION[var_user] = $_GET[user]; }
$user=$_SESSION[var_user];
?>
<?php
$sql->QueryItem("SELECT user.username as F497, user.password as F498, user.special as F499, user.type as F500 FROM `user` WHERE user.user='$user'");
$username = htmlspecialchars($sql->data['F497']);
$password = htmlspecialchars($sql->data['F498']);
$special = htmlspecialchars($sql->data['F499']);
$type = htmlspecialchars($sql->data['F500']);
if ($_POST['user']!='') {
$username = htmlspecialchars($_POST['username']);
$password = htmlspecialchars($_POST['password']);
$special = htmlspecialchars($_POST['special']);
$type = htmlspecialchars($_POST['type']);
}
?>
<html>
<head>
<link href="list.css" type="text/css" rel=stylesheet>
<meta content="text/css" http-equiv="Content-Style-Type">
<title>Edit User</title>
<script>
function confirmDelete(delUrl) {
if (confirm("Remove User?")) {
document.location = delUrl;
}
}
</script>
</head>
<body class="top" onload="document.Edit.<?php
if ($_POST[FOCUS]==499) {echo 'type';}
else {echo 'username';}
?>.focus();">
<form name="Edit" action="postedituser.php" method="post">
<input type=hidden name="FOCUS" value="">
<?php echo("<input type=hidden name=\"user\" size=5 value=\"$user\">\n");?>
<table class=enter>
<tr id=title><th colspan=2>Edit User</th></tr>
<tr><th>Username</th>
<td>
<?php echo("<input type=text name=\"username\" size=40 value=\"$username\">");?>
</td></tr>
<tr><th>Password</th>
<td>
<?php echo("<input type=text name=\"password\" size=40 value=\"$password\">");?>
</td></tr>
<tr><th>Special</th>
<td>
<?php
echo ("<select name=\"special\" OnChange=\"Edit.action=''; Edit.FOCUS.value='499'; Edit.submit();\">");
if ($special=='none') {
echo "<option value=\"none\" selected>none</option>\n";
} else {
echo "<option value=\"none\">none</option>\n";
}
if ($special=='admin') {
echo "<option value=\"admin\" selected>admin</option>\n";
} else {
echo "<option value=\"admin\">admin</option>\n";
}
if ($special=='sysadmin') {
echo "<option value=\"sysadmin\" selected>sysadmin</option>\n";
} else {
echo "<option value=\"sysadmin\">sysadmin</option>\n";
}
echo "</select>";
?>
</td></tr>
<tr><th>Type</th>
<td>
<?php
echo ("<select name=\"type\" OnChange=\"Edit.action=''; Edit.FOCUS.value='500'; Edit.submit();\">");
if ($type=='user') {
echo "<option value=\"user\" selected>user</option>\n";
} else {
echo "<option value=\"user\">user</option>\n";
}
if ($type=='group') {
echo "<option value=\"group\" selected>group</option>\n";
} else {
echo "<option value=\"group\">group</option>\n";
}
if ($type=='both') {
echo "<option value=\"both\" selected>both</option>\n";
} else {
echo "<option value=\"both\">both</option>\n";
}
if ($type=='cancelled') {
echo "<option value=\"cancelled\" selected>cancelled</option>\n";
} else {
echo "<option value=\"cancelled\">cancelled</option>\n";
}
echo "</select>";
?>
</td></tr>
</table>
<p id=buttons>
<input type=submit value=Change>
<?php
$test=true;
if ($test) {
echo "<input type=button value=Delete onClick=\"confirmDelete('postdeleteuser.php?user=$user&user=$user')\">\n";
}
?>
<input type=button value="Cancel" onClick="window.close()">
</p>
</form>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.