Overview
Comment: | Efface les cookies précédemment mis sur le chemin /admin/ qui pourraient dans certains cas rester et se chevaucher avec le cookie sur '/' |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
259afc75f90a7c96708a80adf3a36c09 |
User & Date: | bohwaz on 2018-05-11 12:11:10 |
Other Links: | manifest | tags |
References
2020-12-08
| ||
23:25 | • Wiki page "Changelog/0.9" artifact: b9c916b4d1 user: bohwaz | |
Context
2018-05-11
| ||
12:16 | Recherche exacte sur les champs de type sélecteur à choix unique, cf. [587f730b661a7ce16bad215d4bd02195e754ec57] check-in: 7c360dbe83 user: bohwaz tags: trunk | |
12:11 | Efface les cookies précédemment mis sur le chemin /admin/ qui pourraient dans certains cas rester et se chevaucher avec le cookie sur '/' check-in: 259afc75f9 user: bohwaz tags: trunk | |
2018-05-10
| ||
13:20 | Permettre de désactiver l'appel à NTP pour le login TOTP check-in: e288c7a5af user: bohwaz tags: trunk | |
Changes
Modified src/include/lib/Garradin/Membres/Session.php from [e6c6eb3942] to [9956de13f9].
︙ | ︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | parent::__construct(DB::getInstance(), [ 'cookie_domain' => $url['host'], 'cookie_path' => preg_replace('!/admin/$!', '/', $url['path']), 'cookie_secure' => (\Garradin\PREFER_HTTPS >= 2) ? true : false, ]); } protected function getUserForLogin($login) { $champ_id = Config::getInstance()->get('champ_identifiant'); // Ne renvoie un membre que si celui-ci a le droit de se connecter $query = 'SELECT m.id, m.%1$s AS login, m.passe AS password, m.secret_otp AS otp_secret | > > > > > > > > > > > | 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 | parent::__construct(DB::getInstance(), [ 'cookie_domain' => $url['host'], 'cookie_path' => preg_replace('!/admin/$!', '/', $url['path']), 'cookie_secure' => (\Garradin\PREFER_HTTPS >= 2) ? true : false, ]); } /** * Suppression anciens cookies qui avaient un chemin incorrect * FIXME supprimer en 2019 * @return void */ public function cleanOldCookies() { setcookie($this->cookie_name, null, -1, '/admin/', $this->cookie_domain, $this->cookie_secure, true); setcookie($this->remember_me_cookie_name, null, -1, '/admin/', $this->cookie_domain, $this->cookie_secure, true); } protected function getUserForLogin($login) { $champ_id = Config::getInstance()->get('champ_identifiant'); // Ne renvoie un membre que si celui-ci a le droit de se connecter $query = 'SELECT m.id, m.%1$s AS login, m.passe AS password, m.secret_otp AS otp_secret |
︙ | ︙ |
Modified src/www/admin/login.php from [65b282fb8b] to [5bb3d0cb12].
︙ | ︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | ]); if (!$form->hasErrors() && ($login = $session->login(f('_id'), f('passe'), (bool) f('permanent')))) { Utils::redirect(ADMIN_URL); } } $champs = $config->get('champs_membres'); $champ = $champs->get($config->get('champ_identifiant')); $tpl->assign('ssl_enabled', empty($_SERVER['HTTPS']) ? false : true); $tpl->assign('prefer_ssl', (bool)PREFER_HTTPS); $tpl->assign('own_https_url', str_replace('http://', 'https://', utils::getSelfURL())); $tpl->assign('champ', $champ); $tpl->assign('fail', $login === false); $tpl->display('admin/login.tpl'); | > > | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ]); if (!$form->hasErrors() && ($login = $session->login(f('_id'), f('passe'), (bool) f('permanent')))) { Utils::redirect(ADMIN_URL); } } $session->cleanOldCookies(); $champs = $config->get('champs_membres'); $champ = $champs->get($config->get('champ_identifiant')); $tpl->assign('ssl_enabled', empty($_SERVER['HTTPS']) ? false : true); $tpl->assign('prefer_ssl', (bool)PREFER_HTTPS); $tpl->assign('own_https_url', str_replace('http://', 'https://', utils::getSelfURL())); $tpl->assign('champ', $champ); $tpl->assign('fail', $login === false); $tpl->display('admin/login.tpl'); |