Support Joomla!

Packages

Package: phpGACL

License

Content on this site is copyright © 2005 - 2008 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

 Class gacl

Description

phpGACL main class

Class gacl should be used in applications where only querying the phpGACL database is required.

Located in /phpgacl/gacl.php (line 51)

Class gacl
Direct descendents
Class Description
Classgacl_api gacl_api Extended API Class
Variable Summary
Variable string $_cache_dir
Variable boolean $_caching
Variable object An $_db
Variable string $_db_host
Variable string $_db_name
Variable string $_db_password
Variable string $_db_type
Variable string $_db_user
Variable boolean $_debug
Variable mixed $_debugLog
Method Summary
Constructor gacl gacl ([array $options = NULL])
Method boolean acl_check (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, [string $axo_section_value = NULL], [string $axo_value = NULL], [integer $root_aro_group = NULL], [integer $root_axo_group = NULL])
Method mixed acl_check_array (string $aco_section_value, string $aco_value, array $aro_array)
Method void acl_get_groups (string $section_value, string $value, [integer $root_group = NULL], [string $group_type = 'ARO'])
Method array acl_query (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, [string $axo_section_value = NULL], [string $axo_value = NULL], [string $root_aro_group = NULL], [string $root_axo_group = NULL], [boolean $debug = NULL])
Method string acl_return_value (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, [string $axo_section_value = NULL], [string $axo_value = NULL], [integer $root_aro_group = NULL], [integer $root_axo_group = NULL])
Method string debug_db ([string $function_name = ''])
Method boolean debug_text (string $text)
Method mixed get_cache (string $cache_id)
Method void put_cache (mixed $data, string $cache_id)
Variables
string $_cache_dir = '/tmp/phpgacl_cache' (line 99)
  • var: The directory for cache file to eb written (ensure write permission are set)
int $_cache_expire_time = 600 (line 102)
  • var: The time for the cache to expire in seconds - 600 == Ten Minutes
boolean $_caching = FALSE (line 93)
  • var: Caches queries if true
object An $_db = '' (line 85)
  • var: ADODB database connector object
string $_db_host = 'localhost' (line 73)
  • var: The database server
string $_db_name = 'gacl' (line 82)
  • var: The database name
string $_db_password = '' (line 79)
  • var: The database user password
string $_db_table_prefix = '' (line 67)
  • var: Prefix for all the phpgacl tables in the database
string $_db_type = 'mysql' (line 70)
  • var: The database type, based on available ADODB connectors - mysql, postgres7, sybase, oci8po See here for more: http://php.weblogs.com/adodb_manual#driverguide
string $_db_user = 'root' (line 76)
  • var: The database user name
boolean $_debug = FALSE (line 56)
  • var: Enables Debug output if true
mixed $_debugLog = null (line 61)

Joomla usage

boolean $_force_cache_expire = TRUE (line 96)
  • var: Force cache to expire
string $_group_switch = '_group_' (line 105)
  • var: A switch to put acl_check into '_group_' mode
Methods
Constructor gacl (line 111)

Constructor

gacl gacl ([array $options = NULL])
  • array $options: An arry of options to oeverride the class defaults
acl_check (line 217)

Wraps the actual acl_query() function.

It is simply here to return TRUE/FALSE accordingly.

  • return: TRUE if the check succeeds, false if not.
boolean acl_check (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, [string $axo_section_value = NULL], [string $axo_value = NULL], [integer $root_aro_group = NULL], [integer $root_axo_group = NULL])
  • string $aco_section_value: The ACO section value
  • string $aco_value: The ACO value
  • string $aro_section_value: The ARO section value
  • string $aro_value: The ARO section
  • string $axo_section_value: The AXO section value (optional)
  • string $axo_value: The AXO section value (optional)
  • integer $root_aro_group: The group id of the ARO ??Mike?? (optional)
  • integer $root_axo_group: The group id of the AXO ??Mike?? (optional)

Redefined in descendants as:
acl_check_array (line 250)

Handles ACL lookups over arrays of AROs

  • return: The same data format as inputted.
mixed acl_check_array (string $aco_section_value, string $aco_value, array $aro_array)
  • string $aco_section_value: The ACO section value
  • string $aco_value: The ACO value
  • array $aro_array: An named array of arrays, each element in the format aro_section_value=>array(aro_value1,aro_value1,...)
acl_get_groups (line 497)

Grabs all groups mapped to an ARO. You can also specify a root_group for subtree'ing.

void acl_get_groups (string $section_value, string $value, [integer $root_group = NULL], [string $group_type = 'ARO'])
  • string $section_value: The section value or the ARO or ACO
  • string $value: The value of the ARO or ACO
  • integer $root_group: The group id of the group to start at (optional)
  • string $group_type: The type of group, either ARO or AXO (optional)
acl_query (line 293)

The Main function that does the actual ACL lookup.

  • return: Returns as much information as possible about the ACL so other functions can trim it down and omit unwanted data.
array acl_query (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, [string $axo_section_value = NULL], [string $axo_value = NULL], [string $root_aro_group = NULL], [string $root_axo_group = NULL], [boolean $debug = NULL])
  • string $aco_section_value: The ACO section value
  • string $aco_value: The ACO value
  • string $aro_section_value: The ARO section value
  • string $aro_value: The ARO section
  • string $axo_section_value: The AXO section value (optional)
  • string $axo_value: The AXO section value (optional)
  • string $root_aro_group: The value of the ARO group (optional)
  • string $root_axo_group: The value of the AXO group (optional)
  • boolean $debug: Debug the operation if true (optional)
acl_return_value (line 237)

Wraps the actual acl_query() function.

Quick access to the return value of an ACL.

  • return: The return value of the ACL
string acl_return_value (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, [string $axo_section_value = NULL], [string $axo_value = NULL], [integer $root_aro_group = NULL], [integer $root_axo_group = NULL])
  • string $aco_section_value: The ACO section value
  • string $aco_value: The ACO value
  • string $aro_section_value: The ARO section value
  • string $aro_value: The ARO section
  • string $axo_section_value: The AXO section value (optional)
  • string $axo_value: The AXO section value (optional)
  • integer $root_aro_group: The group id of the ARO (optional)
  • integer $root_axo_group: The group id of the AXO (optional)
debug_db (line 195)

Prints database debug text if debug is enabled.

  • return: Returns an error message
string debug_db ([string $function_name = ''])
  • string $function_name: The name of the function calling this method
debug_text (line 176)

Prints debug text if debug is enabled.

  • return: Always returns true
boolean debug_text (string $text)
  • string $text: THe text to output
get_cache (line 596)

Uses PEAR's Cache_Lite package to grab cached arrays, objects, variables etc...

using unserialize() so it can handle more then just text string.

  • return: The cached object, otherwise FALSE if the object identifier was not found
mixed get_cache (string $cache_id)
  • string $cache_id: The id of the cached object
put_cache (line 615)

Uses PEAR's Cache_Lite package to write cached arrays, objects, variables etc...

using serialize() so it can handle more then just text string.

void put_cache (mixed $data, string $cache_id)
  • mixed $data: A variable to cache
  • string $cache_id: The id of the cached variable

Documentation generated on Sat, 14 Nov 2009 11:13:30 +0000 by phpDocumentor 1.3.1