Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame^] | 1 | <?php |
| 2 | require_once("core.php"); |
| 3 | |
| 4 | if (!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 | |
| 14 | if (!security::passwordIsGoodEnough($password)) security::go("recovery.php?token=".$token."&msg=weakpassword"); |
| 15 | |
| 16 | $status = recovery::finishRecovery($token, $password); |
| 17 | |
| 18 | security::go("index.php?msg=".($status ? "recoverycompleted" : "recovery2failed")); |