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 /lib/functions.php | |
| parent | 3a2a88172ccbe97aaecf4ea32b97cd07b92dcb11 (diff) | |
StEP 1552 closes #1552
Closes #1552
Merge request studip/studip!1137
Diffstat (limited to 'lib/functions.php')
| -rw-r--r-- | lib/functions.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/functions.php b/lib/functions.php index 39fb966..29264fb 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -345,10 +345,10 @@ function get_fullname($user_id = "", $format = "full" , $htmlready = false) function get_fullname_from_uname($uname = "", $format = "full", $htmlready = false) { static $cache; - global $auth, $_fullname_sql; + global $user, $_fullname_sql; if (!$uname) { - $uname = $auth->auth['uname']; + $uname = $user->username; } $hash = md5($uname . $format); @@ -379,10 +379,10 @@ function get_fullname_from_uname($uname = "", $format = "full", $htmlready = fal function get_username($user_id = "") { static $cache = []; - global $auth; + global $user; - if (!$user_id || $user_id === $auth->auth['uid']) { - return $auth->auth['uname'] ?? ''; + if (!$user_id || $user_id === $user->id) { + return $user->username ?? ''; } if (!isset($cache[$user_id])) { @@ -400,7 +400,7 @@ function get_username($user_id = "") * * uses global $online array if user is online * - * @global object $auth + * @global object user * @staticvar array $cache * * @param string $username if omitted, current user_id will be returned @@ -410,10 +410,10 @@ function get_username($user_id = "") function get_userid($username = "") { static $cache = []; - global $auth; + global $user; - if (!$username || $username == $auth->auth['uname']) { - return $auth->auth['uid']; + if (!$username || $username == $user->username) { + return $user->id; } // Read id from database if no cached version is available @@ -513,7 +513,6 @@ function StringToFloat($str) * passed archived seminar * * @global array $perm - * @global object $auth * @staticvar array $archiv_perms * * @param string $seminar_id the seminar in the archive @@ -641,7 +640,7 @@ function get_users_online_count($active_time = 10) */ function get_ticket() { - return Seminar_Session::get_ticket(); + return CSRFProtection::sessionticket(); } /** @@ -653,7 +652,7 @@ function get_ticket() */ function check_ticket($studipticket) { - return Seminar_Session::check_ticket($studipticket); + return CSRFProtection::verifySessionticket($studipticket); } /** @@ -1124,7 +1123,7 @@ function studip_default_exception_handler($exception) { $status = 403; $template = 'check_object_exception'; } elseif ($exception instanceof LoginException) { - $GLOBALS['auth']->login_if(true); + } else { if ($exception instanceOf Trails\Exception) { $status = $exception->getCode(); |
