1
|
1 |
<?php |
|
2 |
|
|
3 |
// +--------------------------------------------------------------------+ |
|
4 |
// | PowerAdmin | |
|
5 |
// +--------------------------------------------------------------------+ |
|
6 |
// | Copyright (c) 1997-2002 The PowerAdmin Team | |
|
7 |
// +--------------------------------------------------------------------+ |
|
8 |
// | This source file is subject to the license carried by the overal | |
|
9 |
// | program PowerAdmin as found on http://poweradmin.sf.net | |
|
10 |
// | The PowerAdmin program falls under the QPL License: | |
|
11 |
// | http://www.trolltech.com/developer/licensing/qpl.html | |
|
12 |
// +--------------------------------------------------------------------+ |
|
13 |
// | Authors: Roeland Nieuwenhuis <trancer <AT> trancer <DOT> nl> | |
|
14 |
// | Sjeemz <sjeemz <AT> sjeemz <DOT> nl> | |
|
15 |
// +--------------------------------------------------------------------+ |
|
16 |
|
|
17 |
// |
|
18 |
// $Id: edit_user.php,v 1.6 2002/12/10 01:29:47 azurazu Exp $ |
|
19 |
// |
|
20 |
|
|
21 |
require_once("inc/toolkit.inc.php"); |
|
22 |
|
|
23 |
if($_POST["commit"]) |
|
24 |
{ |
|
25 |
if($_POST["username"] && $_POST["level"] && $_POST["fullname"]) |
|
26 |
{ |
|
27 |
if(!isset($_POST["active"])) |
|
28 |
{ |
|
29 |
$active = 0; |
|
30 |
} |
|
31 |
else |
|
32 |
{ |
|
33 |
$active = 1; |
|
34 |
} |
|
35 |
if(edit_user($_POST["number"], $_POST["username"], $_POST["fullname"], $_POST["email"], $_POST["level"], $_POST["description"], $active, $_POST["password"])) |
|
36 |
{ |
|
37 |
clean_page($BASE_URL . $BASE_PATH . "users.php"); |
|
38 |
} |
|
39 |
else |
|
40 |
{ |
|
41 |
error("Error editting user!"); |
|
42 |
} |
|
43 |
} |
|
44 |
} |
|
45 |
|
|
46 |
include_once("inc/header.inc.php"); |
|
47 |
|
|
48 |
if (!level(10)) |
|
49 |
{ |
|
50 |
error("You need user level 10 to view this page... How did you get here, anyway?"); |
|
51 |
} |
|
52 |
|
|
53 |
?> |
2
|
54 |
<H2><? echo _('Edit user'); ?> "<?= get_fullname_from_userid($_GET["id"]) ?>"</H2> |
1
|
55 |
<? |
|
56 |
if (level(10)) |
|
57 |
{ |
|
58 |
?> |
2
|
59 |
<FONT CLASS="nav"><BR><A HREF="users.php"><? echo _('User Admin'); ?></A> >> <? echo _('Edit User'); ?></FONT><BR><BR> |
1
|
60 |
<? |
|
61 |
} |
|
62 |
|
|
63 |
$r = array(); |
|
64 |
$r = get_user_info($_GET["id"]); |
|
65 |
|
|
66 |
?> |
|
67 |
<FORM METHOD="post"> |
|
68 |
<TABLE BORDER="0" CELLSPACING="4"> |
2
|
69 |
<TR><TD CLASS="tdbg"><? echo _('User name'); ?>:</TD><TD WIDTH="510" CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="username" VALUE="<?=$r["username"]?>"></TD></TR> |
|
70 |
<TR><TD CLASS="tdbg"><? echo _('Full name'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="fullname" VALUE="<?=$r["fullname"]?>"></TD></TR> |
|
71 |
<TR><TD CLASS="tdbg"><? echo _('Password'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="password" VALUE=""></TD></TR> |
|
72 |
<TR><TD CLASS="tdbg"><? echo _('E-mail'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="email" VALUE="<?=$r["email"]?>"></TD></TR> |
|
73 |
<TR><TD CLASS="tdbg"><? echo _('User level'); ?>:</TD><TD CLASS="tdbg"><SELECT NAME="level"><OPTION VALUE="1" <? if($r["level"] == 1) { echo "SELECTED"; } ?>>1 (<? echo _('Normal user'); ?>)</OPTION><OPTION VALUE="5" <? if($r["level"] == 5) { echo "SELECTED"; } ?>>5 (<? echo _('Administrator'); ?>)</OPTION><OPTION VALUE="10" <? if($r["level"] == 10) { echo "SELECTED"; } ?>>10 (<? echo _('Administrator w/ user admin rights'); ?>)</OPTION></SELECT></TD></TR> |
|
74 |
<TR><TD CLASS="tdbg"><? echo _('Description'); ?>:</TD><TD CLASS="tdbg"><TEXTAREA ROWS="6" COLS="30" CLASS="inputarea" NAME="description"><?=$r["description"]?></TEXTAREA></TD></TR> |
|
75 |
<TR><TD CLASS="tdbg"><? echo _('Active'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="checkbox" NAME="active" VALUE="1" <? if($r["active"]) { ?>CHECKED<? } ?>></TD></TR> |
|
76 |
<TR><TD CLASS="tdbg"> </TD><TD CLASS="tdbg"><INPUT TYPE="submit" CLASS="button" NAME="commit" VALUE="<? echo _('Commit changes'); ?>"></TD></TR> |
1
|
77 |
<INPUT TYPE="HIDDEN" NAME="number" VALUE="<?= $_GET["id"] ?>"> |
|
78 |
</TABLE> |
|
79 |
</FORM> |
|
80 |
<? |
|
81 |
|
|
82 |
include_once("inc/footer.inc.php"); |
|
83 |
|
|
84 |
?> |