blob: 7d572754c433186d8b1ee2eb3fb81908d3e779cc [file] [log] [blame]
<?php
require_once("core.php");
if (!security::checkParams("POST", [
["token", security::PARAM_NEMPTY],
["password", security::PARAM_NEMPTY]
])) {
security::go("index.php?msg=unexpected");
}
$token = $_POST["token"];
$password = $_POST["password"];
if (!security::passwordIsGoodEnough($password)) security::go("recovery.php?token=".$token."&msg=weakpassword");
$status = recovery::finishRecovery($token, $password);
security::go("index.php?msg=".($status ? "recoverycompleted" : "recovery2failed"));