$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; include_once($configPath); $tokenVerified = false; if (!empty($_SESSION["utente"]) && is_a($_SESSION["utente"],"Utente")) { if (!empty($_GET["expired"])) { $tmp = array(); $tmp["codice"] = $_SESSION["utente"]->codice; $tmp["password_request"] = date("Y-m-d H:m:i"); $tmp["password_token"] = tokenGen(); $salva = new salva(); $salva->debug = false; $salva->nome_tabella = "b_utenti"; $salva->operazione = "UPDATE"; $salva->oggetto = $tmp; if ($salva->save() > 0) { $_GET["email"] = base64_encode($_SESSION["utente"]->getInfo()["email"]); $_GET["token"] = base64_encode($tmp["password_token"]); } } else { unset($_SESSION["utente"]); } } if (((!empty($_GET["email"]) || !empty($_POST["email"])) && (!empty($_GET["token"]) || !empty($_POST["token"])))) { $change_pwd = true; $hide_footer = $hide_menu = TRUE; include_once ($root."/layout/topLogin.php"); $email = empty($_GET["email"]) ? $_POST["email"] : $_GET["email"]; $email = base64_decode($email); $token = empty($_GET["token"]) ? $_POST["token"] : $_GET["token"]; $token = base64_decode($token); $bind=array(":token"=>$token,":email"=>$email); $sql = "SELECT codice, password FROM b_utenti WHERE attivo = 'S' AND email = :email AND password_token = :token AND DATE_ADD(password_request, INTERVAL 2 DAY) > curdate()"; $ris = $pdo->go($sql,$bind); ?>