1
|
1 |
<?php |
|
2 |
|
|
3 |
require_once("inc/toolkit.inc.php"); |
|
4 |
|
|
5 |
if($_POST["commit"]) |
|
6 |
{ |
|
7 |
if($_POST["username"] && $_POST["level"] && $_POST["fullname"]) |
|
8 |
{ |
|
9 |
if(!isset($_POST["active"])) |
|
10 |
{ |
|
11 |
$active = 0; |
|
12 |
} |
|
13 |
else |
|
14 |
{ |
|
15 |
$active = 1; |
|
16 |
} |
|
17 |
if(edit_user($_POST["number"], $_POST["username"], $_POST["fullname"], $_POST["email"], $_POST["level"], $_POST["description"], $active, $_POST["password"])) |
|
18 |
{ |
|
19 |
clean_page($BASE_URL . $BASE_PATH . "users.php"); |
|
20 |
} |
|
21 |
else |
|
22 |
{ |
|
23 |
error("Error editting user!"); |
|
24 |
} |
|
25 |
} |
|
26 |
} |
|
27 |
|
|
28 |
include_once("inc/header.inc.php"); |
|
29 |
|
|
30 |
if (!level(10)) |
|
31 |
{ |
13
|
32 |
error("You do not have the required access level."); |
1
|
33 |
} |
|
34 |
?> |
13
|
35 |
<h2><? echo _('Edit user'); ?> "<? echo get_fullname_from_userid($_GET["id"]) ?>"</h2> |
1
|
36 |
<? |
|
37 |
$r = array(); |
|
38 |
$r = get_user_info($_GET["id"]); |
|
39 |
?> |
13
|
40 |
<form method="post"> |
|
41 |
<input type="HIDDEN" name="number" value="<? echo $_GET["id"] ?>"> |
|
42 |
<table> |
|
43 |
<tr> |
|
44 |
<td class="n"><? echo _('User name'); ?>:</td> |
|
45 |
<td class="n"><input type="text" class="input" name="username" value="<? echo $r["username"]?>"></td> |
|
46 |
</tr> |
|
47 |
<tr> |
|
48 |
<td class="n"><? echo _('Full name'); ?>:</td> |
|
49 |
<td class="n"><input type="text" class="input" name="fullname" value="<? echo $r["fullname"]?>"></td> |
|
50 |
</tr> |
|
51 |
<tr> |
|
52 |
<td class="n"><? echo _('Password'); ?>:</td> |
43
|
53 |
<td class="n"><input type="password" class="input" name="password" value=""></td> |
13
|
54 |
</tr> |
|
55 |
<tr> |
|
56 |
<td class="n"><? echo _('E-mail'); ?>:</td> |
|
57 |
<td class="n"><input type="text" class="input" name="email" value="<? echo $r["email"]?>"></td> |
|
58 |
</tr> |
|
59 |
<tr> |
|
60 |
<td class="n"><? echo _('User level'); ?>:</td> |
|
61 |
<td class="n"> |
|
62 |
<select name="level"> |
|
63 |
<option value="1" <? if($r["level"] == 1) { echo "selectED"; } ?>>1 (<? echo _('Normal user'); ?>)</option> |
|
64 |
<option value="5" <? if($r["level"] == 5) { echo "selectED"; } ?>>5 (<? echo _('Administrator'); ?>)</option> |
|
65 |
<option value="10" <? if($r["level"] == 10) { echo "selectED"; } ?>>10 (<? echo _('Administrator w/ user admin rights'); ?>)</option> |
|
66 |
</select> |
|
67 |
</td> |
|
68 |
</tr> |
|
69 |
<tr> |
|
70 |
<td class="n"><? echo _('Description'); ?>:</td> |
|
71 |
<td class="n"> |
|
72 |
<textarea rows="6" cols="30" class="inputarea" name="description"><? echo $r["description"]?></textarea> |
|
73 |
</td> |
|
74 |
</tr> |
|
75 |
<tr> |
|
76 |
<td class="n"><? echo _('Active'); ?>:</td> |
|
77 |
<td class="n"><input type="checkbox" name="active" value="1" <? if($r["active"]) { ?>CHECKED<? } ?>></td> |
|
78 |
</tr> |
|
79 |
<tr> |
|
80 |
<td class="n"> </td> |
|
81 |
<td class="n"><input type="submit" class="button" name="commit" value="<? echo _('Commit changes'); ?>"></td> |
|
82 |
</tr> |
|
83 |
</table> |
|
84 |
</form> |
1
|
85 |
<? |
|
86 |
|
|
87 |
include_once("inc/footer.inc.php"); |
|
88 |
|
|
89 |
?> |