[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/classes/ -> ezsiteaccess.php (source)

   1  <?php
   2  //
   3  // Definition of eZSiteAccess class
   4  //
   5  // Created on: <22-ñÎ×-2003 16:23:14 sp>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezsiteaccess.php
  30  */
  31  
  32  /*!
  33    \class eZSiteAccess ezsiteaccess.php
  34    \brief The class eZSiteAccess does
  35  
  36  */
  37  
  38  include_once ( 'lib/ezutils/classes/ezsys.php' );
  39  
  40  class eZSiteAccess
  41  {
  42      /*!
  43       Constructor
  44      */
  45      function eZSiteAccess()
  46      {
  47      }
  48  
  49      function siteAccessList()
  50      {
  51          include_once ( 'lib/ezutils/classes/ezsys.php' );
  52  
  53          $ini =& eZINI::instance();
  54          $siteAccessArray = $ini->variable( 'SiteAccessSettings', 'AvailableSiteAccessList' );
  55  
  56          $siteAccessList = array();
  57          reset( $siteAccessArray );
  58          foreach ( array_keys( $siteAccessArray ) as $key )
  59          {
  60              $siteAccessItem = array();
  61              $siteAccessItem['name'] =& $siteAccessArray[$key];
  62              $siteAccessItem['id'] = eZSys::ezcrc32( $siteAccessArray[$key] );
  63              $siteAccessList[] = $siteAccessItem;
  64          }
  65          if ( $serversiteaccess = eZSys::serverVariable( $ini->variable( 'SiteAccessSettings', 'ServerVariableName' ), true ) )
  66          {
  67              $siteAccessItem = array();
  68              $siteAccessItem['name'] =& $serversiteaccess;
  69              $siteAccessItem['id'] = eZSys::ezcrc32( $serversiteaccess );
  70              $siteAccessList[] = $siteAccessItem;
  71          }
  72          return $siteAccessList;
  73      }
  74  
  75      /*!
  76         Returns path to \a $siteAccess site access
  77      */
  78      function findPathToSiteAccess( $siteAccess )
  79      {
  80          include_once ( 'lib/ezutils/classes/ezini.php' );
  81          $ini =& eZINI::instance();
  82          $siteAccessList = $ini->variable( 'SiteAccessSettings', 'AvailableSiteAccessList' );
  83          if ( !in_array( $siteAccess, $siteAccessList )  )
  84              return false;
  85  
  86          $currentPath = 'settings/siteaccess/' . $siteAccess;
  87          if ( file_exists( $currentPath ) )
  88              return $currentPath;
  89  
  90          include_once ( 'lib/ezutils/classes/ezextension.php' );
  91          $activeExtensions = eZExtension::activeExtensions();
  92          $baseDir = eZExtension::baseDirectory();
  93          foreach ( $activeExtensions as $extension )
  94          {
  95              $currentPath = $baseDir . '/' . $extension . '/settings/siteaccess/' . $siteAccess;
  96              if ( file_exists( $currentPath ) )
  97                  return $currentPath;
  98          }
  99  
 100          return 'settings/siteaccess/' . $siteAccess;
 101      }
 102  
 103  }
 104  
 105  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7