Describes the subsites this user has SITETREE_EDIT_ALL access to

@return string
344104
public function getSubsiteDescription()
    {
        $subsites = Subsite::accessible_sites(
            $this->owner->config()->get('subsite_description_permission'),
            true,
            "Main site",
            $this->owner
        );
        return implode(', ', $subsites->column('Title'));
    }
431970
protected function getRolesFromSite($site)
	{
		$newDataSet = new AnyDataset();
		$it = $this->user->getRolesIterator($site);
		while ($it->hasNext()) {
			$sr = $it->moveNext();
			$dataArray = $sr->getFieldArray($this->user->getRolesTable()->Role);
			if (sizeof($dataArray) > 0) {
				foreach ($dataArray as $roles) {
					$siteName = $sr->getField($this->user->getRolesTable()->Site);
					if ($siteName == "_all") {
						$siteName = $this->myWords->Value("TEXT_ALLSITES");
					}
					$newDataSet->appendRow();
					$newDataSet->addField($this->user->getRolesTable()->Site, $siteName);
					$newDataSet->addField($this->user->getRolesTable()->Role, $roles);
				}	
			}
		}
		return $newDataSet;
	}
810953
public static function get_directory_for_current_subsite()
    {
        $subsite = Subsite::currentSubsite();
        if ($subsite) {
            if ((int) $subsite->AssetsFolderID > 0) {
                $dirObj = $subsite->AssetsFolder();

                $dirName = str_replace('assets/', '', $dirObj->Filename);

                //make sure we've got no trailing slashes
                $dirName = str_replace('/', '', $dirName);

                return $dirName;
            }
        } else {
            return false;
        }
    }
786615
static function showInvisibleNodes()
    {
        static $cachedResult;

        if ( !isset( $cachedResult ) )
        {
            $ini = eZINI::instance( 'site.ini' );
            $cachedResult = $ini->hasVariable( 'SiteAccessSettings', 'ShowHiddenNodes' ) ?
                            $ini->variable( 'SiteAccessSettings', 'ShowHiddenNodes' ) == 'true' :
                            true;
        }

        return $cachedResult;
    }
1075163
public function getSubstitutedDomain()
    {
        $currentHost = $_SERVER['HTTP_HOST'];

        // If there are wildcards in the primary domain (not recommended), make some
        // educated guesses about what to replace them with:
        $domain = preg_replace('/\.\*$/', ".{$currentHost}", $this->Domain);

        // Default to "subsite." prefix for first wildcard
        // TODO Whats the significance of "subsite" in this context?!
        $domain = preg_replace('/^\*\./', "subsite.", $domain);

        // *Only* removes "intermediate" subdomains, so 'subdomain.www.domain.com' becomes 'subdomain.domain.com'
        $domain = str_replace('.www.', '.', $domain);

        return $domain;
    }
371440
public function getTemplateAccessors() {
		if($this->templateAccessors) return $this->templateAccessors;
		
		$vars = parent::getTemplateAccessors();


		$cc = new ReflectionClass('ContentController');
		$site_tree = new ReflectionClass('SiteTree');
		$hierarchy = new ReflectionClass('Hierarchy');
		
		$methods = array_merge(
			$site_tree->getMethods(), 
			$cc->getMethods(),
			$hierarchy->getMethods(),
			array_keys(singleton('SiteTree')->has_many()),
			array_keys(singleton('SiteTree')->many_many()),
			array_keys(singleton('SiteTree')->db()),
			array_keys(DataObject::config()->fixed_fields)
		);		
		
		foreach($methods as $m) {
			$name = is_object($m) ? $m->getName() : $m;
			// We only care about methods that follow the UpperCamelCase convention.
			if(preg_match("/[A-Z]/",$name[0])) {
				$vars[] = $name;
			}
		}
		// Just a random exception case
		$vars[] = "Form";

		return $this->templateAccessors = $vars;
	}
