diff options
| author | André Noack <noack@data-quest.de> | 2024-12-12 14:52:00 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2024-12-12 14:52:00 +0000 |
| commit | 940d2aaa8638b4e0c764579cb3977e7be527c81f (patch) | |
| tree | 79bd2d7f02359e1bb24931b33513e082f8404a91 /app/controllers/settings | |
| parent | 3a2a88172ccbe97aaecf4ea32b97cd07b92dcb11 (diff) | |
StEP 1552 closes #1552
Closes #1552
Merge request studip/studip!1137
Diffstat (limited to 'app/controllers/settings')
| -rw-r--r-- | app/controllers/settings/avatar.php | 4 | ||||
| -rw-r--r-- | app/controllers/settings/settings.php | 27 |
2 files changed, 2 insertions, 29 deletions
diff --git a/app/controllers/settings/avatar.php b/app/controllers/settings/avatar.php index 31bd705..067e346 100644 --- a/app/controllers/settings/avatar.php +++ b/app/controllers/settings/avatar.php @@ -5,8 +5,6 @@ class Settings_AvatarController extends AuthenticatedController public function before_filter(&$action, &$args) { parent::before_filter($action, $args); - // Ensure user is logged in - $GLOBALS['auth']->login_if($action !== 'logout' && $GLOBALS['auth']->auth['uid'] === 'nobody'); if (!$GLOBALS['perm']->have_profile_perm('user', User::findCurrent()->id)) { throw new AccessDeniedException(_('Sie dürfen dieses Profil nicht bearbeiten')); @@ -20,4 +18,4 @@ class Settings_AvatarController extends AuthenticatedController $avatar = Avatar::getAvatar($this->user_id); $this->avatar_url = $avatar->getURL(Avatar::NORMAL); } -}
\ No newline at end of file +} diff --git a/app/controllers/settings/settings.php b/app/controllers/settings/settings.php index 9cd00c0..294b288 100644 --- a/app/controllers/settings/settings.php +++ b/app/controllers/settings/settings.php @@ -35,9 +35,6 @@ abstract class Settings_SettingsController extends AuthenticatedController parent::before_filter($action, $args); - // Ensure user is logged in - $GLOBALS['auth']->login_if($action !== 'logout' && $GLOBALS['auth']->auth['uid'] === 'nobody'); - // extract username $username = Request::username('username', $GLOBALS['user']->username); $this->user = User::findByUsername($username); @@ -96,23 +93,6 @@ abstract class Settings_SettingsController extends AuthenticatedController } /** - * Adjust url_for so it imitates the parameters behaviour of URLHelper. - * This way you can add parameters by adding an associative array as last - * argument. - * - * @param mixed $to Path segments of the url (String) or url parameters - * (Array) - * @return String Generated url - */ - public function url_for($to = ''/*, ...*/) - { - $arguments = func_get_args(); - $parameters = is_array(end($arguments)) ? array_pop($arguments) : []; - $url = call_user_func_array('parent::url_for', $arguments); - return URLHelper::getURL($url, $parameters); - } - - /** * Gets the default template for an action. * * @param String $action Which action was invoked @@ -224,14 +204,9 @@ abstract class Settings_SettingsController extends AuthenticatedController $should_logout = $action === 'logout' && $this->flash['logout-token'] === Request::get('token'); if ($should_logout) { - $GLOBALS['sess']->delete(); - $GLOBALS['auth']->logout(); + $this->redirect('dispatch.php/logout'); } parent::after_filter($action, $args); - - if ($should_logout) { - $GLOBALS['user']->set_last_action(time() - 15 * 60); - } } } |
