gacl/docs/phpdoc/phpGACL/gacl_api.html
Description
Description | Vars | Methods (details)
gacl_api Extended API Class
Class gacl_api should be used for applications that must interface directly with phpGACL's data structures, objects, and rules.
Located in /gacl_api.class.php (line 50)
[gacl](../phpGACL/gacl.html)|
--gacl_api
Method Summary
Description | Vars | Methods (details)
booladd_acl (array $aco_array, array $aro_array, [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [int $allow = 1], [int $enabled = 1], [string $return_value = NULL], [string $note = NULL], [string $section_value = NULL], [int $acl_id = FALSE])
intadd_group (string $value, string $name, int $parent_id, [string $group_type = 'ARO'])
booladd_group_object (int $group_id, string $object_section_value, string $object_value, [string $group_type = 'ARO'])
intadd_object (string $section_value, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
intadd_object_section (string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
boolappend_acl (int $acl_id, [array $aro_array = NULL], [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [array $aco_array = NULL])
boolclear_database ()
boolconsolidated_edit_acl (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, string $return_value)
intcount_all ([array $arg = NULL])
booldel_acl (int $acl_id)
booldel_group (int $group_id, [bool $reparent_children = TRUE], [string $group_type = 'ARO'])
booldel_group_object (int $group_id, string $object_section_value, string $object_value, [string $group_type = 'ARO'])
booldel_object (int $object_id, [string $object_type = NULL], [bool $erase = FALSE])
booldel_object_section (int $object_section_id, [string $object_type = NULL], [bool $erase = FALSE])
booledit_acl (int $acl_id, array $aco_array, array $aro_array, [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [int $allow = 1], [int $enabled = 1], [string $return_value = NULL], [string $note = NULL], [string $section_value = NULL])
booledit_group (int $group_id, [string $value = NULL], [string $name = NULL], [int $parent_id = NULL], [string $group_type = 'ARO'])
booledit_object (int $object_id, string $section_value, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
booledit_object_section (int $object_section_id, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
arrayformat_groups (array $sorted_groups, [array $type = 'TEXT'], int $root_id, int $level, [array $formatted_groups = NULL])
boolget_acl (int $acl_id)
arrayget_group_children (int $group_id, [int $group_type = 'ARO'], [string $recurse = 'NO_RECURSE'])
arrayget_group_data (int $group_id, [string $group_type = 'ARO'])
intget_group_id ([string $value = NULL], [string $name = NULL], [string $group_type = 'ARO'])
arrayget_group_objects (int $group_id, [string $group_type = 'ARO'], [string $option = 'NO_RECURSE'])
intget_group_parent_id (int $id, [string $group_type = 'ARO'])
ADORecordSetget_object ([string $section_value = null], [int $return_hidden = 1], [string $object_type = NULL])
arrayget_objects ([string $section_value = NULL], [int $return_hidden = 1], [string $object_type = NULL])
arrayget_object_data (int $object_id, [string $object_type = NULL])
arrayget_object_groups (int $object_id, [string $object_type = 'ARO'], [string $option = 'NO_RECURSE'])
intget_object_id (string $section_value, string $value, [string $object_type = NULL])
intget_object_section_section_id ([string $name = NULL], [string $value = NULL], [string $object_type = NULL])
stringget_object_section_value (int $object_id, [string $object_type = NULL])
intget_root_group_id ([string $group_type = 'ARO'])
stringget_schema_version ()
arrayget_section_data (string $section_value, [string $object_type = NULL])
arrayget_ungrouped_objects ([int $return_hidden = 1], [string $object_type = NULL])
stringget_version ()
boolis_conflicting_acl (array $aco_array, array $aro_array, [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [array $ignore_acl_ids = NULL])
boolrebuild_tree ([string $group_type = 'ARO'], [int $group_id = NULL], [int $left = 1])
arraysearch_acl ([string $aco_section_value = NULL], [string $aco_value = NULL], [string $aro_section_value = NULL], [string $aro_value = NULL], [string $aro_group_name = NULL], [string $axo_section_value = NULL], [string $axo_value = NULL], [string $axo_group_name = NULL], [string $return_value = NULL])
boolshift_acl (int $acl_id, [array $aro_array = NULL], [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [array $aco_array = NULL])
voidshowarray (array $array)
arraysort_groups ([string $group_type = 'ARO'])
int_rebuild_tree (string $table, int $group_id, [int $left = 1])
Variables
Description | Vars (details) | Methods (details)
Inherited from gacl
gacl::$config_file
gacl::$_cache_dir
gacl::$_cache_expire_time
gacl::$_caching
gacl::$_db
gacl::$_db_host
gacl::$_db_name
gacl::$_db_password
gacl::$_db_table_prefix
gacl::$_db_type
gacl::$_db_user
gacl::$_debug
gacl::$_force_cache_expire
gacl::$_group_switch
Methods
Description | VarsMethods (details)
add_acl (line 921)
add_acl()
Add's an ACL. ACO_IDS, ARO_IDS, GROUP_IDS must all be arrays.
bool add_acl (array $aco_array, array $aro_array, [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [int $allow = 1], [int $enabled = 1], [string $return_value = NULL], [string $note = NULL], [string $section_value = NULL], [int $acl_id = FALSE])
add_group (line 1684)
add_group()
Inserts a group, defaults to be on the "root" branch.
Since v3.3.x you can only create one group with Parent_ID=0 So, its a good idea to create a "Virtual Root" group with Parent_ID=0 Then assign other groups to that.
int add_group (string $value, string $name, int $parent_id, [string $group_type = 'ARO'])
add_group_object (line 1878)
add_group_object()
Assigns an Object to a group
bool add_group_object (int $group_id, string $object_section_value, string $object_value, [string $group_type = 'ARO'])
add_object (line 2951)
add_object()
Inserts a new object
int add_object (string $section_value, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
add_object_section (line 3429)
add_object_section()
Inserts an object Section
int add_object_section (string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
append_acl (line 413)
append_acl()
Appends objects on to a specific ACL.
bool append_acl (int $acl_id, [array $aro_array = NULL], [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [array $aco_array = NULL])
clear_database (line 3782)
clear_database()
Deletes all data from the phpGACL tables. USE WITH CAUTION.
bool clear_database ()
consolidated_edit_acl (line 156)
consolidated_edit_acl()
Add's an ACL but checks to see if it can consolidate it with another one first.
This ONLY works with ACO's and ARO's. Groups, and AXO are excluded. As well this function is designed for handling ACLs with return values, and consolidating on the return_value, in hopes of keeping the ACL count to a minimum.
A return value of false must _always_ be handled outside this function. As this function will remove AROs from ACLs and return false, in most cases you will need to a create a completely new ACL on a false return.
bool consolidated_edit_acl (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, string $return_value)
count_all (line 84)
count_all()
Recursively counts elements in an array and sub-arrays.
This is different from count($arg, COUNT_RECURSIVE) in PHP >= 4.2.0, which includes sub-arrays in the count.
int count_all ([array $arg = NULL])
del_acl (line 1189)
del_acl()
Deletes a given ACL
bool del_acl (int $acl_id)
del_group (line 2248)
del_group()
deletes a given group
bool del_group (int $group_id, [bool $reparent_children = TRUE], [string $group_type = 'ARO'])
del_group_object (line 1965)
del_group_object()
Removes an Object from a group.
bool del_group_object (int $group_id, string $object_section_value, string $object_value, [string $group_type = 'ARO'])
del_object (line 3144)
del_object()
Deletes a given Object and, if instructed to do so, erase all referencing objects
ERASE feature by: Martino Piccinato
bool del_object (int $object_id, [string $object_type = NULL], [bool $erase = FALSE])
del_object_section (line 3635)
del_object_section()
Deletes a given Object Section and, if explicitly asked, all the section objects
ERASE feature by: Martino Piccinato
bool del_object_section (int $object_section_id, [string $object_type = NULL], [bool $erase = FALSE])
edit_acl (line 1145)
edit_acl()
Edit's an ACL, ACO_IDS, ARO_IDS, GROUP_IDS must all be arrays.
bool edit_acl (int $acl_id, array $aco_array, array $aro_array, [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [int $allow = 1], [int $enabled = 1], [string $return_value = NULL], [string $note = NULL], [string $section_value = NULL])
edit_group (line 2024)
edit_group()
Edits a group
bool edit_group (int $group_id, [string $value = NULL], [string $name = NULL], [int $parent_id = NULL], [string $group_type = 'ARO'])
edit_object (line 3051)
edit_object()
Edits a given Object
bool edit_object (int $object_id, string $section_value, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
edit_object_section (line 3498)
edit_object_section()
Edits a given Object Section
bool edit_object_section (int $object_section_id, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
format_groups (line 1300)
format_groups()
Takes the array returned by sort_groups() and formats for human consumption. Recursively calls itself to produce the desired output.
array format_groups (array $sorted_groups, [array $type = 'TEXT'], int $root_id, int $level, [array $formatted_groups = NULL])
get_acl (line 690)
get_acl()
Grabs ACL data.
FALSE if not found, or Associative Array with the following items:
bool get_acl (int $acl_id)
get_group_children (line 1457)
get_group_children()
Gets a groups child IDs
array get_group_children (int $group_id, [int $group_type = 'ARO'], [string $recurse = 'NO_RECURSE'])
get_group_data (line 1507)
get_group_data()
Gets the group data given the GROUP_ID.
array get_group_data (int $group_id, [string $group_type = 'ARO'])
get_group_id (line 1394)
get_group_id()
Gets the group_id given the name or value.
Will only return one group id, so if there are duplicate names, it will return false.
int get_group_id ([string $value = NULL], [string $name = NULL], [string $group_type = 'ARO'])
get_group_objects (line 1812)
get_group_objects()
Gets all objects assigned to a group.
If $option == 'RECURSE' it will get all objects in child groups as well. defaults to omit child groups.
array get_group_objects (int $group_id, [string $group_type = 'ARO'], [string $option = 'NO_RECURSE'])
get_group_parent_id (line 1549)
get_group_parent_id()
Grabs the parent_id of a given group
int get_group_parent_id (int $id, [string $group_type = 'ARO'])
get_object (line 2496)
get_object()
Grabs all Objects's in the database, or specific to a section_value
ADORecordSet get_object ([string $section_value = null], [int $return_hidden = 1], [string $object_type = NULL])
get_objects (line 2623)
get_objects ()
Grabs all Objects in the database, or specific to a section_value
array get_objects ([string $section_value = NULL], [int $return_hidden = 1], [string $object_type = NULL])
get_object_data (line 2687)
get_object_data()
Gets all data pertaining to a specific Object.
array get_object_data (int $object_id, [string $object_type = NULL])
get_object_groups (line 2890)
get_object_groups()
Gets all groups an object is a member of.
If $option == 'RECURSE' it will get all ancestor groups. defaults to only get direct parents.
array get_object_groups (int $object_id, [string $object_type = 'ARO'], [string $option = 'NO_RECURSE'])
get_object_id (line 2747)
get_object_id()
Gets the object_id given the section_value AND value of the object.
int get_object_id (string $section_value, string $value, [string $object_type = NULL])
get_object_section_section_id (line 3349)
get_object_section_section_id()
Gets the object_section_id given the name AND/OR value of the section.
Will only return one section id, so if there are duplicate names it will return false.
int get_object_section_section_id ([string $name = NULL], [string $value = NULL], [string $object_type = NULL])
get_object_section_value (line 2818)
get_object_section_value()
Gets the object_section_value given object id
string get_object_section_value (int $object_id, [string $object_type = NULL])
get_root_group_id (line 1603)
get_root_group_id ()
Grabs the id of the root group for the specified tree
int get_root_group_id ([string $group_type = 'ARO'])
get_schema_version (line 122)
get_schema_version()
Grabs phpGACL schema version from the database.
string get_schema_version ()
get_section_data (line 3731)
get_section_data()
Gets the section data given the Section Value
array get_section_data (string $section_value, [string $object_type = NULL])
get_ungrouped_objects (line 2563)
get_ungrouped_objects()
Grabs ID's of all Objects (ARO's and AXO's only) in the database not assigned to a Group.
This function is useful for applications that synchronize user databases with an outside source. If syncrhonization doesn't automatically place users in an appropriate group, this function can quickly identify them so that they can be assigned to the correct group.
array get_ungrouped_objects ([int $return_hidden = 1], [string $object_type = NULL])
get_version (line 108)
get_version()
Grabs phpGACL version from the database.
string get_version ()
is_conflicting_acl (line 789)
is_conflicting_acl()
Checks for conflicts when adding a specific ACL.
bool is_conflicting_acl (array $aco_array, array $aro_array, [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [array $ignore_acl_ids = NULL])
rebuild_tree (line 2148)
rebuild_tree ()
rebuilds the group tree for the given type
bool rebuild_tree ([string $group_type = 'ARO'], [int $group_id = NULL], [int $left = 1])
search_acl (line 323)
search_acl()
Searches for ACL's with specified objects mapped to them.
NULL values are included in the search, if you want to ignore for instance aro_groups use FALSE instead of NULL.
array search_acl ([string $aco_section_value = NULL], [string $aco_value = NULL], [string $aro_section_value = NULL], [string $aro_value = NULL], [string $aro_group_name = NULL], [string $axo_section_value = NULL], [string $axo_value = NULL], [string $axo_group_name = NULL], [string $return_value = NULL])
shift_acl (line 533)
shift_acl()
Opposite of append_acl(). Removes objects from a specific ACL. (named after PHP's array_shift())
bool shift_acl (int $acl_id, [array $aro_array = NULL], [array $aro_group_ids = NULL], [array $axo_array = NULL], [array $axo_group_ids = NULL], [array $aco_array = NULL])
showarray (line 66)
showarray()
Dump all contents of an array in HTML (kinda)
void showarray (array $array)
sort_groups (line 1250)
sort_groups()
Grabs all the groups from the database doing preliminary grouping by parent
array sort_groups ([string $group_type = 'ARO'])
_rebuild_tree (line 2196)
_rebuild_tree ()
Utility recursive function called by rebuild_tree()
int _rebuild_tree (string $table, int $group_id, [int $left = 1])
Inherited From gacl
gacl::gacl()
gacl::acl_check()
gacl::acl_check_array()
gacl::acl_get_groups()
gacl::acl_query()
gacl::acl_return_value()
gacl::debug_db()
gacl::debug_text()
gacl::get_cache()
gacl::put_cache()
Documentation generated on Sun, 03 Sep 2006 16:23:44 -0700 by phpDocumentor 1.3.0RC3