1179773
public function getTreeHints() {
        $json = '';

        $classes = array('Snippet', 'SnippetLanguage', 'SnippetFolder');

         $cacheCanCreate = array();
         foreach($classes as $class) $cacheCanCreate[$class] = singleton($class)->canCreate();

         // Generate basic cache key. Too complex to encompass all variations
         $cache=SS_Cache::factory('CodeBank_TreeHints');
         $cacheKey = md5(implode('_', array(Member::currentUserID(), implode(',', $cacheCanCreate), implode(',', $classes))));
         if($this->request->getVar('flush')) $cache->clean(Zend_Cache::CLEANING_MODE_ALL);
         $json = $cache->load($cacheKey);
         if(!$json) {
            $def['Root'] = array();
            $def['Root']['disallowedParents'] = array();

            foreach($classes as $class) {
                $sng=singleton($class);
                $allowedChildren = $sng->allowedChildren();
                
                // SiteTree::allowedChildren() returns null rather than an empty array if SiteTree::allowed_chldren == 'none'
                if($allowedChildren == null) $allowedChildren = array();
                
                // Find i18n - names and build allowed children array
                foreach($allowedChildren as $child) {
                    $instance = singleton($child);
                    
                    if($instance instanceof HiddenClass) continue;

                    if(!array_key_exists($child, $cacheCanCreate) || !$cacheCanCreate[$child]) continue;

                    // skip this type if it is restricted
                    if($instance->stat('need_permission') && !$this->can(singleton($class)->stat('need_permission'))) continue;

                    $title = $instance->i18n_singular_name();

                    $def[$class]['allowedChildren'][] = array("ssclass" => $child, "ssname" => $title);
                }

                $allowedChildren = array_keys(array_diff($classes, $allowedChildren));
                if($allowedChildren) $def[$class]['disallowedChildren'] = $allowedChildren;
                $defaultChild = $sng->default_child();
                if($defaultChild != null) $def[$class]['defaultChild'] = $defaultChild;
                if(isset($def[$class]['disallowedChildren'])) {
                    foreach($def[$class]['disallowedChildren'] as $disallowedChild) {
                        $def[$disallowedChild]['disallowedParents'][] = $class;
                    }
                }
                
                // Are any classes allowed to be parents of root?
                $def['Root']['disallowedParents'][] = $class;
            }

            $json = Convert::raw2xml(Convert::raw2json($def));
            $cache->save($json, $cacheKey);
        }
        return $json;
    }
929692
public function getSiteDir() {
    if (!drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_SITE)) {
      return FALSE;
    }

    // Check for aliases.
    $site_name = drush_sitealias_bootstrapped_site_name();
    $alias = drush_sitealias_get_record("@{$site_name}");

    if (floatval(DRUSH_VERSION) > 6.2) {
      $site_path = drush_sitealias_local_site_path($alias);
    }
    else {
      $supposed_path = drush_sitealias_local_site_path($alias);
      $hostname = drush_sitealias_uri_to_site_dir($alias['uri']);

      $site_root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT');
      if (file_exists($site_root . '/sites/sites.php')) {
        $sites = [];

        include $site_root . '/sites/sites.php';

        // If we found a match in sites.php and the supposed path is sites/default
        // then replace 'default' with the matching directory.
        if (isset($sites[$hostname]) && substr($supposed_path, -8) == '/default') {
          $site_path = str_replace('/default', "/{$sites[$hostname]}", $supposed_path);
        }
        else {
          $site_path = $supposed_path;
        }
      }
      else {
        $site_path = $supposed_path;
      }
    }

    // If the site dir is 'default', switch to 'all'.
    if (substr($site_path, -8) == '/default') {
      $site_path = str_replace('/default', '/all', $site_path);
    }

    return $site_path . '/drush';
  }
796276
protected function getSiteInfo()
    {
        if ( null === $this->siteInfo )
        {
            $this->siteInfo = $this->getServiceLocator()
                                   ->get( 'SiteInfo' );
        }

        return $this->siteInfo;
    }
1076745
public function getRoleForSite($idSite)
    {
        if ($this->hasSuperUserAccess
            || in_array($idSite, $this->getSitesIdWithAdminAccess())
        ) {
            return 'admin';
        }

        if (in_array($idSite, $this->getSitesIdWithWriteAccess())) {
            return 'write';
        }

        if (in_array($idSite, $this->getSitesIdWithViewAccess())) {
            return 'view';
        }

        return 'noaccess';
    }
1137226
public final function getAuthority(): string
   {
       return ($this->user ? $this->user . static::USER_SEPARATOR : "")
            . $this->host
            . ($this->port ? static::HOST_SEPARATOR . $this->port : "");
   }
