diff options
| author | polo <ordipolo@gmx.fr> | 2026-10-23 00:47:32 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-10-23 00:47:32 +0200 |
| commit | f27cca08ff786ceff1870147f6d6bad14d71117f (patch) | |
| tree | d36597a72025313d6faf4ed228755fa267ebe2f6 /src/view/UserEditBuilder.php | |
| parent | c7309f900ef05bd5cb313110ec159b761af394ec (diff) | |
| download | cms-f27cca08ff786ceff1870147f6d6bad14d71117f.tar.gz cms-f27cca08ff786ceff1870147f6d6bad14d71117f.tar.bz2 cms-f27cca08ff786ceff1870147f6d6bad14d71117f.zip | |
dossiers avec majuscule, namespace pour toutes les classes, autoload psr-4, UserDataService::createZip déplacé dans Backup
Diffstat (limited to 'src/view/UserEditBuilder.php')
| -rw-r--r-- | src/view/UserEditBuilder.php | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/view/UserEditBuilder.php b/src/view/UserEditBuilder.php deleted file mode 100644 index 0a347d4..0000000 --- a/src/view/UserEditBuilder.php +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | <?php | ||
| 2 | // src/view/UserEditBuilder.php | ||
| 3 | // | ||
| 4 | // fonctionne avec UserController | ||
| 5 | |||
| 6 | declare(strict_types=1); | ||
| 7 | |||
| 8 | use App\Entity\Node; | ||
| 9 | |||
| 10 | class UserEditBuilder extends AbstractBuilder | ||
| 11 | { | ||
| 12 | public function __construct(Node $node) | ||
| 13 | { | ||
| 14 | // pour éviter les arnaques | ||
| 15 | if(!IS_ADMIN) | ||
| 16 | { | ||
| 17 | header('Location: ' . new URL); | ||
| 18 | die; | ||
| 19 | } | ||
| 20 | |||
| 21 | $viewFile = self::VIEWS_PATH . $node->getName() . '.php'; | ||
| 22 | |||
| 23 | $error_messages = [ | ||
| 24 | 'error_non_valid_captcha' => 'Erreur au test anti-robot, veuillez saisir un nombre entier.', | ||
| 25 | 'captcha_server_error' => 'captcha_server_error', | ||
| 26 | |||
| 27 | 'bad_login_or_password' => 'Mauvais identifiant ou mot de passe, veuillez réessayer.', // ne pas indiquer où est l'erreur | ||
| 28 | 'bad_solution_captcha' => 'Erreur au test anti-robot, veuillez réessayer.', | ||
| 29 | 'forbidden_characters' => 'Caractères interdits: espaces, tabulations, sauts CR/LF.', | ||
| 30 | 'same_username_as_before' => 'Nouveau nom identique au précédent.', | ||
| 31 | 'same_password_as_before' => 'Nouveau mot de passe identique au précédent.' | ||
| 32 | ]; | ||
| 33 | |||
| 34 | $error_username = isset($_GET['error_username']) ? $error_messages[$_GET['error_username']] : ''; | ||
| 35 | $success_username = (isset($_GET['success_username']) && $_GET['success_username']) ? 'Identifiant modifié avec succès.' : ''; | ||
| 36 | $error_password = isset($_GET['error_password']) ? $error_messages[$_GET['error_password']] : ''; | ||
| 37 | $success_password = (isset($_GET['success_password']) && $_GET['success_password']) ? 'Mot de passe modifié avec succès.' : ''; | ||
| 38 | |||
| 39 | $captcha = new Captcha; | ||
| 40 | $_SESSION['captcha'] = $captcha->getSolution(); // enregistrement de la réponse du captcha pour vérification | ||
| 41 | |||
| 42 | $link_user_form = new URL(['action' => 'update_username']); | ||
| 43 | isset($_GET['from']) ? $link_user_form->addParams(['from' => $_GET['from']]) : ''; | ||
| 44 | isset($_GET['id']) ? $link_user_form->addParams(['id' => $_GET['id']]) : ''; | ||
| 45 | |||
| 46 | $link_password_form = new URL(['action' => 'update_password']); | ||
| 47 | isset($_GET['from']) ? $link_password_form->addParams(['from' => $_GET['from']]) : ''; | ||
| 48 | isset($_GET['id']) ? $link_password_form->addParams(['id' => $_GET['id']]) : ''; | ||
| 49 | |||
| 50 | $link_exit = new URL; | ||
| 51 | isset($_GET['from']) ? $link_exit->addParams(['page' => $_GET['from'] ]) : ''; | ||
| 52 | isset($_GET['id']) ? $link_exit->addParams(['id' => $_GET['id']]) : ''; | ||
| 53 | |||
| 54 | $link_logout = new URL(['action' => 'deconnection']); | ||
| 55 | isset($_GET['from']) ? $link_logout->addParams(['from' => $_GET['from'] ]) : ''; | ||
| 56 | isset($_GET['id']) ? $link_logout->addParams(['id' => $_GET['id']]) : ''; | ||
| 57 | |||
| 58 | ob_start(); | ||
| 59 | require $viewFile; | ||
| 60 | $this->html = ob_get_clean(); // nouveau contenu | ||
| 61 | } | ||
| 62 | } \ No newline at end of file | ||
