blob: 7d572754c433186d8b1ee2eb3fb81908d3e779cc [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3
4if (!security::checkParams("POST", [
5 ["token", security::PARAM_NEMPTY],
6 ["password", security::PARAM_NEMPTY]
7])) {
8 security::go("index.php?msg=unexpected");
9}
10
11$token = $_POST["token"];
12$password = $_POST["password"];
13
14if (!security::passwordIsGoodEnough($password)) security::go("recovery.php?token=".$token."&msg=weakpassword");
15
16$status = recovery::finishRecovery($token, $password);
17
18security::go("index.php?msg=".($status ? "recoverycompleted" : "recovery2failed"));