public function getActiveUserId() : int { if (empty($_SESSION['userid'])) { throw new UserNotLoggedIn(\trk('errors.security.not_authenticated')); } return (int) $_SESSION['userid']; }