@param string $sessionName
@param \eZ\Publish\Core\MVC\Symfony\SiteAccess $siteAccess

@return string
356816
private function getSessionName($sessionName, SiteAccess $siteAccess)
    {
        // Add session prefix if needed.
        if (strpos($sessionName, static::SESSION_NAME_PREFIX) !== 0) {
            $sessionName = static::SESSION_NAME_PREFIX . '_' . $sessionName;
        }

        // Check if uniqueness marker is present. If so, session name will be unique for current siteaccess.
        if (strpos($sessionName, self::MARKER) !== false) {
            $sessionName = str_replace(self::MARKER, md5($siteAccess->name), $sessionName);
        }

        return $sessionName;
    }
687767
public function get(
        $root = null,
        $siteId = null,
        $pages = null,
        $pageType = null,
        $pageName = null
    ) {
        if (empty($root)) {
            $root = self::RESOURCE_SITES;
        }

        if (empty($siteId)) {
            return $root;
        }

        if (empty($pages)) {
            return $root . '.' . $siteId;
        }

        if (empty($pageType) || empty($pageName)) {
            return $root . '.' . $siteId . '.' . $pages;
        }

        return $root . '.' . $siteId . '.' . $pages . '.' . $pageType . '.' . $pageName;
    }
501832
public function getPageByName(
        SiteEntity $site,
        $pageName,
        $pageType = PageTypes::NORMAL
    ) {
        $results = $this->getPagesByName(
            $site,
            $pageName,
            $pageType
        );

        if (empty($results)) {
            return null;
        }

        return $results[0];
    }
176797
static function allDesignBases( $siteAccess = false )
    {
        // in memory caching
        if ( $siteAccess )
        {
            if ( isset( $GLOBALS['eZTemplateDesignResourceSiteAccessBases'] ) )
            {
                if ( isset( $GLOBALS['eZTemplateDesignResourceSiteAccessBases'][$siteAccess] ) )
                {
                    return $GLOBALS['eZTemplateDesignResourceSiteAccessBases'][$siteAccess];
                }
            }
            else
            {
                $GLOBALS['eZTemplateDesignResourceSiteAccessBases'] = array();
            }
        }
        else
        {
            if ( isset( $GLOBALS['eZTemplateDesignResourceBases'] ) )
            {
                return $GLOBALS['eZTemplateDesignResourceBases'];
            }
        }

        if ( eZINI::instance( 'site.ini' )->variable( 'DesignSettings', 'DesignLocationCache' ) === 'enabled' )
        {
            // Using current SA if none given
            $siteAccessName = $siteAccess !== false ? $siteAccess : $GLOBALS['eZCurrentAccess']['name'];

            $cachePath = eZSys::cacheDirectory()
                         . '/'
                         . self::DESIGN_BASE_CACHE_NAME
                         . md5( $siteAccessName )
                         . '.php';

            $clusterFileHandler = eZClusterFileHandler::instance( $cachePath );

            if( $clusterFileHandler->fileExists( $cachePath ) )
            {
                $designBaseList = unserialize( $clusterFileHandler->fetchContents() );

                self::savesMemoryCache( $designBaseList, $siteAccess );
            }
            else
            {
                // find design locations
                $designBaseList = self::findDesignBase( eZINI::instance( 'file.ini' ), $siteAccess );

                // stores it on the disk
                $clusterFileHandler->fileStoreContents( $cachePath,
                                                        serialize( $designBaseList ),
                                                        'designbases',
                                                        'php' );

                self::savesMemoryCache( $designBaseList, $siteAccess );
            }
        }
        else
        {
            // find design locations
            $designBaseList = self::findDesignBase( eZINI::instance( 'file.ini' ), $siteAccess );

            self::savesMemoryCache( $designBaseList, $siteAccess );
        }

        return $designBaseList;
    }
73494
public function open($savePath, $sessionName)
    {
        if (empty($this->table) || empty($this->database) || empty($this->siteName)) {
            return false;
        }

        return true;
    }
635216
public function siteRedirectListAction(Request $request, Site $site)
    {
        return $this->renderPage('ucms_seo.site_redirect', $request, [
            'base_query' => [
                'site' => $site->getId(),
            ],
        ]);
    }
