Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: phpGACL

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class gacl_api

Description

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 /phpgacl/gacl_api.php (line 53)

Class gacl

Class gacl_api
Direct descendents
Class Description
ClassJAuthorization Class that handles all access authorization
Method Summary
Method 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])
Method int add_group (string $value, string $name, [int $parent_id = 0], [string $group_type = 'ARO'])
Method bool add_group_object (int $group_id, string $object_section_value, string $object_value, [string $group_type = 'ARO'])
Method int add_object (string $section_value, string $name, [string $value = 0], [int $order = 0], [int $hidden = 0], [string $object_type = NULL])
Method int add_object_section (string $name, [string $value = 0], [int $order = 0], [int $hidden = 0], [string $object_type = NULL])
Method 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])
Method bool clear_database ()
Method bool consolidated_edit_acl (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, string $return_value)
Method int count_all ([array $arg = NULL])
Method bool del_acl (int $acl_id)
Method bool del_group (int $group_id, [bool $reparent_children = TRUE], [string $group_type = 'ARO'])
Method bool del_group_object (int $group_id, string $object_section_value, string $object_value, [string $group_type = 'ARO'])
Method bool del_object (int $object_id, [string $object_type = NULL], [bool $erase = FALSE])
Method bool del_object_section (int $object_section_id, [string $object_type = NULL], [bool $erase = FALSE])
Method 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])
Method bool edit_group (int $group_id, [string $value = NULL], [string $name = NULL], [int $parent_id = NULL], [string $group_type = 'ARO'])
Method bool edit_object (int $object_id, string $section_value, string $name, [string $value = 0], [int $order = 0], [int $hidden = 0], [string $object_type = NULL])
Method bool edit_object_section (int $object_section_id, string $name, [string $value = 0], [int $order = 0], [int $hidden = 0], [string $object_type = NULL])
Method array format_groups (array $sorted_groups, [array $type = 'TEXT'], [int $root_id = 0], [int $level = 0], [array $formatted_groups = NULL])
Method array get_acl (int $acl_id)
Method array get_group_children (int $group_id, [int $group_type = 'ARO'], [string $recurse = 'NO_RECURSE'])
Method array get_group_data (int $group_id, [string $group_type = 'ARO'])
Method int get_group_id ([string $name = null], [string $group_type = 'ARO'], string 2)
Method array get_group_objects (int $group_id, [string $group_type = 'ARO'], [string $option = 'NO_RECURSE'])
Method int get_group_parent_id (int $id, [string $group_type = 'ARO'])
Method ADORecordSet get_object ([string $section_value = null], [int $return_hidden = 1], [string $object_type = NULL])
Method array get_objects ([string $section_value = NULL], [int $return_hidden = 1], [string $object_type = NULL])
Method array get_object_data (int $object_id, [string $object_type = NULL])
Method array get_object_groups (int $object_id, [string $object_type = 'ARO'], [string $option = 'NO_RECURSE'])
Method int get_object_id (string $section_value, string $value, [string $object_type = NULL])
Method int get_object_section_section_id ([string $name = NULL], [string $value = NULL], [string $object_type = NULL])
Method string get_object_section_value (int $object_id, [string $object_type = NULL])
Method int get_root_group_id ([string $group_type = 'ARO'])
Method string get_schema_version ()
Method array get_ungrouped_objects ([int $return_hidden = 1], [string $object_type = NULL])
Method string get_version ()
Method 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])
Method bool rebuild_tree ([string $group_type = 'ARO'], [int $group_id = NULL], [int $left = 1])
Method 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])
Method 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])
Method void showarray (array $array)
Method array sort_groups ([string $group_type = 'ARO'])
Method int _defaultGenID (string $table)
Method int _rebuild_tree (string $table, int $group_id, [int $left = 1])
Methods
add_acl (line 930)

add_acl()

Add's an ACL. ACO_IDS, ARO_IDS, GROUP_IDS must all be arrays.

  • return: Return ACL ID of new ACL if successful, FALSE otherewise.
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])
  • array $aco_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $aro_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $aro_group_ids: Array of Group IDs
  • array $axo_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $axo_group_ids: Array of Group IDs
  • int $allow: Allow flag
  • int $enabled: Enabled flag
  • string $return_value: Return Value
  • string $note: Note
  • string $section_value: ACL Section Value
  • int $acl_id: ACL ID # Specific Request
