blob: b7060bc433e16f06356753e9d535d1c1389cf1e1 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3
4if (!$conf["enableRecovery"] || !$conf["mail"]["enabled"]) security::notFound();
5
6if (!security::checkParams("POST", [
7 ["email", security::PARAM_ISEMAIL],
8 ["dni", security::PARAM_NEMPTY]
9])) {
10 security::go("index.php?msg=unexpected");
11}
12
13$email = $_POST["email"];
14$dni = $_POST["dni"];
15
16$user = recovery::getUser($email, $dni);
17if ($user === false) {
18 sleep(3);
19 security::go("index.php?msg=recovery");
20}
21
22security::go("index.php?msg=".(recovery::recover($user) ? "recovery" : "unexpected"));