blob: 666319df3b9621424b03956dd80298493ad658b2 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
Adrià Vilanova Martínez5af86512023-12-02 20:44:16 +01002/*
3 * hores
4 * Copyright (c) 2023 Adrià Vilanova Martínez
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public
17 * License along with this program.
18 * If not, see http://www.gnu.org/licenses/.
19 */
20
Copybara botbe50d492023-11-30 00:16:42 +010021require_once("core.php");
22
23if (!security::checkParams("GET", [
24 ["token", security::PARAM_NEMPTY]
25])) {
26 security::go("index.php?msg=unexpected");
27}
28
29$token = $_GET["token"];
30
31$recovery = recovery::getUnusedRecovery($token);
32if ($recovery === false) security::go("index.php?msg=recovery2failed");
33?>
34<!DOCTYPE html>
35<html>
36<head>
37 <title><?php echo $conf["appName"]; ?></title>
38 <?php visual::includeHead(); ?>
39 <link rel="stylesheet" href="css/index.css">
40 <script src="js/index.js"></script>
41</head>
42<?php visual::printBodyTag(); ?>
43 <div class="login mdl-shadow--4dp">
44 <h2>Restablecer contraseña</h2>
45 <form action="dorecovery.php" method="POST" autocomplete="off" id="formulario">
46 <input type="hidden" name="token" value="<?=security::htmlsafe($recovery["token"])?>">
47 <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
48 <input class="mdl-textfield__input" type="password" name="password" id="password" autocomplete="off" data-required>
49 <label class="mdl-textfield__label" for="password">Contraseña</label>
50 </div>
51 <p class="mdl-color-text--grey-600"><?=security::htmlsafe(security::$passwordHelperText)?></p>
52
53 <p><button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">Restablecer</button></p>
54 </form>
55 </div>
56
57 <?php
58 visual::smartSnackbar([
59 ["weakpassword", security::$passwordHelperText]
60 ]);
61 ?>
62</body>
63</html>