blob: b7060bc433e16f06356753e9d535d1c1389cf1e1 [file] [log] [blame]
<?php
require_once("core.php");
if (!$conf["enableRecovery"] || !$conf["mail"]["enabled"]) security::notFound();
if (!security::checkParams("POST", [
["email", security::PARAM_ISEMAIL],
["dni", security::PARAM_NEMPTY]
])) {
security::go("index.php?msg=unexpected");
}
$email = $_POST["email"];
$dni = $_POST["dni"];
$user = recovery::getUser($email, $dni);
if ($user === false) {
sleep(3);
security::go("index.php?msg=recovery");
}
security::go("index.php?msg=".(recovery::recover($user) ? "recovery" : "unexpected"));