<?php require '../utility/common.php'; require '../utility/htmlcommon.php'; logged_out(); top(false, 'Reset your password'); ?> <p>Type in your email, and we'll confirm you're you, then you can reset your password</p> <p>Please allow up to an hour for the email to arrive</p> <form action="forgotsubmit.php" method="post"> <fieldset> <legend>Reset password</legend> <label>Email: <input type="text" name="email" placeholder="*****@*****.**" /></label> <?php echo form_security_gen(); ?> <input type="submit" value="Submit" /> </fieldset> </form> <?php bottom();
$qry = "INSERT INTO `wb-user-meta` (user_id,meta_key,meta_value) VALUES ('" . $logged_in_user->ID() . "','last_accessed', CURRENT_TIMESTAMP)" . "ON DUPLICATE KEY UPDATE meta_value=CURRENT_TIMESTAMP;"; $session_db->query($qry); } // note: tuck all echo statments away so they cannot accidentally fire // when this file is included. Only available upon "Action" request if (isset($_POST['action']) && $_POST['action'] !== '') { // if attempting to login if ($_POST['action'] == 'login') { // if ( user_logged_in(true)==true ) // $_SESSION['session_id'] = $mySession->session_lock; $json['logged_in'] = user_logged_in(true); $json['login_html'] = get_login_link(); // there is no else because the login_error would be set in the function user_logged_in echo json_encode($json); } elseif ($_POST['action'] == 'logout') { if (logged_out() == true) { $json['login_html'] = get_login_link(); } echo json_encode($json); } // end if login } // end if action set } else { ob_start(); echo "<p>"; $mySQLi->print_error(); echo "</p>\n"; $json['login_error'] = ob_get_clean(); } } catch (Exception $e) {