45336
public function SiteTreeHints()
    {
        $classes = SiteTree::page_type_classes();
        $memberID = Security::getCurrentUser() ? Security::getCurrentUser()->ID : 0;
        $cache = $this->getHintsCache();
        $cacheKey = $this->generateHintsCacheKey($memberID);
        $json = $cache->get($cacheKey);

        if ($json) {
            return $json;
        }

        $canCreate = [];
        foreach ($classes as $class) {
            $canCreate[$class] = singleton($class)->canCreate();
        }

        $def['Root'] = [];
        $def['Root']['disallowedChildren'] = [];

        // Contains all possible classes to support UI controls listing them all,
        // such as the "add page here" context menu.
        $def['All'] = [];

        // Identify disallows and set globals
        foreach ($classes as $class) {
            $obj = singleton($class);
            if ($obj instanceof HiddenClass) {
                continue;
            }

            // Name item
            $def['All'][$class] = [
                'title' => $obj->i18n_singular_name()
            ];

            // Check if can be created at the root
            $needsPerm = $obj->config()->get('need_permission');
            if (!$obj->config()->get('can_be_root')
                || (!array_key_exists($class, $canCreate) || !$canCreate[$class])
                || ($needsPerm && !$this->can($needsPerm))
            ) {
                $def['Root']['disallowedChildren'][] = $class;
            }

            // Hint data specific to the class
            $def[$class] = [];

            $defaultChild = $obj->defaultChild();
            if ($defaultChild !== 'Page' && $defaultChild !== null) {
                $def[$class]['defaultChild'] = $defaultChild;
            }

            $defaultParent = $obj->defaultParent();
            if ($defaultParent !== 1 && $defaultParent !== null) {
                $def[$class]['defaultParent'] = $defaultParent;
            }
        }

        $this->extend('updateSiteTreeHints', $def);

        $json = json_encode($def);
        $cache->set($cacheKey, $json);

        return $json;
    }
1097882
public function sitesManagedByMember($member = null)
    {
        $member = $member ?: Member::currentUser();
        if (!$member) return array();

        $sites = Site::get();

        if (Permission::check('ADMIN')) {
            return $sites->column('ID');
        }

        $memberGroups = $member->Groups()->column('ID');
        $sites        = $sites->filter("EditorGroups.ID:ExactMatch", $memberGroups);

        return $sites->column('ID');
    }
1235306
public function getRequestedNodes()
    {
        $dh = $this->getSitemapDataProvider();
        if ($this->cookieJar->has('ConcreteSitemap-expand')) {
            $openNodeArray = explode(',', str_replace('_', '', $this->cookieJar->get('ConcreteSitemap-expand')));
            if (is_array($openNodeArray)) {
                $dh->setExpandedNodes($openNodeArray);
            }
        }
        if (!$this->includeMenuInResponse()) {
            if ($this->request->query->get('reloadSelfNode')) {
                $nodes = [$dh->getNode($this->request->query->get('cID'))];
            } else {
                $nodes = $dh->getSubNodes($this->request->query->get('cParentID'));
            }
        } else {
            $nodes = $dh->getSubNodes($this->getRequestedSiteTree());
        }

        return $nodes;
    }
803227
public function getAllSites()
    {
        Piwik::checkUserHasSuperUserAccess();

        $sites  = $this->getModel()->getAllSites();
        $return = array();
        foreach ($sites as $site) {
            $this->enrichSite($site);
            $return[$site['idsite']] = $site;
        }

        $return = Site::setSitesFromArray($return);

        return $return;
    }
414961
private function getSections() {
		$sections = array();
		foreach (Craft::$app->getSections()->getEditableSections() as $section) {
			$sections[$section->id] = Craft::t('site', $section->name);
		}
		return $sections;
	}
1075129
public function getSiteContributionLanguage()
    {
        $currentLanguage = $this->getSite()['defaultLanguage'];

        $token = $this->tokenStorage->getToken();
        if ($token instanceof TokenInterface) {
            if (($user = $token->getUser()) instanceof UserInterface && $user->hasLanguageBySite($this->getSiteId())) {
                $currentLanguage = $user->getLanguageBySite($this->getSiteId());
            }
        }

        return $currentLanguage;
    }