<!DOCTYPE html> <html> <head> <title>Change Password</title> </head> <body> <?php if (isset($_POST['change_password'])) { if (isset($_POST['current_password']) && $_POST['current_password'] != "" && isset($_POST['new_password']) && $_POST['new_password'] != "" && isset($_POST['retype_password']) && $_POST['retype_password'] != "" && isset($_POST['current_password']) && $_POST['current_password'] != "") { $curpass = $_POST['current_password']; $new_password = $_POST['new_password']; $retype_password = $_POST['retype_password']; if ($new_password != $retype_password) { echo "<p><h2>Passwords Doesn't match</h2><p>The passwords you entered didn't match. Try again.</p></p>"; } else { if (\Fr\LS::login(\Fr\LS::getUser("username"), "", false, false) == false) { echo "<h2>Current Password Wrong!</h2><p>The password you entered for your account is wrong.</p>"; } else { $change_password = \Fr\LS::changePassword($new_password); if ($change_password === true) { echo "<h2>Password Changed Successfully</h2>"; } } } } else { echo "<p><h2>Password Fields was blank</h2><p>Form fields were left blank</p></p>"; } } ?> <form action="<?php echo \Fr\LS::curPageURL();
<!DOCTYPE html> <html> <head> <title>Change Password</title> </head> <body> <?php if (isset($_POST['change_password'])) { if (isset($_POST['current_password']) && $_POST['current_password'] != "" && isset($_POST['new_password']) && $_POST['new_password'] != "" && isset($_POST['retype_password']) && $_POST['retype_password'] != "" && isset($_POST['current_password']) && $_POST['current_password'] != "") { $curpass = $_POST['current_password']; $new_password = $_POST['new_password']; $retype_password = $_POST['retype_password']; if ($new_password != $retype_password) { echo "<p><h2>Passwords Doesn't match</h2><p>The passwords you entered didn't match. Try again.</p></p>"; } else { if (\Fr\LS::login(\Fr\LS::getUser("username"), $_POST['current_password'], false, false) == false) { echo "<h2>Current Password Wrong!</h2><p>The password you entered for your account is wrong.</p>"; } else { $change_password = \Fr\LS::changePassword($new_password); if ($change_password === true) { echo "<h2>Password Changed Successfully</h2>"; } } } } else { echo "<p><h2>Password Fields was blank</h2><p>Form fields were left blank</p></p>"; } } ?> <form action="<?php echo \Fr\LS::curPageURL();
<h1>Welcome</h1> <p>You have been successfully logged in.</p> <p> <a href="logout.php">Log Out</a> </p> <p> You registered on this website <strong><?php echo \Fr\LS::joinedSince(); ?> </strong> ago. </p> <p> Here is the full data, the database stores on this user : </p> <pre><?php $details = \Fr\LS::getUser(); print_r($details); ?> </pre> <p> Change the name of your account : </p> <form action="home.php" method="POST"> <input name="newName" placeholder="New name" /> <button>Change Name</button> </form> <p> <a href="change.php">Change Password</a> </p> </body> </html>
<?php require __DIR__ . "/../class.logsys.php"; $config = array("basic" => array("company" => "My Site", "email" => "*****@*****.**"), "db" => array("host" => "localhost", "port" => 3306, "username" => "root", "password" => "backstreetboys", "name" => "test", "table" => "users"), "features" => array("auto_init" => true, "two_step_login" => true), "pages" => array("no_login" => array("/Francium/logSys/example-two-step-login/", "/Francium/logSys/example-two-step-login/reset.php", "/Francium/logSys/example-two-step-login/register.php"), "login_page" => "/Francium/logSys/example-two-step-login/login.php", "home_page" => "/Francium/logSys/example-two-step-login/home.php"), "two_step_login" => array("instruction" => "A token was sent to your E-Mail Address. Please see the mail in your inbox and paste the token found in the textbox below :", "send_callback" => function ($userID, $token) { $email = \Fr\LS::getUser("email", $userID); \Fr\LS::sendMail($email, "Verify Yourself", "Someone tried to login to your account. If it was you, then use the following token to complete logging in : <blockquote>" . $token . "</blockquote>If it was not you, then ignore this email and please consider to change your account's password."); })); \Fr\LS::config($config);