- /**
- * Get current user id, returns 0 if not logged in
- *
- * @return int User ID
- */
- public static function getCurrentUserID()
- {
- if (empty(self::$current_user_id)) {
- $token = self::getCurrentApplicationToken();
- if (!empty($token['uid'])) {
- self::$current_user_id = $token['uid'];
- } else {
- self::$current_user_id = 0;
- }
- }
-
- return (int)self::$current_user_id;
- }
-