diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-06-21 15:51:27 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-06-21 15:51:27 +0000 |
| commit | 97a188592c679890a25c37ab78463add76a52ff7 (patch) | |
| tree | 65edea663b77994bfd009b434dbd3688f7d7dc14 /app/controllers/profile.php | |
| parent | 871ff3ae2b66aab875586e41e9cff6a81eb2b706 (diff) | |
fix php8 warning, fixes #4341
Closes #4341
Merge request studip/studip!3143
Diffstat (limited to 'app/controllers/profile.php')
| -rw-r--r-- | app/controllers/profile.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/app/controllers/profile.php b/app/controllers/profile.php index 72a500e..1412c9c 100644 --- a/app/controllers/profile.php +++ b/app/controllers/profile.php @@ -40,14 +40,14 @@ class ProfileController extends AuthenticatedController // set the page title depending on user selection if ( - $this->user + isset($this->user, $this->current_user) && $this->current_user->id === $this->user->id && !$this->current_user->locked ) { PageLayout::setTitle(_('Mein Profil')); UserConfig::get($this->user->id)->store('PROFILE_LAST_VISIT', time()); } elseif ( - $this->current_user->id + !empty($this->current_user->id) && ( $this->perm->have_perm('root') || ( @@ -139,17 +139,16 @@ class ProfileController extends AuthenticatedController } // calendar - $this->dates = ''; - if (Config::get()->CALENDAR_ENABLE) { - if (!in_array($this->current_user->perms, ['admin', 'root'])) { - if (Visibility::verify('termine', $this->current_user->user_id)) { - $start = time(); - $end = strtotime('+1 week 23:59:59'); - - $response = $this->relay('calendar/contentbox/display/' . $this->current_user->user_id . '/' . ($end - $start)); - $this->dates = $response->body; - } - } + if ( + Config::get()->CALENDAR_ENABLE + && !in_array($this->current_user->perms, ['admin', 'root']) + && Visibility::verify('termine', $this->current_user->user_id) + ) { + $start = time(); + $end = strtotime('+1 week 23:59:59'); + + $response = $this->relay('calendar/contentbox/display/' . $this->current_user->user_id . '/' . ($end - $start)); + $this->dates = $response->body; } // include and show votes and tests |
