Ajout du support des écritures ventilées.
[garradin.git] / www / admin / password.php
1 <?php
2 namespace Garradin;
3
4 const LOGIN_PROCESS = true;
5
6 require_once __DIR__ . '/_inc.php';
7
8 $error = false;
9
10 if (trim(utils::get('c')))
11 {
12 if ($membres->recoverPasswordConfirm(utils::get('c')))
13 {
14 utils::redirect('/admin/password.php?new_sent');
15 }
16
17 $error = 'EXPIRED';
18 }
19 elseif (!empty($_POST['recover']))
20 {
21 if (!utils::CSRF_check('recoverPassword'))
22 {
23 $error = 'OTHER';
24 }
25 else
26 {
27 if (trim(utils::post('id')) && $membres->recoverPasswordCheck(utils::post('id')))
28 {
29 utils::redirect('/admin/password.php?sent');
30 }
31
32 $error = 'MAIL';
33 }
34 }
35
36 if (!$error && isset($_GET['sent']))
37 {
38 $tpl->assign('sent', true);
39 }
40 elseif (!$error && isset($_GET['new_sent']))
41 {
42 $tpl->assign('new_sent', true);
43 }
44
45
46 $champs = $config->get('champs_membres');
47
48 $champ = $champs->get($config->get('champ_identifiant'));
49
50 $tpl->assign('champ', $champ);
51
52 $tpl->assign('error', $error);
53
54 $tpl->display('admin/password.tpl');
55
56 ?>