/** * @desc Returns true if user is not a staff member and is blocked locally/globally * * @return bool */ protected function isBlocked() { $this->app->wf->ProfileIn(__METHOD__); // check if the user is blocked locally, if not, also check if they're blocked globally (via Phalanx) $isBlocked = $this->user->isBlocked() || $this->user->isBlockedGlobally(); if ($isBlocked && !$this->isUserInGroup(self::WIKIA_GROUP_STAFF_NAME)) { $this->app->wf->ProfileOut(__METHOD__); return true; } $this->app->wf->ProfileOut(__METHOD__); return false; }
/** * @desc Returns true if user isn't: an IP address, excluded from interstitial, bot, blocked locally and globally * * @param User $user * @return bool */ public function isValidUserForInterstitial(User $user) { $userId = $user->getId(); $userName = $user->getName(); return !$user->isIP($userName) && !in_array($userId, WikiService::$excludedWikiaUsers) && !in_array('bot', $user->getRights()) && !$user->isBlocked() && !$user->isBlockedGlobally(); }
/** * @desc Returns true if user isn't: an IP address, excluded from interstitial, bot, blocked locally and globally * * @param User $user * @return bool */ protected function isValidUserForInterstitial(User $user) { $userId = $user->getId(); $userName = $user->getName(); return !$user->isIP($userName) && !in_array($userId, $this->excludeUsersFromInterstitial) && !in_array('bot', $user->getRights()) && !$user->isBlocked() && !$user->isBlockedGlobally(); }