diff options
| author | polo <ordipolo@gmx.fr> | 2026-06-03 23:15:17 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-06-03 23:15:17 +0200 |
| commit | f37d3f8979b34dbb03d7a39ccbb3889763bea61d (patch) | |
| tree | 81e8301b2db8eddb1a6f27f10fb8f49f97e2eb66 /src/controller/UserController.php | |
| parent | 34c4d0d0c37c7f640a1a6373bba30ebe1129d6c4 (diff) | |
| download | cms-f37d3f8979b34dbb03d7a39ccbb3889763bea61d.tar.gz cms-f37d3f8979b34dbb03d7a39ccbb3889763bea61d.tar.bz2 cms-f37d3f8979b34dbb03d7a39ccbb3889763bea61d.zip | |
exclusion des htaccess des zip, erreur création backup quand dossier var/backups pas encore créé
Diffstat (limited to 'src/controller/UserController.php')
| -rw-r--r-- | src/controller/UserController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/controller/UserController.php b/src/controller/UserController.php index f911d2d..9de2fb8 100644 --- a/src/controller/UserController.php +++ b/src/controller/UserController.php | |||
| @@ -81,8 +81,7 @@ class UserController | |||
| 81 | if($form->validate()){ | 81 | if($form->validate()){ |
| 82 | // à mettre dans une classe métier UserService, Authentication, AuthService? | 82 | // à mettre dans une classe métier UserService, Authentication, AuthService? |
| 83 | $user = self::getUserByName($_POST['login'], $entityManager); | 83 | $user = self::getUserByName($_POST['login'], $entityManager); |
| 84 | if(!empty($user) && $_POST['login'] === $user->getLogin() && password_verify($_POST['password'], $user->getPassword())) | 84 | if(!empty($user) && $_POST['login'] === $user->getLogin() && password_verify($_POST['password'], $user->getPassword())){ |
| 85 | { | ||
| 86 | $log = new Log(true); | 85 | $log = new Log(true); |
| 87 | 86 | ||
| 88 | // protection fixation de session, si l'attaquant crée un cookie de session, il est remplacé | 87 | // protection fixation de session, si l'attaquant crée un cookie de session, il est remplacé |
| @@ -94,7 +93,9 @@ class UserController | |||
| 94 | EmailService::cleanEmails($entityManager); | 93 | EmailService::cleanEmails($entityManager); |
| 95 | 94 | ||
| 96 | try{ | 95 | try{ |
| 97 | Backup::mySQLdump($entityManager, 'auto'); // créer un nouveau backup | 96 | if(file_exists('../var/backups')){ |
| 97 | Backup::mySQLdump($entityManager, 'auto'); // créer un nouveau backup, sauf si les dossiers nécessaires sont encore à créer | ||
| 98 | } | ||
| 98 | } | 99 | } |
| 99 | catch(RuntimeException $e){ | 100 | catch(RuntimeException $e){ |
| 100 | echo '<script>window.error_message = "' . $e->getMessage() . '";</script>'; | 101 | echo '<script>window.error_message = "' . $e->getMessage() . '";</script>'; |
