Class gacl

Description

phpGACL main class

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

Located in /gacl.class.php (line 50)


	
			
Direct descendents
Class Description
 class gacl_api gacl_api Extended API Class
Variable Summary
 mixed $config_file
 string $_cache_dir
 boolean $_caching
 object An $_db
 string $_db_host
 string $_db_name
 string $_db_password
 string $_db_type
 string $_db_user
 boolean $_debug
Method Summary
 gacl gacl ([array $options = NULL])
 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])
 mixed acl_check_array (string $aco_section_value, string $aco_value, array $aro_array)
 void acl_get_groups (string $section_value, string $value, [integer $root_group = NULL], [string $group_type = 'ARO'])
 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 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 debug_db ([string $function_name = ''])
 boolean debug_text (string $text)
 mixed get_cache (string $cache_id)
 void put_cache (mixed $data, string $cache_id)
Variables
mixed $config_file = './gacl.ini.php' (line 54)
string $_cache_dir = '/tmp/phpgacl_cache' (line 98)
  • var: The directory for cache file to eb written (ensure write permission are set)
int $_cache_expire_time = 600 (line 101)
  • var: The time for the cache to expire in seconds - 600 == Ten Minutes
boolean $_caching = FALSE (line 92)
  • var: Caches queries if true
object An $_db = '' (line 84)
  • var: ADODB database connector object
string $_db_host = 'localhost' (line 72)
  • var: The database server
string $_db_name = 'gacl' (line 81)
  • var: The database name
string $_db_password = '' (line 78)
  • var: The database user password
string $_db_table_prefix = '' (line 66)
  • var: Prefix for all the phpgacl tables in the database
string $_db_type = 'mysql' (line 69)
  • 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 75)
  • var: The database user name
boolean $_debug = FALSE (line 60)
  • var: Enables Debug output if true
boolean $_force_cache_expire = TRUE (line 95)
  • var: Force cache to expire
string $_group_switch = '_group_' (line 104)
  • var: A switch to put acl_check into '_group_' mode
Methods
Constructor gacl (line 110)

Constructor

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

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)
acl_check_array (line 252)

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 482)

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 295)

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 239)

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 197)

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 183)

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 568)

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 587)

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 Sun, 03 Sep 2006 16:23:42 -0700 by phpDocumentor 1.3.0RC3