940276
public function getPagesMenu($menuName, $lang = NULL)
    {
//         $currentUser = $this->securityContext->getToken()->getUser();
//         if ($currentUser != 'anon.')
//         {
//             $roles = $currentUser->getRoles();
//         }
//         else
//         {
//             $roles = array();
//         }
        $pages = $this->doctrine->getRepository('FulgurioLightCMSBundle:PageMenu')->findPagesOfMenu($menuName, $lang);
        $availablePages = array();
        foreach ($pages as &$page)
        {
//             $pageAccesses = $page->getAccess();
//             if (empty($pageAccesses))
//             {
//                 $page->setAllowedChildren($this->doctrine->getRepository('FulgurioLightCMSBundle:Page')->getAllowedChildren($roles, $page));
                $availablePages[] = $page;
//             }
//             else if (is_object($currentUser))
//             {
//                 foreach ($pageAccesses as $pageAccess)
//                 {
//                     if ($currentUser->hasRole($pageAccess))
//                     {
//                         $page->setAllowedChildren($this->doctrine->getRepository('FulgurioLightCMSBundle:Page')->getAllowedChildren($roles, $page));
//                         $availablePages[] = $page;
//                         break;
//                     }
//                 }
//             }
        }
        return $availablePages;
    }
334295
protected function isAdminSiteAccess(Request $request): bool
    {
        return (new IsAdmin($this->siteAccessGroups))->isSatisfiedBy($request->attributes->get('siteaccess'));
    }
1318404
public static function getControllerAccess($controllerClassName)
    {
        try{
            $returnValue = self::getCacheImplementation()->get(self::SERIAL_PREFIX_MODULE.$controllerClassName);
        } catch (\common_cache_Exception $e) {
            
            $extId = MapHelper::getExtensionFromController($controllerClassName);
            $extension = MapHelper::getUriForExtension($extId);
            $module = MapHelper::getUriForController($controllerClassName);
            
            $roleClass = new \core_kernel_classes_Class(GenerisRdf::CLASS_ROLE);
            $accessProperty = new \core_kernel_classes_Property(AccessService::PROPERTY_ACL_GRANTACCESS);

            $returnValue = array('module' => array(), 'actions' => array());
            
            // roles by extensions
            $roles = $roleClass->searchInstances(array(
                    $accessProperty->getUri() => $extension
                ), array(
                    'recursive' => true, 'like' => false
            ));
            foreach ($roles as $grantedRole) {
                $returnValue['module'][] = $grantedRole->getUri();
            }
            
            // roles by controller
            $filters = array(
                $accessProperty->getUri() => $module
            );
            $options = array('recursive' => true, 'like' => false);
            
            foreach ($roleClass->searchInstances($filters, $options) as $grantedRole){
                $returnValue['module'][] = $grantedRole->getUri();
            }
            
            // roles by action
            foreach (ControllerHelper::getActions($controllerClassName) as $actionName) {
                $actionUri = MapHelper::getUriForAction($controllerClassName, $actionName);
                $rolesForAction = $roleClass->searchInstances(array(
                    $accessProperty->getUri() => $actionUri
                ), array('recursive' => true, 'like' => false));
                if (!empty($rolesForAction)) {
                    $actionName = MapHelper::getActionFromUri($actionUri);
                    $returnValue['actions'][$actionName] = array();
                    foreach ($rolesForAction as $roleResource) {
                        $returnValue['actions'][$actionName][] = $roleResource->getUri();
                    }
                }
            }
            
            self::getCacheImplementation()->put($returnValue, self::SERIAL_PREFIX_MODULE.$controllerClassName);
        }
        return $returnValue;
    }
1178595
function createSiteAccessListNode( $options )
    {
        $dom = new DOMDocument( '1.0', 'utf-8' );
        $siteAccessListDOMNode = $dom->createElement( 'site-access-list' );
        $dom->appendChild( $siteAccessListDOMNode );

        foreach( $options['site_access_array'] as $siteAccess )
        {
            unset( $siteAccessNode );
            $siteAccessNode = $dom->createElement( 'site-access' );
            $siteAccessNode->appendChild( $dom->createTextNode( $siteAccess ) );
            $siteAccessListDOMNode->appendChild( $siteAccessNode );
        }

        return $siteAccessListDOMNode;
    }
