Exemplo n.º 1
0
     if ($i_username == "-1" || $i_fullname == "-1" || $i_email < "1" || $i_description == "-1" || $i_password == "-1") {
         error(ERR_INV_INPUT);
     } else {
         if ($i_username != "" && $i_perm_templ > "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 "     <h2>" . _('Edit user') . " \"" . $user['fullname'] . "\"</h2>\n";
     echo "     <form method=\"post\">\n";
     echo "      <input type=\"hidden\" name=\"number\" value=\"" . $edit_id . "\">\n";
     echo "      <table>\n";
     echo "       <tr>\n";
     echo "        <td class=\"n\">" . _('Username') . "</td>\n";
     echo "        <td class=\"n\"><input type=\"text\" class=\"input\" name=\"username\" value=\"" . $user['username'] . "\"></td>\n";
     echo "       </tr>\n";
     echo "       <tr>\n";
     echo "        <td class=\"n\">" . _('Fullname') . "</td>\n";
     echo "        <td class=\"n\"><input type=\"text\" class=\"input\" name=\"fullname\" value=\"" . $user['fullname'] . "\"></td>\n";
     echo "       </tr>\n";
     echo "       <tr>\n";
verify_permission('user_edit_own') ? $perm_edit_own = "1" : ($perm_edit_own = "0");
verify_permission('user_edit_others') ? $perm_edit_others = "1" : ($perm_edit_others = "0");
verify_permission('templ_perm_edit') ? $perm_templ_perm_edit = "1" : ($perm_templ_perm_edit = "0");
verify_permission('user_is_ueberuser') ? $perm_is_godlike = "1" : ($perm_is_godlike = "0");
verify_permission('user_add_new') ? $perm_add_new = "1" : ($perm_add_new = "0");
#if (isset($_GET['action']) && $_GET['action'] === "switchuser" && $perm_is_godlike === "1"){
#        $_SESSION["userlogin"] = $_GET['username'];
#	echo '<meta http-equiv="refresh" content="1"/>';
#}
unset($commit_button);
if (isset($_POST['commit'])) {
    foreach ($_POST['user'] as $user) {
        update_user_details($user);
    }
}
$users = get_user_detail_list("");
echo "    <h2>" . _('User administration') . "</h2>\n";
echo "    <form method=\"post\" action=\"\">\n";
echo "     <table>\n";
echo "      <tr>\n";
echo "       <th>&nbsp;</th>\n";
echo "       <th>" . _('Username') . "</th>\n";
echo "       <th>" . _('Fullname') . "</th>\n";
echo "       <th>" . _('Description') . "</th>\n";
echo "       <th>" . _('Email address') . "</th>\n";
echo "       <th>" . _('Template') . "</th>\n";
echo "       <th>" . _('Enabled') . "</th>\n";
echo "      </tr>\n";
foreach ($users as $user) {
    if ($user['active'] == "1") {
        $active = " checked";