Overview
Comment: | Utilisation de KD2\Form pour le login |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
a14a753be3ecc557ec53a0e238779457 |
User & Date: | bohwaz on 2017-05-16 04:56:11 |
Other Links: | branch diff | manifest | tags |
Context
2017-05-16
| ||
06:09 | DB: Fix legacy compatibility functions check-in: f9c05b3c39 user: bohwaz tags: dev | |
04:56 | Utilisation de KD2\Form pour le login check-in: a14a753be3 user: bohwaz tags: dev | |
2017-05-14
| ||
10:41 | Passage aux objets check-in: 400c8eb2df user: bohwaz tags: dev | |
Changes
Modified src/include/init.php from [bfc98c00e2] to [a6110f17d2].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + | <?php namespace Garradin; use KD2\ErrorManager; use KD2\Security; use KD2\Form; error_reporting(-1); /* * Version de Garradin */ |
︙ | |||
261 262 263 264 265 266 267 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - + + + + + + + + + + + + | { $key = base64_encode(Security::random_bytes(64)); Install::setLocalConfig('SECRET_KEY', $key); define('Garradin\SECRET_KEY', $key); } // Intégration du secret pour les tokens |
︙ |
Modified src/include/lib/Garradin/Template.php from [58ab6469f8] to [d7cfbaa69e].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + | <?php namespace Garradin; |
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | parent::__construct(); $this->assign('www_url', WWW_URL); $this->assign('self_url', Utils::getSelfUrl()); $this->assign('self_url_no_qs', Utils::getSelfUrl(true)); $this->assign('is_logged', false); |
︙ |
Modified src/templates/admin/login.tpl from [73997fd1e9] to [cecf8ffa2c].
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - + - - - - - + - - - - + | {include file="admin/_head.tpl" title="Connexion"} |
︙ |
Modified src/www/admin/_inc.php from [8fa8938d39] to [eb2f2a42ed].
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + + + + + + + + + + + | // Redirection automatique en HTTPS si nécessaire if (PREFER_HTTPS !== true && PREFER_HTTPS >= 2 && empty($_SERVER['HTTPS']) && empty($_POST)) { utils::redirect(str_replace('http://', 'https://', utils::getSelfURL())); exit; } // Alias utiles pour la gestion de formulaires function f($key) { return \KD2\Form::get($key); } function fc($action, Array $rules, Array &$errors = []) { return \KD2\Form::check($action, $rules, $errors); } $tpl = Template::getInstance(); $tpl->assign('admin_url', WWW_URL . 'admin/'); $session = Session::get(); if (!defined('Garradin\LOGIN_PROCESS')) |
︙ |
Modified src/www/admin/login.php from [5749aca48a] to [a38c475ec7].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | + + - + + - + - + - - - + + + + + - - - - - - + + + - - - + - + | <?php namespace Garradin; const LOGIN_PROCESS = true; require_once __DIR__ . '/_inc.php'; // L'utilisateur est déjà connecté if ($session) { Utils::redirect('/admin/'); } // Relance session_start et renvoie une image de 1px transparente if (isset($_GET['keepSessionAlive'])) { Session::refresh(); header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Content-Type: image/gif'); echo base64_decode("R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="); exit; } $errors = []; |
Modified src/www/admin/static/admin.css from [0a77a33694] to [a3aac92b19].
︙ | |||
170 171 172 173 174 175 176 177 178 179 180 181 182 183 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | + + + + + | margin: 1em; color: #666; } p.intro { margin: 1em; } .error ul, .alert ul, .confirm ul { margin-left: 1.5em; list-style: disc; } /* Formulaires */ fieldset { border: 1px solid #ccc; padding: 0.8em 1em 0 1em; margin-bottom: 1em; padding: 0.5em; |
︙ |