Exemplo n.º 1
0
    }
    // modified in version 1.97
    function activation_switch($formelement = "activation")
    {
        $radio_group = "<label for=\"" . $formelement . "\">Active?</label>\n";
        $labels = array("y" => "yes", "n" => "no", "b" => "blocked");
        foreach ($labels as $key => $val) {
            $radio_group .= " <input name=\"" . $formelement . "\" type=\"radio\" value=\"" . $key . "\" ";
            $radio_group .= $this->activation == $key ? "checked=\"checked\" />\n" : "/>\n";
            $radio_group .= $val;
        }
        return $radio_group;
    }
}
$admin_update = new Admin_user();
$admin_update->access_page($_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING'], DEFAULT_ADMIN_LEVEL);
// check the level inside the config file
if (isset($_POST['Submit'])) {
    if ($_POST['Submit'] == "Update") {
        $conf_str = isset($_POST['send_confirmation']) ? $_POST['send_confirmation'] : "";
        // the checkbox value to send a confirmation mail
        $admin_update->update_user_by_admin($_POST['level'], $_POST['user_id'], $_POST['password'], $_POST['email'], $_POST['activation'], $conf_str);
        $admin_update->get_userdata($_POST['login_name']);
        // this is needed to get the modified data after update
    } elseif ($_POST['Submit'] == "Search") {
        $admin_update->get_userdata($_POST['login_name']);
    }
} elseif (isset($_GET['login_id']) && intval($_GET['login_id']) > 0) {
    $admin_update->get_userdata($_GET['login_id'], "is_id");
}
$error = $admin_update->the_msg;