ubuntu debian package fix for 4.0 - fix upgrading with site stuff
[openemr.git] / gacl / admin / acl_debug.php
blobd3bb16ca528f65ec6647aae8b7e9b404862f1438
1 <?php
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');
8 exit;
10 //ensure php is installed
11 if (!isset($phpgacl_location)) {
12 echo xl('php-GACL access controls are turned off');
13 exit;
16 require_once('gacl_admin.inc.php');
18 switch ($_GET['action']) {
19 case 'Submit':
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'],
23 $_GET['aco_value'],
24 $_GET['aro_section_value'],
25 $_GET['aro_value'],
26 $_GET['axo_section_value'],
27 $_GET['axo_value'],
28 $_GET['root_aro_group_id'],
29 $_GET['root_axo_group_id'],
30 TRUE);
32 //Grab all relavent columns
33 $result['query'] = str_replace( 'a.id,a.allow,a.return_value',
34 ' a.id,
35 a.allow,
36 a.return_value,
37 a.note,
38 a.updated_date,
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',
45 $result['query']);
46 $rs = $gacl_api->db->Execute($result['query']);
48 if (is_object($rs)) {
49 while ($row = $rs->FetchRow()) {
50 list(
51 $id,
52 $allow,
53 $return_value,
54 $note,
55 $updated_date,
56 $aco_section_value,
57 $aco_value,
58 $aro_section_value,
59 $aro_value,
60 $axo_section_value,
61 $axo_value
62 ) = $row;
64 $acls[] = array(
65 'id' => $id,
66 'allow' => $allow,
67 'return_value' => $return_value,
68 'note' => $note,
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']);
95 break;
96 default:
97 break;
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');