add_group (line 1713)

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.

  • return: New Group ID # if successful, FALSE if otherwise.
int add_group (string $value, string $name, int $parent_id, [string $group_type = 'ARO'])
  • string $value: Group Value
  • string $name: Group Name
  • int $parent_id: Parent Group ID #
  • string $group_type: Group Type, either 'ARO' or 'AXO'
add_group_object (line 1916)

add_group_object()

Assigns an Object to a group

  • return: Returns TRUE if successful, FALSE otherwise.
bool add_group_object (int $group_id, string $object_section_value, string $object_value, [string $group_type = 'ARO'])
  • int $group_id: Group ID #
  • string $object_section_value: Object Section Value
  • string $object_value: Object Value
  • string $group_type: Group Type, either 'ARO' or 'AXO'
add_object (line 3004)

add_object()

Inserts a new object

  • return: Returns the ID # of the new object if successful, FALSE otherwise
int add_object (string $section_value, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
  • string $section_value: Object Section Value
  • string $name: Object Name
  • string $value: Object Value
  • int $order: Display Order
  • int $hidden: Hidden Flag, either 1 to hide, or 0 to show.
  • string $object_type: Object Type, either 'ACO', 'ARO', or 'AXO'
add_object_section (line 3512)

add_object_section()

Inserts an object Section

  • return: Object Section ID of new section
int add_object_section (string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
  • string $name: Object Name
  • string $value: Object Value
  • int $order: Display Order
  • int $hidden: Hidden flag, hides section if 1, shows section if 0
  • string $object_type: Object Type, either 'ACO', 'ARO', 'AXO', or 'ACL'
append_acl (line 423)

append_acl()

Appends objects on to a specific ACL.

  • return: TRUE if successful, FALSE otherwise.
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])
  • int $acl_id: ACL ID #
  • array $aro_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $aro_group_ids: Array of Group IDs
  • array $axo_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $axo_group_ids: Array of Group IDs
  • array $aco_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
clear_database (line 3812)

clear_database()

Deletes all data from the phpGACL tables. USE WITH CAUTION.

  • return: Returns TRUE if successful, FALSE otherwise
bool clear_database ()
consolidated_edit_acl (line 159)

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.

  • return: Special boolean return value. See note.
bool consolidated_edit_acl (string $aco_section_value, string $aco_value, string $aro_section_value, string $aro_value, string $return_value)
  • string $aco_section_value: ACO Section Value
  • string $aco_value: ACO Value
  • string $aro_section_value: ARO Section Value
  • string $aro_value: ARO Value
  • string $return_value: Return Value of ACL
count_all (line 87)

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.

  • return: The returned count is a count of all scalar elements found.
int count_all ([array $arg = NULL])
  • array $arg: Array to count
del_acl (line 1206)

del_acl()

Deletes a given ACL

  • return: Returns TRUE if successful, FALSE otherwise.
bool del_acl (int $acl_id)
  • int $acl_id: ACL ID # to delete
del_group (line 2291)

del_group()

deletes a given group

  • return: Returns TRUE if successful, FALSE otherwise.
bool del_group (int $group_id, [bool $reparent_children = TRUE], [string $group_type = 'ARO'])
  • int $group_id: Group ID #
  • bool $reparent_children: If TRUE, child groups of this group will be reparented to the current group's parent.
  • string $group_type: Group Type, either 'ARO' or 'AXO'
del_group_object (line 2008)

del_group_object()

Removes an Object from a group.

  • return: Returns TRUE if successful, FALSE otherwise
bool del_group_object (int $group_id, string $object_section_value, string $object_value, [string $group_type = 'ARO'])
  • int $group_id: Group ID #
  • string $object_section_value: Object Section Value
  • string $object_value: Object Value
  • string $group_type: Group Type, either 'ARO' or 'AXO'
del_object (line 3216)

del_object()

Deletes a given Object and, if instructed to do so, erase all referencing objects

ERASE feature by: Martino Piccinato

  • return: Returns TRUE if successful, FALSE otherwise.
