/** * Get current user * Get currently loggedin user * * @return User_API|FALSE Returns currently logged in user object if any, FALSE if current user have not logged in */ public static final function userGetCurrent() { if (!self::$_userCacheObject instanceof Users_API) { $userStack = self::$_userStack; if (empty($userStack)) { return false; } $userID = array_pop($userStack); $currentUser = new User_API($userID); if ($currentUser->userid != $userID) { return false; } self::$_userCacheObject = $currentUser; } return self::$_userCacheObject; }