edit_user.php
author rejo
Sun, 22 Apr 2007 07:20:09 +0000
changeset 8 47dd15d8bb8c
parent 3 64525a2eb098
child 13 2ff220cfde13
permissions -rw-r--r--
[feladat @ 20] - Merged branches/1.3.0 changes r12:19 into the trunk.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     1
<?php
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     2
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     3
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     4
// | PowerAdmin								|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     5
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     6
// | Copyright (c) 1997-2002 The PowerAdmin Team			|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     7
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     8
// | This source file is subject to the license carried by the overal	|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     9
// | program PowerAdmin as found on http://poweradmin.sf.net		|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    10
// | The PowerAdmin program falls under the QPL License:		|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    11
// | http://www.trolltech.com/developer/licensing/qpl.html		|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    12
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    13
// | Authors: Roeland Nieuwenhuis <trancer <AT> trancer <DOT> nl>	|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    14
// |          Sjeemz <sjeemz <AT> sjeemz <DOT> nl>			|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    15
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    16
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    17
//
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    18
// $Id: edit_user.php,v 1.6 2002/12/10 01:29:47 azurazu Exp $
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    19
//
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    20
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    21
require_once("inc/toolkit.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    22
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    23
if($_POST["commit"])
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    24
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    25
	if($_POST["username"] && $_POST["level"] && $_POST["fullname"])
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    26
	{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    27
		if(!isset($_POST["active"]))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    28
		{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    29
			$active = 0;
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    30
		}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    31
		else
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    32
		{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    33
			$active = 1;
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    34
		}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    35
		if(edit_user($_POST["number"], $_POST["username"], $_POST["fullname"], $_POST["email"], $_POST["level"], $_POST["description"], $active, $_POST["password"]))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    36
		{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    37
			clean_page($BASE_URL . $BASE_PATH . "users.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    38
		}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    39
		else
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    40
		{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    41
			error("Error editting user!");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    42
		}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    43
	}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    44
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    45
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    46
include_once("inc/header.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    47
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    48
if (!level(10))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    49
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    50
	error("You need user level 10 to view this page... How did you get here, anyway?");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    51
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    52
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    53
?>
2
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    54
<H2><? echo _('Edit user'); ?> "<?= get_fullname_from_userid($_GET["id"]) ?>"</H2>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    55
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    56
if (level(10))
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    57
{
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    58
?>
3
64525a2eb098 [feladat @ 4]
rejo
parents: 2
diff changeset
    59
<FONT CLASS="nav"><BR><A HREF="users.php"><? echo _('User admin'); ?></A> &gt;&gt; <? echo _('Edit user'); ?></FONT><BR><BR>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    60
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    61
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    62
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    63
$r = array();
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    64
$r = get_user_info($_GET["id"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    65
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    66
?>
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    67
<FORM  METHOD="post">
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    68
<TABLE BORDER="0" CELLSPACING="4">
2
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    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>
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    70
<TR><TD CLASS="tdbg"><? echo _('Full name'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="fullname" VALUE="<?=$r["fullname"]?>"></TD></TR>
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    71
<TR><TD CLASS="tdbg"><? echo _('Password'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="password" VALUE=""></TD></TR>
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    72
<TR><TD CLASS="tdbg"><? echo _('E-mail'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="email" VALUE="<?=$r["email"]?>"></TD></TR>
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    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>
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    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>
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    75
<TR><TD CLASS="tdbg"><? echo _('Active'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="checkbox" NAME="active" VALUE="1" <? if($r["active"]) { ?>CHECKED<? } ?>></TD></TR>
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    76
<TR><TD CLASS="tdbg">&nbsp;</TD><TD CLASS="tdbg"><INPUT TYPE="submit" CLASS="button" NAME="commit" VALUE="<? echo _('Commit changes'); ?>"></TD></TR>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    77
<INPUT TYPE="HIDDEN" NAME="number" VALUE="<?= $_GET["id"] ?>">
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    78
</TABLE>
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    79
</FORM>
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    80
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    81
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    82
include_once("inc/footer.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    83
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    84
?>