bool del_object (int $object_id, [string $object_type = NULL], [bool $erase = FALSE])
  • int $object_id: Object ID #
  • string $object_type: Object Type, either 'ACO', 'ARO', or 'AXO'
  • bool $erase: Erases all referencing objects if TRUE, leaves them alone otherwise.
del_object_section (line 3721)

del_object_section()

Deletes a given Object Section and, if explicitly asked, all the section objects

ERASE feature by: Martino Piccinato

  • return: Returns TRUE if successful, FALSE otherwise
bool del_object_section (int $object_section_id, [string $object_type = NULL], [bool $erase = FALSE])
  • int $object_section_id: Object Section ID # to delete
  • string $object_type: Object Type, either 'ACO', 'ARO', 'AXO', or 'ACL'
  • bool $erase: Erases all section objects assigned to the section
edit_acl (line 1162)

edit_acl()

Edit's an ACL, ACO_IDS, ARO_IDS, GROUP_IDS must all be arrays.

  • return: Return ACL ID of new ACL if successful, FALSE otherewise.
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])
  • int $acl_id: ACL ID # to edit
  • array $aco_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $aro_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $aro_group_ids: Array of Group IDs
  • array $axo_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $axo_group_ids: Array of Group IDs
  • int $allow: Allow flag
  • int $enabled: Enabled flag
  • string $return_value: Return Value
  • string $note: Note
  • string $section_value: ACL Section Value
edit_group (line 2067)

edit_group()

Edits a group

  • return: Returns TRUE if successful, FALSE otherwise
bool edit_group (int $group_id, [string $value = NULL], [string $name = NULL], [int $parent_id = NULL], [string $group_type = 'ARO'])
  • int $group_id: Group ID #
  • string $value: Group Value
  • string $name: Group Name
  • int $parent_id: Parent ID #
  • string $group_type: Group Type, either 'ARO' or 'AXO'
edit_object (line 3110)

edit_object()

Edits a given Object

  • return: Returns TRUE if successful, FALSE otherwise
