Example #1
0
        header("Location:user_list.php");
        exit;
    } else {
        $objSystemUser = new SystemUser($_REQUEST["id"]);
        $objSystemUser->FirstName = $_REQUEST['first_name'];
        $objSystemUser->LastName = $_REQUEST['last_name'];
        $objSystemUser->EmailAddress = $_REQUEST['email_address'];
        if (isset($_REQUEST['password'])) {
            $objSystemUser->Password = $_REQUEST['password'];
        }
        $is_admin = 0;
        if (isset($_REQUEST['is_admin'])) {
            $is_admin = 1;
        }
        $objSystemUser->IsAdmin = $is_admin;
        $objSystemUser->update();
        // redirect to listing list
        header("Location:user_list.php");
        exit;
    }
} else {
    if ($_REQUEST['mode'] == 'e') {
        //listing
        $objSystemUser = new SystemUser($id);
        $first_name = $objSystemUser->FirstName;
        $last_name = $objSystemUser->LastName;
        $email_address = $objSystemUser->EmailAddress;
        $password = $objSystemUser->Password;
        $is_admin = $objSystemUser->IsAdmin;
    }
}