670263
public function getAvailableSitesSelector(
        $selectorName,
        Site $selectedSite = null
    ) {
        $siteRepository = GeneralUtility::makeInstance(SiteRepository::class);

        $sites = $siteRepository->getAvailableSites();
        $selector = '<select name="' . htmlspecialchars($selectorName) . '" class="form-control">';

        foreach ($sites as $site) {
            $selectedAttribute = '';
            if ($selectedSite !== null && $site->getRootPageId() === $selectedSite->getRootPageId()) {
                $selectedAttribute = ' selected="selected"';
            }

            $selector .= '<option value="' . htmlspecialchars($site->getRootPageId()) . '"' . $selectedAttribute . '>'
                . htmlspecialchars($site->getLabel())
                . '</option>';
        }

        $selector .= '</select>';

        return $selector;
    }
118442
function setSiteAccessList( $contentClassAttribute )
    {
        $config = eZINI::instance( 'site.ini' );
        $siteAccessArray = $config->variable( 'SiteAccessSettings', 'AvailableSiteAccessList' );
        $siteAccessList = 'override';
        foreach ( $siteAccessArray as $idx => $siteAccess )
        {
            $siteAccessList .= ';' . $siteAccess;
        }

        $contentClassAttribute->setAttribute( self::SITE_ACCESS_LIST_FIELD, $siteAccessList );
    }
604886
private function getUserUrl($username)
    {
        $base  = parse_url($this->raw->getSelf(), PHP_URL_HOST);
        $proto = parse_url($this->raw->getSelf(), PHP_URL_SCHEME);

        return sprintf('%s://%s/ViewProfile.jspa?name=%s', $proto, $base, $username);
    }
868793
public function getSessionKey(): ?string
    {
        $cacheKey = 'sessionkey';
        if (!isset(self::$cache[$cacheKey])) {
            $cookies = Internal\Cookies::getList(Internal\Cookies::TYPE_SERVER);
            $cookieKey = '_s';
            $key = isset($cookies[$cookieKey]) ? (string) $cookies[$cookieKey] : '';
            self::$cache[$cacheKey] = strlen((string) $key) > 70 ? $key : null;
        }
        return self::$cache[$cacheKey];
    }
767244
public static function sessionName($name = null)
    {
        if (PHP_SAPI != 'cli') {
            return $name ? session_name($name) : session_name();
        }
        $session_name = HttpCache::$sessionName;
        if ($name && ! static::sessionStarted()) {
            HttpCache::$sessionName = $name;
        }
        return $session_name;
    }
820387
function createDOMNodeFromFile( $filename, $siteAccess, $filetype = false )
    {
        $path = substr( $filename, strpos( $filename, '/', 7 ) );

        $dom = new DOMDocument( '1.0', 'utf-8' );
        $fileDOMNode = $dom->createElement( 'file' );
        $fileDOMNode->setAttribute( 'site-access', $siteAccess );

        if ( $filetype !== false )
        {
            $fileDOMNode->setAttribute( 'file-type', $filetype );
        }

        $dom->appendChild( $fileDOMNode );
        $originalPathNode = $dom->createElement( 'original-path' );
        $originalPathNode->appendChild( $dom->createTextNode( $filename ) );
        $fileDOMNode->appendChild( $originalPathNode );
        $pathNode = $dom->createElement( 'path' );
        $pathNode->appendChild( $dom->createTextNode( $path ) );
        $fileDOMNode->appendChild( $pathNode );

        $destinationPath = $this->Package->path() . '/' .  eZContentObjectPackageHandler::contentObjectDirectory() . '/' . $path;
        eZDir::mkdir( eZDir::dirpath( $destinationPath ),  false,  true );
        eZFileHandler::copy( $filename, $destinationPath );

        return $fileDOMNode;
    }
938512
public static function setApplicationPHPCRSession(Application $application, string $sessionName = null, bool $admin = false)
    {
        $registry = $application->getKernel()->getContainer()->get('doctrine_phpcr');
        $session = $admin ? $registry->getAdminConnection($sessionName) : $registry->getConnection($sessionName);

        $helperSet = $application->getHelperSet();
        if (class_exists(Version::class)) {
            $helperSet->set(new DocumentManagerHelper($session));
        } else {
            $helperSet->set(new PhpcrHelper($session));
        }

        if ($session instanceof JackalopeSession
            && ($session->getTransport() instanceof DbalClient
                || $session->getTransport() instanceof DbalLoggingClient
            )
        ) {
            $helperSet->set(new DoctrineDBALHelper($session->getTransport()->getConnection()));
        }
    }