if (!empty($root) && isset($_SESSION["utente"])) {
if ($_SESSION["utente"]->TwoFactorVerify()) {
$sql = "SELECT * FROM b_password_log WHERE codice_utente = :codice_utente ORDER BY timestamp DESC LIMIT 0,1";
$ris = $pdo->go($sql,array(":codice_utente"=>$_SESSION["utente"]->codice));
$last_change = "0000-00-00";
if ($ris->rowCount() == 1) {
$last_change = $ris->fetch(PDO::FETCH_ASSOC);
if (!empty($last_change)) {
$last_change = $last_change["timestamp"];
}
}
$limit = strtotime("-6 month");
$last_change = strtotime(substr($last_change,0,10));
if ($last_change < $limit) {
$_SESSION["expired_pass"] = true;
if (empty($change_pwd) && !isset($unitTestExecution)) {
echo '';
die();
}
}
if ($_SESSION["utente"]->gerarchia < 99 && $_SESSION["utente"]->gerarchia > 9) {
if (empty($_SESSION["utente"]->collaborazione)) {
echo '';
die();
}
}
} else {
$_SESSION["expired_pass"] = true;
if (empty($change_pwd)) {
echo '';
die();
}
}
if (empty($change_pwd) && !empty($_SESSION["utente"]->oe)) {
if ($_SESSION["ente"]->getInfo()["profilo_completo_oe"] == "S" && $_SESSION["utente"]->oe["profilo_completo"] == "N") {
if (in_array($_SERVER["PHP_SELF"],["/oe/index.php"]) === false) {
echo '';
die();
}
}
}
}
?>