2 //First make sure user has access
3 include_once("../../interface/globals.php");
4 include_once("$srcdir/acl.inc");
5 //ensure user has proper access
6 if (!acl_check('admin', 'acl')) {
7 echo xl('ACL Administration Not Authorized');
10 //ensure php is installed
11 if (!isset($phpgacl_location)) {
12 echo xl('php-GACL access controls are turned off');
16 require_once('gacl_admin.inc.php');
18 switch ($_GET['action']) {
20 $gacl_api->debug_text('Submit!!');
21 //$result = $gacl_api->acl_query('system', 'email_pw', 'users', '1', NULL, NULL, NULL, NULL, TRUE);
22 $result = $gacl_api->acl_query( $_GET['aco_section_value'],
24 $_GET['aro_section_value'],
26 $_GET['axo_section_value'],
28 $_GET['root_aro_group_id'],
29 $_GET['root_axo_group_id'],
32 //Grab all relavent columns
33 $result['query'] = str_replace( 'a.id,a.allow,a.return_value',
39 ac.section_value as aco_section_value,
40 ac.value as aco_value,
41 ar.section_value as aro_section_value,
42 ar.value as aro_value,
43 ax.section_value as axo_section_value,
44 ax.value as axo_value',
46 $rs = $gacl_api->db
->Execute($result['query']);
49 while ($row = $rs->FetchRow()) {
67 'return_value' => $return_value,
69 'updated_date' => date('d-M-y H:m:i',$updated_date),
71 'aco_section_value' => $aco_section_value,
72 'aco_value' => $aco_value,
74 'aro_section_value' => $aro_section_value,
75 'aro_value' => $aro_value,
77 'axo_section_value' => $axo_section_value,
78 'axo_value' => $axo_value,
83 //echo "<br><br>$x ACL_CHECK()'s<br>\n";
85 $smarty->assign('acls', $acls);
87 $smarty->assign('aco_section_value', $_GET['aco_section_value']);
88 $smarty->assign('aco_value', $_GET['aco_value']);
89 $smarty->assign('aro_section_value', $_GET['aro_section_value']);
90 $smarty->assign('aro_value', $_GET['aro_value']);
91 $smarty->assign('axo_section_value', $_GET['axo_section_value']);
92 $smarty->assign('axo_value', $_GET['axo_value']);
93 $smarty->assign('root_aro_group_id', $_GET['root_aro_group_id']);
94 $smarty->assign('root_axo_group_id', $_GET['root_axo_group_id']);
100 $smarty->assign('return_page', $_SERVER['PHP_SELF']);
102 $smarty->assign('current','acl_debug');
103 $smarty->assign('page_title', 'ACL Debug');
105 $smarty->assign('phpgacl_version', $gacl_api->get_version());
106 $smarty->assign('phpgacl_schema_version', $gacl_api->get_schema_version());
108 $smarty->display('phpgacl/acl_debug.tpl');