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: c3c39e659202f50a3b74f48677a07144ae01d722
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
18
19
20
21
22
23




24
25
26
27
28
29
30
            foreach ($champs->getAll() as $key=>$c)
            {
                if (!empty($c->editable))
                {
                    $data[$key] = f($key);
                }
            }





            $session->editUser($data);

            Utils::redirect(ADMIN_URL);
        }
        catch (UserException $e)
        {







>
>
>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
            foreach ($champs->getAll() as $key=>$c)
            {
                if (!empty($c->editable))
                {
                    $data[$key] = f($key);
                }
            }

            if (isset($data[$config->get('champ_identifiant')]) && !trim($data[$config->get('champ_identifiant')]) && $session->canAccess('config', Membres::DROIT_ADMIN)) {
                throw new UserException("Le champ identifiant ne peut être vide pour un administrateur, sinon vous ne pourriez plus vous connecter.");
            }

            $session->editUser($data);

            Utils::redirect(ADMIN_URL);
        }
        catch (UserException $e)
        {