예제 #1
0
$page_body = "";
$et = new EventTiming($debug_time_mode);
$cs = new CriteriaState("base_user.php");
$cs->ReadState();
$userprefs = new BaseUserPrefs();
$userobj = new BaseUser();
$username = $userobj->returnUser();
$page_title = gettext("BASE User preferences");
PrintBASESubHeader($page_title, $page_title, $cs->GetBackLink(), 1);
if (isset($_GET['action'])) {
    //This is where the processing of this page happens.
    switch ($_GET['action']) {
        case "change":
            //call auth.inc
            if ($_POST['newpasswd1'] == $_POST['newpasswd2'] && $_POST['newpasswd1'] != "") {
                $pwdresponse = $userobj->changePassword($username, filterSql($_POST['oldpasswd']), filterSql($_POST['newpasswd1']));
                $page_body = $pwdresponse;
                break;
            } else {
                $page_body = gettext("Your password can not be blank or the two passwords did not match!");
            }
        case "changepassword":
            $form = "<form action='base_user.php?action=change' Method='POST'>";
            $form = $form . "<table border=1 class='query'>";
            $form = $form . "<tr><td width='25%' align='right'>" . gettext("Old Password:"******"</td>";
            $form = $form . "<td align='left'><input type='password' name='oldpasswd'></td></tr>";
            $form = $form . "<tr><td width='25%' align='right'>" . gettext("New Password:"******"</td>";
            $form = $form . "<td align='left'><input type='password' name='newpasswd1'></td></tr>";
            $form = $form . "<tr><td width='25%' align='right'>" . gettext("New Password Again:") . "</td>";
            $form = $form . "<td align='left'><input type='password' name='newpasswd2'></td></tr>";
            $form = $form . "<tr><td colspan='2' align='center'><input type='submit' name='submit'></td>";