public static function getCurrentUserInfo() { $currentUser = SJB_Session::getValue('current_user'); if (!empty($currentUser)) { return $currentUser; } if (isset($_COOKIE['session_key'])) { $user_sid = SJB_UserManager::getUserSIDBySessionKey($_COOKIE['session_key']); if (!empty($user_sid)) { $userInfo = SJB_UserManager::getUserInfoBySID($user_sid); if (!empty($userInfo['parent_sid'])) { $subuserInfo = $userInfo; $userInfo = SJB_UserManager::getUserInfoBySID($userInfo['parent_sid']); $userInfo['subuser'] = $subuserInfo; } SJB_Session::setValue('current_user', $userInfo); SJB_Authorization::setKeepCookieForUser($_COOKIE['session_key']); return $userInfo; } } return null; }