eZ Publish  [trunk]
access.php
Go to the documentation of this file.
00001 <?php
00002 /**
00003  * File containing (site)access functions
00004  *
00005  * @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
00006  * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
00007  * @version //autogentag//
00008  * @package index
00009  * @deprecated since 4.4, this file and its compatibility functions/constants will be removed
00010  */
00011 
00012 
00013 /**
00014  * Integer constants that identify the siteaccess matching used
00015  *
00016  * @see eZSiteAccess class constants
00017  * @deprecated Since 4.4
00018  */
00019 define( 'EZ_ACCESS_TYPE_DEFAULT', 1 );
00020 define( 'EZ_ACCESS_TYPE_URI', 2 );
00021 define( 'EZ_ACCESS_TYPE_PORT', 3 );
00022 define( 'EZ_ACCESS_TYPE_HTTP_HOST', 4 );
00023 define( 'EZ_ACCESS_TYPE_INDEX_FILE', 5 );
00024 define( 'EZ_ACCESS_TYPE_STATIC', 6 );
00025 define( 'EZ_ACCESS_TYPE_SERVER_VAR', 7 );
00026 define( 'EZ_ACCESS_TYPE_URL', 8 );
00027 
00028 define( 'EZ_ACCESS_SUBTYPE_PRE', 1 );
00029 define( 'EZ_ACCESS_SUBTYPE_POST', 2 );
00030 
00031 /**
00032  * Goes trough the access matching rules and returns the access match.
00033  * The returned match is an associative array with:
00034  *  name     => string Name of the siteaccess (same as folder name)
00035  *  type     => int The constant that represent the matching used
00036  *  uri_part => array(string) List of path elements that was used in start of url for the match
00037  *
00038  * @see eZSiteAccess::match()
00039  * @deprecated Since 4.4
00040  * @param eZURI $uri
00041  * @param string $host
00042  * @param string(numeric) $port
00043  * @param string $file Example '/index.php'
00044  * @return array
00045  */
00046 function accessType( eZURI $uri, $host, $port, $file )
00047 {
00048     eZDebug::writeStrict( 'Function accessType() has been deprecated in 4.4 in favor of eZSiteAccess::match()', 'Deprecation' );
00049     return eZSiteAccess::match( $uri, $host, $port, $file );
00050 }
00051 
00052 /**
00053  * Changes the site access to what's defined in $access. It will change the
00054  * access path in eZSys and prepend an override dir to eZINI
00055  *
00056  * @see eZSiteAccess::change()
00057  * @deprecated Since 4.4
00058  * @param array $access An associative array with 'name' (string), 'type' (int) and 'uri_part' (array).
00059  * @return array The $access parameter
00060  */
00061 function changeAccess( array $access )
00062 {
00063     eZDebug::writeStrict( 'Function changeAccess() has been deprecated in 4.4 in favor of eZSiteAccess::change()', 'Deprecation' );
00064     return eZSiteAccess::change( $access );
00065 }
00066 
00067 /**
00068  * Match a regex expression
00069  *
00070  * @see eZSiteAccess::matchRegexp()
00071  * @deprecated Since 4.4
00072  * @param string $text
00073  * @param string $reg
00074  * @param int $num
00075  * @return string|null
00076  */
00077 function accessMatchRegexp( &$text, $reg, $num )
00078 {
00079     eZDebug::writeStrict( 'Function accessMatchRegexp() has been deprecated in 4.4 in favor of eZSiteAccess::matchRegexp()', 'Deprecation' );
00080     return eZSiteAccess::matchRegexp( $text, $reg, $num );
00081 }
00082 
00083 /**
00084  * Match a text string with pre or/or post text strings
00085  *
00086  * @see eZSiteAccess::matchText()
00087  * @deprecated Since 4.4
00088  * @param string $text
00089  * @param string $match_pre
00090  * @param string $match_post
00091  * @return string|null
00092  */
00093 function accessMatchText( &$text, $match_pre, $match_post )
00094 {
00095     eZDebug::writeStrict( 'Function accessMatchText() has been deprecated in 4.4 in favor of eZSiteAccess::matchText()', 'Deprecation' );
00096     return eZSiteAccess::matchText( $text, $match_pre, $match_post );
00097 }
00098 
00099 /**
00100  * Checks if site access debug is enabled
00101  *
00102  * @see eZSiteAccess::debugEnabled()
00103  * @deprecated Since 4.4
00104  * @return bool
00105  */
00106 function accessDebugEnabled()
00107 {
00108     return eZSiteAccess::debugEnabled();
00109 }
00110 
00111 /**
00112  * Checks if extra site access debug is enabled
00113  *
00114  * @see eZSiteAccess::extraDebugEnabled()
00115  * @deprecated Since 4.4
00116  * @return bool
00117  */
00118 function accessExtraDebugEnabled()
00119 {
00120     return eZSiteAccess::extraDebugEnabled();
00121 }
00122 
00123 /**
00124  * Checks if access is allowed to a module/view based on site.ini[SiteAccessRules]Rules settings
00125  *
00126  * @see eZModule::accessAllowed()
00127  * @deprecated Since 4.4
00128  * @param eZURI $uri
00129  * @return array An associative array with:
00130  *   'result'       => bool   Indicates if access is allowed
00131  *   'module'       => string Module name
00132  *   'view'         => string View name
00133  *   'view_checked' => bool   Indicates if view access has been checked
00134  */
00135 function accessAllowed( eZURI $uri )
00136 {
00137     eZDebug::writeStrict( 'Function accessAllowed() has been deprecated in 4.4 in favor of eZModule::accessAllowed()', 'Deprecation' );
00138     return eZModule::accessAllowed( $uri );
00139 }
00140 
00141 ?>