diff -r c72d6d51f3d3 -r c255196bc447 edit_user.php --- a/edit_user.php Wed Mar 12 20:45:56 2008 +0000 +++ b/edit_user.php Tue Mar 25 22:45:31 2008 +0000 @@ -20,88 +20,141 @@ */ require_once("inc/toolkit.inc.php"); - -if($_POST["commit"]) -{ - if($_POST["username"] && $_POST["level"] && $_POST["fullname"]) - { - if(!isset($_POST["active"])) - { - $active = 0; - } - else - { - $active = 1; - } - if(edit_user($_POST["number"], $_POST["username"], $_POST["fullname"], $_POST["email"], $_POST["level"], $_POST["description"], $active, $_POST["password"])) - { - clean_page("users.php"); - } - else - { - error("Error editting user!"); - } - } -} - include_once("inc/header.inc.php"); -if (!level(10)) -{ - error("You do not have the required access level."); +$edit_id = "-1"; +if (isset($_GET['id']) && v_num($_GET['id'])) { + $edit_id = $_GET['id']; } -?> -

""

- -
- "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:">
:">
:
:">
: - -
: - -
:CHECKED>
 
-
- "0" && $i_fullname) { + if(!isset($i_active)) { + $active = 0; + } else { + $active = 1; + } + if(edit_user($edit_id, $i_username, $i_fullname, $i_email, $i_perm_templ, $i_description, $active, $i_password)) { + success(SUC_USER_UPD); + } + } + } + } + + $users = get_user_detail_list($edit_id) ; + + foreach ($users as $user) { + + (($user['active']) == "1") ? $check = " CHECKED" : $check = "" ; + + echo "

" . _('Edit user') . " \"" . $user['fullname'] . "\"

\n"; + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
" . _('Username') . "
" . _('Fullname') . "
" . _('Password') . "
" . _('Email') . "
" . _('Permission template') . "\n"; + echo " \n"; + echo "
" . _('Description') . "
" . _('Enabled') . "
 
\n"; + echo "
\n"; + + echo "

\n"; + printf(" This user has been assigned the \"%s\" permission template.", $user['tpl_name']); + if ($user['tpl_descr'] != "") { + echo " The description for this template is: \"" . $user['tpl_descr'] . "\"."; + } + echo " Based on this template, this user has the following permissions:"; + echo "

\n"; + echo " \n"; + } +} else { + error(ERR_PERM_EDIT_USER); +} include_once("inc/footer.inc.php");