Overview
Comment: | Empêcher un administrateur de supprimer son identifiant |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | stable |
Files: | files | file ages | folders |
SHA1: |
c3c39e659202f50a3b74f48677a07144 |
User & Date: | bohwaz on 2020-05-02 00:49:35 |
Other Links: | manifest | tags |
Context
2020-05-04
| ||
00:56 | Corriger pour que les calendrier puissent s'afficher dans les tableaux check-in: baf65bcbf7 user: bohwaz tags: trunk, stable | |
2020-05-02
| ||
00:49 | Empêcher un administrateur de supprimer son identifiant check-in: c3c39e6592 user: bohwaz tags: trunk, stable | |
00:33 | Ne pas permettre de s'auto-modifier pour ne pas se tirer une balle dans le pied check-in: 51cbf72693 user: bohwaz tags: trunk, stable | |
Changes
Modified src/www/admin/mes_infos.php from [132bd75c18] to [dd87b3ed86].
17 17 foreach ($champs->getAll() as $key=>$c) 18 18 { 19 19 if (!empty($c->editable)) 20 20 { 21 21 $data[$key] = f($key); 22 22 } 23 23 } 24 + 25 + if (isset($data[$config->get('champ_identifiant')]) && !trim($data[$config->get('champ_identifiant')]) && $session->canAccess('config', Membres::DROIT_ADMIN)) { 26 + throw new UserException("Le champ identifiant ne peut être vide pour un administrateur, sinon vous ne pourriez plus vous connecter."); 27 + } 24 28 25 29 $session->editUser($data); 26 30 27 31 Utils::redirect(ADMIN_URL); 28 32 } 29 33 catch (UserException $e) 30 34 {