bool edit_object (int $object_id, string $section_value, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
  • int $object_id: Object ID #
  • string $section_value: Object Section Value
  • string $name: Object Name
  • string $value: Object Value
  • int $order: Display Order
  • int $hidden: Hidden Flag, either 1 to hide, or 0 to show
  • string $object_type: Object Type, either 'ACO', 'ARO', or 'AXO'
edit_object_section (line 3581)

edit_object_section()

Edits a given Object Section

  • return: Returns TRUE if successful, FALSE otherwise
bool edit_object_section (int $object_section_id, string $name, string $value, int $order, int $hidden, [string $object_type = NULL])
  • int $object_section_id: Object Section ID #
  • string $name: Object Section Name
  • string $value: Object Section Value
  • int $order: Display Order
  • int $hidden: Hidden Flag, hide object section if 1, show if 0
  • string $object_type: Object Type, either 'ACO', 'ARO', 'AXO', or 'ACL'
format_groups (line 1317)

format_groups()

Takes the array returned by sort_groups() and formats for human consumption. Recursively calls itself to produce the desired output.

  • return: Array of formatted text, ordered by group id, formatted according to $type
array format_groups (array $sorted_groups, [array $type = 'TEXT'], int $root_id, int $level, [array $formatted_groups = NULL])
  • array $sorted_groups: Output from gacl_api->sorted_groups($group_type)
  • array $type: Output type desired, either 'TEXT', 'TEXT_ASSOC', 'HTML', 'ARRAY' or 'ASSOC'
  • int $root_id: Root of tree to produce
  • int $level: Current level of depth
  • array $formatted_groups: Pass the current formatted groups object for appending via recursion.
get_acl (line 695)

get_acl()

Grabs ACL data.

  • return:

    Associative Array with the following items:

    • 'aco' => Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
    • 'aro' => Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
    • 'axo' => Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
    • 'aro_groups' => Array of Group IDs
    • 'axo_groups' => Array of Group IDs
    • 'acl_id' => int ACL ID #
    • 'allow' => int Allow flag
    • 'enabled' => int Enabled flag
    • 'return_value' => string Return Value
    • 'note' => string Note

array get_acl (int $acl_id)
  • int $acl_id: ACL ID #
get_group_children (line 1480)

get_group_children()

Gets a groups child IDs

  • return: Array of Child ID's of the referenced group
array get_group_children (int $group_id, [int $group_type = 'ARO'], [string $recurse = 'NO_RECURSE'])
  • int $group_id: Group ID #
  • int $group_type: Group Type, either 'ARO' or 'AXO'
  • string $recurse: Either 'RECURSE' or 'NO_RECURSE', to recurse while fetching group children.
get_group_data (line 1536)

get_group_data()

Gets the group data given the GROUP_ID.

  • return: Returns numerically indexed array with the following columns:
    • array[0] = (int) Group ID #
    • array[1] = (int) Parent Group ID #
    • array[2] = (string) Group Value
    • array[3] = (string) Group Name
    • array[4] = (int) lft MPTT Value
    • array[5] = (int) rgt MPTT Value
array get_group_data (int $group_id, [string $group_type = 'ARO'])
  • int $group_id: Group ID #
  • string $group_type: Group Type, either 'ARO' or 'AXO'
get_group_id (line 1423)

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.

  • return: Returns Group ID if found and Group ID is unique in database, otherwise, returns FALSE
int get_group_id ([string $name = null], [string $group_type = 'ARO'], string 2)
  • string 2: Group Type, either 'ARO' or 'AXO'
  • string $name: Group Value
  • string $group_type: Group Name
get_group_objects (line 1841)

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.

  • return: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
array get_group_objects (int $group_id, [string $group_type = 'ARO'], [string $option = 'NO_RECURSE'])
  • int $group_id: Group ID #
  • string $group_type: Group Type, either 'ARO' or 'AXO'
  • string $option: Option, either 'RECURSE' or 'NO_RECURSE'
get_group_parent_id (line 1578)

get_group_parent_id()

Grabs the parent_id of a given group

  • return: Parent ID of the Group
int get_group_parent_id (int $id, [string $group_type = 'ARO'])
  • int $id: Group ID #
  • string $group_type: Group Type, either 'ARO' or 'AXO'
get_object (line 2539)

get_object()

Grabs all Objects's in the database, or specific to a section_value

  • return: Returns recordset directly, with object ID only selected:
ADORecordSet get_object ([string $section_value = null], [int $return_hidden = 1], [string $object_type = NULL])
  • string $section_value: Filter to this section value
  • int $return_hidden: Returns hidden objects if 1, leaves them out otherwise.
  • string $object_type: Object Type, either 'ACO', 'ARO', 'AXO', or 'ACL'
get_objects (line 2669)

get_objects ()

Grabs all Objects in the database, or specific to a section_value

  • return: Returns objects in format suitable for add_acl and is_conflicting_acl
    • i.e. Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
array get_objects ([string $section_value = NULL], [int $return_hidden = 1], [string $object_type = NULL])
  • string $section_value: Filter for section value
  • int $return_hidden: Returns hidden objects if 1, does not if 0
  • string $object_type: Object Type, either 'ACO', 'ARO', 'AXO'
get_object_data (line 2733)

get_object_data()

Gets all data pertaining to a specific Object.

  • return: Returns 2-Dimensional array of rows with columns = ( section_value, value, order_value, name, hidden )
array get_object_data (int $object_id, [string $object_type = NULL])
  • int $object_id: Object ID #
  • string $object_type: Object Type, either 'ACO', 'ARO', 'AXO'
get_object_groups (line 2936)

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.

  • return: Array of Group ID #'s, or FALSE if Failed
array get_object_groups (int $object_id, [string $object_type = 'ARO'], [string $option = 'NO_RECURSE'])
  • int $object_id: Object ID #
  • string $object_type: Object Type, either 'ARO' or 'AXO'
  • string $option: Option, either 'RECURSE', or 'NO_RECURSE'
get_object_id (line 2793)

get_object_id()

Gets the object_id given the section_value AND value of the object.

  • return: Object ID #
int get_object_id (string $section_value, string $value, [string $object_type = NULL])
  • string $section_value: Object Section Value
  • string $value: Object Value
  • string $object_type: Object Type, either 'ACO', 'ARO', 'AXO'
get_object_section_section_id (line 3432)

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.

  • return: Object Section ID if the object section is found AND is unique, or FALSE otherwise.
int get_object_section_section_id ([string $name = NULL], [string $value = NULL], [string $object_type = NULL])
  • string $name: Object Name
  • string $value: Object Value
  • string $object_type: Object Type, either 'ACO', 'ARO', 'AXO', or 'ACL'
get_object_section_value (line 2864)

get_object_section_value()

Gets the object_section_value given object id

  • return: Object Section Value
string get_object_section_value (int $object_id, [string $object_type = NULL])
  • int $object_id: Object ID #
  • string $object_type: Object Type, either 'ACO', 'ARO', or 'AXO'
get_root_group_id (line 1632)

get_root_group_id ()

Grabs the id of the root group for the specified tree

  • return: Root Group ID #
int get_root_group_id ([string $group_type = 'ARO'])
  • string $group_type: Group Type, either 'ARO' or 'AXO'
get_schema_version (line 125)

get_schema_version()

Grabs phpGACL schema version from the database.

  • return: Schema Version
string get_schema_version ()
get_ungrouped_objects (line 2606)

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.

  • return: Returns an array of object ID's
array get_ungrouped_objects ([int $return_hidden = 1], [string $object_type = NULL])
  • int $return_hidden: Returns hidden objects if 1, does not if 0.
  • string $object_type: Object Type, either 'ARO' or 'AXO' (groupable types)
get_version (line 111)

get_version()

Grabs phpGACL version from the database.

  • return: Version of phpGACL
string get_version ()
is_conflicting_acl (line 790)

is_conflicting_acl()

Checks for conflicts when adding a specific ACL.

  • return: Returns true if conflict is found.
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])
  • array $aco_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $aro_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $aro_group_ids: Array of Group IDs
  • array $axo_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $axo_group_ids: Array of Group IDs
  • array $ignore_acl_ids: Array of ACL IDs to ignore from the result set.
