1
|
1 |
<?php |
|
2 |
|
47
|
3 |
/* PowerAdmin, a friendly web-based admin tool for PowerDNS. |
|
4 |
* See <https://rejo.zenger.nl/poweradmin> for more details. |
|
5 |
* |
|
6 |
* Copyright 2007, 2008 Rejo Zenger <rejo@zenger.nl> |
|
7 |
* |
|
8 |
* This program is free software: you can redistribute it and/or modify |
|
9 |
* it under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
11 |
* (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
*/ |
|
21 |
|
1
|
22 |
require_once("inc/toolkit.inc.php"); |
|
23 |
|
|
24 |
if($_POST["commit"]) |
|
25 |
{ |
|
26 |
if($_POST["username"] && $_POST["level"] && $_POST["fullname"]) |
|
27 |
{ |
|
28 |
if(!isset($_POST["active"])) |
|
29 |
{ |
|
30 |
$active = 0; |
|
31 |
} |
|
32 |
else |
|
33 |
{ |
|
34 |
$active = 1; |
|
35 |
} |
|
36 |
if(edit_user($_POST["number"], $_POST["username"], $_POST["fullname"], $_POST["email"], $_POST["level"], $_POST["description"], $active, $_POST["password"])) |
|
37 |
{ |
|
38 |
clean_page($BASE_URL . $BASE_PATH . "users.php"); |
|
39 |
} |
|
40 |
else |
|
41 |
{ |
|
42 |
error("Error editting user!"); |
|
43 |
} |
|
44 |
} |
|
45 |
} |
|
46 |
|
|
47 |
include_once("inc/header.inc.php"); |
|
48 |
|
|
49 |
if (!level(10)) |
|
50 |
{ |
13
|
51 |
error("You do not have the required access level."); |
1
|
52 |
} |
|
53 |
?> |
13
|
54 |
<h2><? echo _('Edit user'); ?> "<? echo get_fullname_from_userid($_GET["id"]) ?>"</h2> |
1
|
55 |
<? |
|
56 |
$r = array(); |
|
57 |
$r = get_user_info($_GET["id"]); |
|
58 |
?> |
13
|
59 |
<form method="post"> |
|
60 |
<input type="HIDDEN" name="number" value="<? echo $_GET["id"] ?>"> |
|
61 |
<table> |
|
62 |
<tr> |
|
63 |
<td class="n"><? echo _('User name'); ?>:</td> |
|
64 |
<td class="n"><input type="text" class="input" name="username" value="<? echo $r["username"]?>"></td> |
|
65 |
</tr> |
|
66 |
<tr> |
|
67 |
<td class="n"><? echo _('Full name'); ?>:</td> |
|
68 |
<td class="n"><input type="text" class="input" name="fullname" value="<? echo $r["fullname"]?>"></td> |
|
69 |
</tr> |
|
70 |
<tr> |
|
71 |
<td class="n"><? echo _('Password'); ?>:</td> |
43
|
72 |
<td class="n"><input type="password" class="input" name="password" value=""></td> |
13
|
73 |
</tr> |
|
74 |
<tr> |
|
75 |
<td class="n"><? echo _('E-mail'); ?>:</td> |
|
76 |
<td class="n"><input type="text" class="input" name="email" value="<? echo $r["email"]?>"></td> |
|
77 |
</tr> |
|
78 |
<tr> |
|
79 |
<td class="n"><? echo _('User level'); ?>:</td> |
|
80 |
<td class="n"> |
|
81 |
<select name="level"> |
|
82 |
<option value="1" <? if($r["level"] == 1) { echo "selectED"; } ?>>1 (<? echo _('Normal user'); ?>)</option> |
|
83 |
<option value="5" <? if($r["level"] == 5) { echo "selectED"; } ?>>5 (<? echo _('Administrator'); ?>)</option> |
|
84 |
<option value="10" <? if($r["level"] == 10) { echo "selectED"; } ?>>10 (<? echo _('Administrator w/ user admin rights'); ?>)</option> |
|
85 |
</select> |
|
86 |
</td> |
|
87 |
</tr> |
|
88 |
<tr> |
|
89 |
<td class="n"><? echo _('Description'); ?>:</td> |
|
90 |
<td class="n"> |
|
91 |
<textarea rows="6" cols="30" class="inputarea" name="description"><? echo $r["description"]?></textarea> |
|
92 |
</td> |
|
93 |
</tr> |
|
94 |
<tr> |
|
95 |
<td class="n"><? echo _('Active'); ?>:</td> |
|
96 |
<td class="n"><input type="checkbox" name="active" value="1" <? if($r["active"]) { ?>CHECKED<? } ?>></td> |
|
97 |
</tr> |
|
98 |
<tr> |
|
99 |
<td class="n"> </td> |
|
100 |
<td class="n"><input type="submit" class="button" name="commit" value="<? echo _('Commit changes'); ?>"></td> |
|
101 |
</tr> |
|
102 |
</table> |
|
103 |
</form> |
1
|
104 |
<? |
|
105 |
|
|
106 |
include_once("inc/footer.inc.php"); |
|
107 |
|
|
108 |
?> |