コード例 #1
0
 /**
  * Checks if wiki is restricted for all users (*)
  *
  * @param $value string wgGroupPermissionsLocalId content
  * @return bool True if wiki is restricted
  */
 private static function isRestrictedWiki($value)
 {
     $permissions = WikiFactoryLoader::parsePermissionsSettings($value);
     if (isset($permissions['*']) && is_array($permissions['*']) && isset($permissions['*']['read']) && $permissions['*']['read'] === false) {
         return true;
     }
     return false;
 }
コード例 #2
0
 /**
  * @brief Hook on WikiFactory change and update wikis's visibility if the wgGroupPermissionsLocal is changed
  *
  * @param String $cv_name
  * @param Integer $city_id
  * @param String $value
  *
  * @return Boolean
  *
  * @author Evgeniy (aquilax)
  */
 public static function onWikiFactoryChanged($cv_name, $city_id, $value)
 {
     global $wgExternalDatawareDB;
     if (empty($wgExternalDatawareDB)) {
         // Exit if there is no Dataware DB
         return true;
     }
     if ($cv_name === 'wgGroupPermissionsLocal') {
         $is_restricted = false;
         $permissions = WikiFactory::getVarValueByName('wgGroupPermissionsLocal', $city_id);
         if (!empty($value)) {
             $permissions = WikiFactoryLoader::parsePermissionsSettings($value);
         }
         if (isset($permissions['*']) && is_array($permissions['*']) && isset($permissions['*']['read']) && $permissions['*']['read'] === false) {
             $is_restricted = true;
         }
         UserProfilePageHelper::updateRestrictedWikis((int) $city_id, $is_restricted);
     }
     return true;
 }
コード例 #3
0
ファイル: WikiFactory.php プロジェクト: Tjorriemorrie/app
 /**
  * Checks if a wiki is "restricted", or "private" (i.e. users need to log in to read,
  * e.g. communitycouncil.wikia.com)
  *
  * @param integer $wikiId The ID of the wiki to check
  *
  * @return boolean true if it's restricted, false otherwise
  */
 public static function isWikiPrivate($wikiId)
 {
     wfProfileIn(__METHOD__);
     //restricting a wiki is done by setting the "read" permission
     //to 0 (false) for the "*" group via a WF variable (source: Tor),
     //if the above will change in the future then this will stop working (duh),
     //we should probably introduce a WF flag to handle this case in a much more
     //clean and portable way
     $permissions = self::getVarValueByName('wgGroupPermissionsLocal', $wikiId);
     $ret = false;
     if (!empty($permissions)) {
         $permissions = WikiFactoryLoader::parsePermissionsSettings($permissions);
     }
     if (isset($permissions['*']) && is_array($permissions['*']) && isset($permissions['*']['read']) && $permissions['*']['read'] === false) {
         $ret = true;
     }
     wfProfileOut(__METHOD__);
     return $ret;
 }
コード例 #4
0
ファイル: LocalSettings.php プロジェクト: schwarer2006/wikia
 * Definition of global memcached servers
 *
 * Before altering the wgMemCachedServers array below, make sure you planned
 * your changes. Memcached computes a hash of the data and given the hash
 * assigns the value one of the servers.
 * If you remove / comment / change order of the servers, the hash will miss
 * and that can result in bad performance for the cluster!
 */
$wgMemCachedServers = array(0 => "10.8.36.106:11000", 1 => "10.8.36.107:11000");
$wgSessionMemCachedServers = array(0 => "10.8.36.106:11000", 1 => "10.8.36.107:11000");
# NOTE: THIS MUST BE DONE _BEFORE_ CALLING WikiFactory::execute IF WIKIFACTORY IS BEING USED.
include "{$IP}/extensions/wikia/Development/SpecialDevBoxPanel/Special_DevBoxPanel.php";
#
# Load all variables for the given wikia from a wiki.factory database
#
$oWiki = new WikiFactoryLoader();
$wgCityId = $oWiki->execute();
##### MAKE ANY CHANGES HERE THAT YOU  WANT TO SHOW UP ON DEVBOXES BY DEFAULT BUT STILL BE OVERRIDABLE #####
$wgCookieDomain = ".wikia-dev.com";
$wgCheckSerialized = true;
// Life is easier if we have Special:WikiFactory
$wgWikiaEnableWikiFactoryExt = true;
$wgEnableUserChangesHistoryExt = false;
$wgAllInOne = false;
$wgEnableFixRecoveredUsersExt = false;
// enable ExternalUsers
$wgExternalUserEnabled = true;
// antispoof extension needs statsdb setup, only on prod for now
$wgEnableAntiSpoofExt = false;
// Google Maps key for wikia-dev.com (different than the key for wikia.com).
$wgGoogleMapsKey = 'ABQIAAAAH6bdoxGNhXgildFjnRAQjBTsndpDQKTEb03AQ6hTlU-KPVq60xQdoVVgLuXn-IrTw3LW8MYBMaYx9Q';