diff options
| author | Michaela Brückner <brueckner@data-quest.de> | 2026-03-03 08:40:08 +0100 |
|---|---|---|
| committer | Michaela Brückner <brueckner@data-quest.de> | 2026-03-03 08:40:08 +0100 |
| commit | c1bd3bb9f221d1d837ee4ac2e65aa1f0ac37f7d0 (patch) | |
| tree | cf8693b613f731398a5873876755ccdba455640d /app/controllers/nobody_settings.php | |
| parent | 9500f0acd34f6169066f7cc975ff286d5a4739c0 (diff) | |
Resolve "Hohen Kontrast aktivieren und Sprachauswahl funktionieren nur auf Login Seite"
Closes #6070
Merge request studip/studip!4779
Diffstat (limited to 'app/controllers/nobody_settings.php')
| -rw-r--r-- | app/controllers/nobody_settings.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/app/controllers/nobody_settings.php b/app/controllers/nobody_settings.php new file mode 100644 index 0000000..993f218 --- /dev/null +++ b/app/controllers/nobody_settings.php @@ -0,0 +1,48 @@ +<?php + +use Trails\Controller; + +/** + * nobody_settings.php - contrast and language settings for nobody + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Michaela Brückner <brueckner@data-quest.de> + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +class NobodySettingsController extends StudipController +{ + protected $with_session = true; + + public function store_settings_action() + { + + $this->page = Request::get('page'); + + if (Request::submitted('user_config_submitted')) { + CSRFProtection::verifyUnsafeRequest(); + + if (Request::submitted('unset_contrast')) { + $_SESSION['contrast'] = 0; + } + if (Request::submitted('set_contrast')) { + $_SESSION['contrast'] = 1; + } + + foreach (array_keys($GLOBALS['INSTALLED_LANGUAGES']) as $language_key) { + if (Request::get('set_language') === $language_key) { + $_SESSION['forced_language'] = $language_key; + $_SESSION['_language'] = $language_key; + } + } + } + + $this->redirect($this->page); //we're too late to remove the high contrast mode, so we reload the page + } + +} |
