From 8667f4e9aae04a38734d0e25f0757ec6b318b218 Mon Sep 17 00:00:00 2001 From: bradymiller Date: Thu, 27 Dec 2007 05:25:34 +0000 Subject: [PATCH] Added another acl admin function --- library/acl.inc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/library/acl.inc b/library/acl.inc index d91c4c896..a4409aae9 100644 --- a/library/acl.inc +++ b/library/acl.inc @@ -488,4 +488,26 @@ } return 0; } + + // + // This will return the number of aco objects + // in a specified acl. + // $acl_title = title of acl (string) + // $return_value = return value of acl (string) + // + function acl_count_acos($acl_title, $return_value) { + global $phpgacl_location; + if (isset ($phpgacl_location)) { + include_once("$phpgacl_location/gacl_api.class.php"); + $gacl = new gacl_api(); + $acl_id = $gacl->search_acl(FALSE, FALSE, FALSE, FALSE, $acl_title, FALSE, FALSE, FALSE, $return_value); + $acl_data = $gacl->get_acl($acl_id[0]); + $aco_count = 0; + foreach ($acl_data['aco'] as $key => $value) { + $aco_count = $aco_count + count($acl_data['aco'][$key]); + } + return $aco_count; + } + return 0; + } ?> -- 2.11.4.GIT