diff options
| author | 2024-11-28 17:11:04 +0100 | |
|---|---|---|
| committer | 2024-11-28 17:11:04 +0100 | |
| commit | 15745d42b779ad14efde2932ab116f45eee39246 (patch) | |
| tree | 2528a36184d8152d4f2d90dc73df680f84bbe1d1 /app/Controllers/authController.php | |
| parent | 604b186638276203c8495a3ee86da0cc240ab4d0 (diff) | |
Upgrade code to php 8.1 (#6748)
* revert
Fix code indentation
Fix code
Upgrade code to php 8.1
* fix remarques
* code review
* code review
* code review
* Apply suggestions from code review
* code review
* Fixes
* Many remainging updates of array syntax
* Lost case 'reading-list'
* Uneeded PHPDoc
---------
Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Controllers/authController.php')
| -rw-r--r-- | app/Controllers/authController.php | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index ed021505d..700501371 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -72,27 +72,18 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController { $auth_type = FreshRSS_Context::systemConf()->auth_type; FreshRSS_Context::initUser(Minz_User::INTERNAL_USER, false); - switch ($auth_type) { - case 'form': - Minz_Request::forward(['c' => 'auth', 'a' => 'formLogin']); - break; - case 'http_auth': - Minz_Error::error(403, [ + match ($auth_type) { + 'form' => Minz_Request::forward(['c' => 'auth', 'a' => 'formLogin']), + 'http_auth' => Minz_Error::error(403, [ 'error' => [ _t('feedback.access.denied'), ' [HTTP Remote-User=' . htmlspecialchars(httpAuthUser(false), ENT_NOQUOTES, 'UTF-8') . ' ; Remote IP address=' . connectionRemoteAddress() . ']' ] - ], false); - break; - case 'none': - // It should not happen! - Minz_Error::error(404); - break; - default: - // TODO load plugin instead - Minz_Error::error(404); - } + ], false), + 'none' => Minz_Error::error(404), // It should not happen! + default => Minz_Error::error(404), // TODO load plugin instead + }; } /** |
