| 1 | <?php |
| 2 | /** |
| 3 | * File containing (site)access functions |
| 4 | * |
| 5 | * @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved. |
| 6 | * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 |
| 7 | * @version 2011.7 |
| 8 | * @package index |
| 9 | * @deprecated since 4.4, this file and its compatibility functions/constants will be removed |
| 10 | */ |
| 11 | |
| 12 | |
| 13 | /** |
| 14 | * Integer constants that identify the siteaccess matching used |
| 15 | * |
| 16 | * @see eZSiteAccess class constants |
| 17 | * @deprecated Since 4.4 |
| 18 | */ |
| 19 | define( 'EZ_ACCESS_TYPE_DEFAULT', 1 ); |
| 20 | define( 'EZ_ACCESS_TYPE_URI', 2 ); |
| 21 | define( 'EZ_ACCESS_TYPE_PORT', 3 ); |
| 22 | define( 'EZ_ACCESS_TYPE_HTTP_HOST', 4 ); |
| 23 | define( 'EZ_ACCESS_TYPE_INDEX_FILE', 5 ); |
| 24 | define( 'EZ_ACCESS_TYPE_STATIC', 6 ); |
| 25 | define( 'EZ_ACCESS_TYPE_SERVER_VAR', 7 ); |
| 26 | define( 'EZ_ACCESS_TYPE_URL', 8 ); |
| 27 | |
| 28 | define( 'EZ_ACCESS_SUBTYPE_PRE', 1 ); |
| 29 | define( 'EZ_ACCESS_SUBTYPE_POST', 2 ); |
| 30 | |
| 31 | /** |
| 32 | * Goes trough the access matching rules and returns the access match. |
| 33 | * The returned match is an associative array with: |
| 34 | * name => string Name of the siteaccess (same as folder name) |
| 35 | * type => int The constant that represent the matching used |
| 36 | * uri_part => array(string) List of path elements that was used in start of url for the match |
| 37 | * |
| 38 | * @see eZSiteAccess::match() |
| 39 | * @deprecated Since 4.4 |
| 40 | * @param eZURI $uri |
| 41 | * @param string $host |
| 42 | * @param string(numeric) $port |
| 43 | * @param string $file Example '/index.php' |
| 44 | * @return array |
| 45 | */ |
| 46 | function accessType( eZURI $uri, $host, $port, $file ) |
| 47 | { |
| 48 | eZDebug::writeStrict( 'Function accessType() has been deprecated in 4.4 in favor of eZSiteAccess::match()', 'Deprecation' ); |
| 49 | return eZSiteAccess::match( $uri, $host, $port, $file ); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Changes the site access to what's defined in $access. It will change the |
| 54 | * access path in eZSys and prepend an override dir to eZINI |
| 55 | * |
| 56 | * @see eZSiteAccess::change() |
| 57 | * @deprecated Since 4.4 |
| 58 | * @param array $access An associative array with 'name' (string), 'type' (int) and 'uri_part' (array). |
| 59 | * @return array The $access parameter |
| 60 | */ |
| 61 | function changeAccess( array $access ) |
| 62 | { |
| 63 | eZDebug::writeStrict( 'Function changeAccess() has been deprecated in 4.4 in favor of eZSiteAccess::change()', 'Deprecation' ); |
| 64 | return eZSiteAccess::change( $access ); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Match a regex expression |
| 69 | * |
| 70 | * @see eZSiteAccess::matchRegexp() |
| 71 | * @deprecated Since 4.4 |
| 72 | * @param string $text |
| 73 | * @param string $reg |
| 74 | * @param int $num |
| 75 | * @return string|null |
| 76 | */ |
| 77 | function accessMatchRegexp( &$text, $reg, $num ) |
| 78 | { |
| 79 | eZDebug::writeStrict( 'Function accessMatchRegexp() has been deprecated in 4.4 in favor of eZSiteAccess::matchRegexp()', 'Deprecation' ); |
| 80 | return eZSiteAccess::matchRegexp( $text, $reg, $num ); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Match a text string with pre or/or post text strings |
| 85 | * |
| 86 | * @see eZSiteAccess::matchText() |
| 87 | * @deprecated Since 4.4 |
| 88 | * @param string $text |
| 89 | * @param string $match_pre |
| 90 | * @param string $match_post |
| 91 | * @return string|null |
| 92 | */ |
| 93 | function accessMatchText( &$text, $match_pre, $match_post ) |
| 94 | { |
| 95 | eZDebug::writeStrict( 'Function accessMatchText() has been deprecated in 4.4 in favor of eZSiteAccess::matchText()', 'Deprecation' ); |
| 96 | return eZSiteAccess::matchText( $text, $match_pre, $match_post ); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Checks if site access debug is enabled |
| 101 | * |
| 102 | * @see eZSiteAccess::debugEnabled() |
| 103 | * @deprecated Since 4.4 |
| 104 | * @return bool |
| 105 | */ |
| 106 | function accessDebugEnabled() |
| 107 | { |
| 108 | return eZSiteAccess::debugEnabled(); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Checks if extra site access debug is enabled |
| 113 | * |
| 114 | * @see eZSiteAccess::extraDebugEnabled() |
| 115 | * @deprecated Since 4.4 |
| 116 | * @return bool |
| 117 | */ |
| 118 | function accessExtraDebugEnabled() |
| 119 | { |
| 120 | return eZSiteAccess::extraDebugEnabled(); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Checks if access is allowed to a module/view based on site.ini[SiteAccessRules]Rules settings |
| 125 | * |
| 126 | * @see eZModule::accessAllowed() |
| 127 | * @deprecated Since 4.4 |
| 128 | * @param eZURI $uri |
| 129 | * @return array An associative array with: |
| 130 | * 'result' => bool Indicates if access is allowed |
| 131 | * 'module' => string Module name |
| 132 | * 'view' => string View name |
| 133 | * 'view_checked' => bool Indicates if view access has been checked |
| 134 | */ |
| 135 | function accessAllowed( eZURI $uri ) |
| 136 | { |
| 137 | eZDebug::writeStrict( 'Function accessAllowed() has been deprecated in 4.4 in favor of eZModule::accessAllowed()', 'Deprecation' ); |
| 138 | return eZModule::accessAllowed( $uri ); |
| 139 | } |
| 140 | |
| 141 | ?> |
| 142 | |