edit_user.php
changeset 13 2ff220cfde13
parent 3 64525a2eb098
child 43 2d7b36d12274
equal deleted inserted replaced
12:7be4525290cc 13:2ff220cfde13
     1 <?php
     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 
     2 
    21 require_once("inc/toolkit.inc.php");
     3 require_once("inc/toolkit.inc.php");
    22 
     4 
    23 if($_POST["commit"])
     5 if($_POST["commit"])
    24 {
     6 {
    45 
    27 
    46 include_once("inc/header.inc.php");
    28 include_once("inc/header.inc.php");
    47 
    29 
    48 if (!level(10))
    30 if (!level(10))
    49 {
    31 {
    50 	error("You need user level 10 to view this page... How did you get here, anyway?");
    32 	error("You do not have the required access level.");
    51 }
    33 }
    52 
       
    53 ?>
    34 ?>
    54 <H2><? echo _('Edit user'); ?> "<?= get_fullname_from_userid($_GET["id"]) ?>"</H2>
    35     <h2><? echo _('Edit user'); ?> "<? echo get_fullname_from_userid($_GET["id"]) ?>"</h2>
    55 <?
    36 <?
    56 if (level(10))
       
    57 {
       
    58 ?>
       
    59 <FONT CLASS="nav"><BR><A HREF="users.php"><? echo _('User admin'); ?></A> &gt;&gt; <? echo _('Edit user'); ?></FONT><BR><BR>
       
    60 <?
       
    61 }
       
    62 
       
    63 $r = array();
    37 $r = array();
    64 $r = get_user_info($_GET["id"]);
    38 $r = get_user_info($_GET["id"]);
    65 
       
    66 ?>
    39 ?>
    67 <FORM  METHOD="post">
    40     <form method="post">
    68 <TABLE BORDER="0" CELLSPACING="4">
    41      <input type="HIDDEN" name="number" value="<? echo $_GET["id"] ?>">
    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>
    42      <table>
    70 <TR><TD CLASS="tdbg"><? echo _('Full name'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="fullname" VALUE="<?=$r["fullname"]?>"></TD></TR>
    43       <tr>
    71 <TR><TD CLASS="tdbg"><? echo _('Password'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="password" VALUE=""></TD></TR>
    44        <td class="n"><? echo _('User name'); ?>:</td>
    72 <TR><TD CLASS="tdbg"><? echo _('E-mail'); ?>:</TD><TD CLASS="tdbg"><INPUT TYPE="text" CLASS="input" NAME="email" VALUE="<?=$r["email"]?>"></TD></TR>
    45        <td class="n"><input type="text" class="input" name="username" value="<? echo $r["username"]?>"></td>
    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>
    46       </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>
    47       <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>
    48        <td class="n"><? echo _('Full name'); ?>:</td>
    76 <TR><TD CLASS="tdbg">&nbsp;</TD><TD CLASS="tdbg"><INPUT TYPE="submit" CLASS="button" NAME="commit" VALUE="<? echo _('Commit changes'); ?>"></TD></TR>
    49        <td class="n"><input type="text" class="input" name="fullname" value="<? echo $r["fullname"]?>"></td>
    77 <INPUT TYPE="HIDDEN" NAME="number" VALUE="<?= $_GET["id"] ?>">
    50       </tr>
    78 </TABLE>
    51       <tr>
    79 </FORM>
    52        <td class="n"><? echo _('Password'); ?>:</td>
       
    53        <td class="n"><input type="text" class="input" name="password" value=""></td>
       
    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">&nbsp;</td>
       
    81        <td class="n"><input type="submit" class="button" name="commit" value="<? echo _('Commit changes'); ?>"></td>
       
    82       </tr>
       
    83      </table>
       
    84     </form>
    80 <?
    85 <?
    81 
    86 
    82 include_once("inc/footer.inc.php");
    87 include_once("inc/footer.inc.php");
    83 
    88 
    84 ?>
    89 ?>