예제 #1
0
$err_msg = '';
if (isset($_POST['clear']) == true) {
    $err_msg = '';
    unset($_POST);
}
$username = '';
// keep or reset the form fields
if (isset($_POST['username'])) {
    $username = $_POST['username'];
}
$display = true;
if (isset($_POST['submit'])) {
    unset($_POST['submit']);
    if (validateChgPW($err_msg)) {
        $conn = new dbAccess($debug);
        if ($conn->dbChangePW()) {
            $err_msg = "** Your password has been changed **";
            /* echo "<div class='bgWhite'><h3>Change Password</h3>" +
                    "<p class='userMsg'>Your password has been successfully changed.<br>" +
                    "Please return to the <a href='login.php'>LOGIN</a> screen to sign in with your email address and new password</p></div>";
               $display = false; */
        } else {
            $err_msg = $conn->errmsg;
        }
    }
    $display = true;
}
// end if 'try'
if ($display) {
    ?>
<body id="mainBody" class="shadowBody">
예제 #2
0
if (isset($_POST['repeatpw'])) {
    $repeatpw = $_POST['repeatpw'];
} else {
    $repeatpw = '';
}
if (isset($_POST['oldpw'])) {
    $oldpw = $_POST['oldpw'];
} else {
    $oldpw = '';
}
$display = true;
if (isset($_GET['try'])) {
    unset($_GET['try']);
    if (validateChgPW($err_msg)) {
        $conn = new dbAccess($debug);
        if ($conn->dbChangePW($username, $oldpw, $newpw)) {
            echo "<h4>Password for " . $username . " successfully changed.<br><br>";
            echo "You may now <a href='login.php'>LOGIN</a></h4>";
            $display = false;
        } else {
            $err_msg = $conn->errmsg;
        }
    }
}
// end if 'try'
if ($display) {
    ?>
        <body topmargin="20">
            <form action="changePW.php?try=true" method="post">
                <table align="center" border='2' width="650" frame="box" rules="none"
                       cellpadding='3' cellspacing="0" bgcolor="white">