rebuild_tree (line 2191)

rebuild_tree ()

rebuilds the group tree for the given type

  • return: Returns TRUE if successful, FALSE otherwise
bool rebuild_tree ([string $group_type = 'ARO'], [int $group_id = NULL], [int $left = 1])
  • string $group_type: Group Type, either 'ARO' or 'AXO'
  • int $group_id: Group ID #
  • int $left: Left value of Group
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.

  • return: containing ACL IDs if search is successful
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])
  • string $aco_section_value: ACO Section Value
  • string $aco_value: ACO Value
  • string $aro_section_value: ARO Section Value
  • string $aro_value: ARO Value
  • string $aro_group_name: ARO Group Name
  • string $axo_section_value: AXO Section Value
  • string $axo_value: AXO Value
  • string $axo_group_name: AXO Group Name
  • string $return_value: Return Value
shift_acl (line 541)

shift_acl()

Opposite of append_acl(). Removes objects from a specific ACL. (named after PHP's array_shift())

  • return: TRUE if successful, FALSE otherwise.
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])
  • int $acl_id: ACL ID #
  • array $aro_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $aro_group_ids: Array of Group IDs
  • array $axo_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • array $axo_group_ids: Array of Group IDs
  • array $aco_array: Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
showarray (line 69)

showarray()

Dump all contents of an array in HTML (kinda)

void showarray (array $array)
  • array $array
sort_groups (line 1267)

sort_groups()

Grabs all the groups from the database doing preliminary grouping by parent

  • return: Returns 2-Dimensional array: $array[<parent_id>][<group_id>] = <group_name>
array sort_groups ([string $group_type = 'ARO'])
  • string $group_type: Group Type, either 'ARO' or 'AXO'
_defaultGenID (line 3856)

Calculates the start number for a sequence table

  • return: The highest id plus one
int _defaultGenID (string $table)
  • string $table: The name of the table
_rebuild_tree (line 2239)

_rebuild_tree ()

Utility recursive function called by rebuild_tree()

  • return: Returns right value of this node + 1
int _rebuild_tree (string $table, int $group_id, [int $left = 1])
  • string $table: Table name of group type
  • int $group_id: Group ID #
  • int $left: Left value of Group

Inherited Methods

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 Mon, 05 Mar 2007 21:04:03 +0000 by phpDocumentor 1.3.1