From 3aee4980756e2c5e898a9e0597e46598aaceec70 Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Sun, 23 Sep 2007 20:16:23 +0000 Subject: [PATCH] phpgacl updates from Brady Miller --- acl_setup.php | 363 +++++++++++++++++++++++++------------------------- library/acl.inc | 8 +- phpgacl_upgrade_1.php | 190 ++++++++++++++++++++++++++ 3 files changed, 379 insertions(+), 182 deletions(-) create mode 100644 phpgacl_upgrade_1.php diff --git a/acl_setup.php b/acl_setup.php index 108cd61d7..030441f6c 100644 --- a/acl_setup.php +++ b/acl_setup.php @@ -1,180 +1,183 @@ - - // - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. - - // This program may be run after phpGACL has been installed, to - // create the Access Control Objects and their sections as required - // by OpenEMR. Also created are some sample ARO groups, an "admin" - // ARO, and some reasonable ACL entries for the groups. - - include_once('library/acl.inc'); - - if (! $phpgacl_location) die("You must first set up library/acl.inc to use phpGACL!"); - - include_once("$phpgacl_location/gacl_api.class.php"); - - $gacl = new gacl_api(); - - // Create the ACO sections. Every ACO must have a section. - // - $gacl->add_object_section('Accounting' , 'acct' , 10, 0, 'ACO'); - $gacl->add_object_section('Administration', 'admin' , 10, 0, 'ACO'); - $gacl->add_object_section('Encounters' , 'encounters' , 10, 0, 'ACO'); - $gacl->add_object_section('Patients' , 'patients' , 10, 0, 'ACO'); - $gacl->add_object_section('Squads' , 'squads' , 10, 0, 'ACO'); - $gacl->add_object_section('Sensitivities' , 'sensitivities', 10, 0, 'ACO'); - - // Create Accounting ACOs. - // - $gacl->add_object('acct', 'Billing (write optional)' , 'bill' , 10, 0, 'ACO'); - $gacl->add_object('acct', 'EOB Data Entry' , 'eob' , 10, 0, 'ACO'); - $gacl->add_object('acct', 'Financial Reporting - my encounters', 'rep' , 10, 0, 'ACO'); - $gacl->add_object('acct', 'Financial Reporting - anything' , 'rep_a', 10, 0, 'ACO'); - - // Create Administration ACOs. - // - $gacl->add_object('admin', 'Superuser' , 'super' , 10, 0, 'ACO'); - $gacl->add_object('admin', 'Calendar Settings' , 'calendar' , 10, 0, 'ACO'); - $gacl->add_object('admin', 'Database Reporting' , 'database' , 10, 0, 'ACO'); - $gacl->add_object('admin', 'Forms Administration' , 'forms' , 10, 0, 'ACO'); - $gacl->add_object('admin', 'Practice Settings' , 'practice' , 10, 0, 'ACO'); - $gacl->add_object('admin', 'Superbill Codes Administration' , 'superbill', 10, 0, 'ACO'); - $gacl->add_object('admin', 'Users/Groups/Logs Administration', 'users' , 10, 0, 'ACO'); - $gacl->add_object('admin', 'Batch Communication Tool' , 'batchcom' , 10, 0, 'ACO'); - $gacl->add_object('admin', 'Language Interface Tool' , 'language' , 10, 0, 'ACO'); - - // Create ACOs for encounters. - // - $gacl->add_object('encounters', 'Authorize - my encounters' , 'auth' , 10, 0, 'ACO'); - $gacl->add_object('encounters', 'Authorize - any encounters' , 'auth_a' , 10, 0, 'ACO'); - $gacl->add_object('encounters', 'Coding - my encounters (write,wsome optional)' , 'coding' , 10, 0, 'ACO'); - $gacl->add_object('encounters', 'Coding - any encounters (write,wsome optional)' , 'coding_a', 10, 0, 'ACO'); - $gacl->add_object('encounters', 'Notes - my encounters (write,addonly optional)' , 'notes' , 10, 0, 'ACO'); - $gacl->add_object('encounters', 'Notes - any encounters (write,addonly optional)' , 'notes_a' , 10, 0, 'ACO'); - $gacl->add_object('encounters', 'Fix encounter dates - any encounters' , 'date_a' , 10, 0, 'ACO'); - $gacl->add_object('encounters', 'Less-private information (write,addonly optional)', 'relaxed' , 10, 0, 'ACO'); - - // Create ACOs for patients. - // - $gacl->add_object('patients', 'Appointments (write optional)' , 'appt' , 10, 0, 'ACO'); - $gacl->add_object('patients', 'Demographics (write,addonly optional)' , 'demo' , 10, 0, 'ACO'); - $gacl->add_object('patients', 'Medical/History (write,addonly optional)', 'med' , 10, 0, 'ACO'); - $gacl->add_object('patients', 'Transactions (write optional)' , 'trans', 10, 0, 'ACO'); - $gacl->add_object('patients', 'Documents (write,addonly optional)' , 'docs' , 10, 0, 'ACO'); - $gacl->add_object('patients', 'Patient Notes (write,addonly optional)' , 'notes', 10, 0, 'ACO'); - - // Create ACOs for sensitivities. - // - $gacl->add_object('sensitivities', 'Normal', 'normal', 10, 0, 'ACO'); - $gacl->add_object('sensitivities', 'High' , 'high' , 20, 0, 'ACO'); - - // Create ARO groups. - // - $users = $gacl->add_group('users', 'OpenEMR Users' , 0 , 'ARO'); - $admin = $gacl->add_group('admin', 'Administrators', $users, 'ARO'); - $clin = $gacl->add_group('clin' , 'Clinicians' , $users, 'ARO'); - $doc = $gacl->add_group('doc' , 'Physicians' , $users, 'ARO'); - $front = $gacl->add_group('front', 'Front Office' , $users, 'ARO'); - $back = $gacl->add_group('back' , 'Accounting' , $users, 'ARO'); - - // Create a Users section for the AROs (humans). - // - $gacl->add_object_section('Users', 'users', 10, 0, 'ARO'); - - // Create the Administrator in the above-created "users" section - // and add him/her to the above-created "admin" group. - // - $gacl->add_object('users', 'Administrator', 'admin' ,10, 0, 'ARO'); - $gacl->add_group_object($admin, 'users', 'admin', 'ARO'); - - // Set permissions for administrators. - // - $gacl->add_acl( - array( - 'acct'=>array('bill', 'eob', 'rep', 'rep_a'), - 'admin'=>array('calendar', 'database', 'forms', 'practice', 'superbill', 'users', 'batchcom', 'language', 'super'), - 'encounters'=>array('auth_a', 'coding_a', 'notes_a', 'date_a'), - 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes'), - 'sensitivities'=>array('normal', 'high') - ), - NULL, array($admin), NULL, NULL, - 1, 1, 'write', 'Administrators can do anything' - ); - - // Set permissions for physicians. - // - $gacl->add_acl( - array( - 'acct'=>array('rep'), - 'encounters'=>array('auth_a', 'coding_a', 'notes_a', 'date_a'), - 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes'), - 'sensitivities'=>array('normal', 'high') - ), - NULL, array($doc), NULL, NULL, - 1, 1, 'write', 'Things that physicians can read and modify' - ); - - // Set permissions for clinicians. - // - $gacl->add_acl( - array( - 'encounters'=>array('notes', 'relaxed'), - 'patients'=>array('demo', 'med', 'docs', 'notes'), - 'sensitivities'=>array('normal') - ), - NULL, array($clin), NULL, NULL, - 1, 1, 'addonly', 'Things that clinicians can read and enter but not modify' - ); - $gacl->add_acl( - array( - 'encounters'=>array('coding'), - 'patients'=>array('appt') - ), - NULL, array($clin), NULL, NULL, - 1, 1, 'write', 'Things that clinicians can read and modify' - ); - - // Set permissions for front office staff. - // - $gacl->add_acl( - array( - 'patients'=>array('appt', 'demo', 'trans', 'notes') - ), - NULL, array($front), NULL, NULL, - 1, 1, 'write', 'Things that front office can read and modify' - ); - - // Set permissions for back office staff. - // - $gacl->add_acl( - array( - 'acct'=>array('bill', 'eob', 'rep', 'rep_a'), - 'admin'=>array('practice', 'superbill'), - 'encounters'=>array('auth_a', 'coding_a', 'date_a'), - 'patients'=>array('appt', 'demo') - ), - NULL, array($back), NULL, NULL, - 1, 1, 'write', 'Things that back office can read and modify' - ); - -?> - - -OpenEMR ACL Setup - - - -OpenEMR ACL Setup -

- - -All done! - - - - - + + // + // This program is free software; you can redistribute it and/or + // modify it under the terms of the GNU General Public License + // as published by the Free Software Foundation; either version 2 + // of the License, or (at your option) any later version. + + // This program may be run after phpGACL has been installed, to + // create the Access Control Objects and their sections as required + // by OpenEMR. Also created are some sample ARO groups, an "admin" + // ARO, and some reasonable ACL entries for the groups. + + include_once('library/acl.inc'); + + if (! $phpgacl_location) die("You must first set up library/acl.inc to use phpGACL!"); + + include_once("$phpgacl_location/gacl_api.class.php"); + + $gacl = new gacl_api(); + + // Create the ACO sections. Every ACO must have a section. + // + $gacl->add_object_section('Accounting' , 'acct' , 10, 0, 'ACO'); + $gacl->add_object_section('Administration', 'admin' , 10, 0, 'ACO'); + $gacl->add_object_section('Encounters' , 'encounters' , 10, 0, 'ACO'); + $gacl->add_object_section('Patients' , 'patients' , 10, 0, 'ACO'); + $gacl->add_object_section('Squads' , 'squads' , 10, 0, 'ACO'); + $gacl->add_object_section('Sensitivities' , 'sensitivities', 10, 0, 'ACO'); + + // Create Accounting ACOs. + // + $gacl->add_object('acct', 'Billing (write optional)' , 'bill' , 10, 0, 'ACO'); + $gacl->add_object('acct', 'EOB Data Entry' , 'eob' , 10, 0, 'ACO'); + $gacl->add_object('acct', 'Financial Reporting - my encounters', 'rep' , 10, 0, 'ACO'); + $gacl->add_object('acct', 'Financial Reporting - anything' , 'rep_a', 10, 0, 'ACO'); + + // Create Administration ACOs. + // + $gacl->add_object('admin', 'Superuser' , 'super' , 10, 0, 'ACO'); + $gacl->add_object('admin', 'Calendar Settings' , 'calendar' , 10, 0, 'ACO'); + $gacl->add_object('admin', 'Database Reporting' , 'database' , 10, 0, 'ACO'); + $gacl->add_object('admin', 'Forms Administration' , 'forms' , 10, 0, 'ACO'); + $gacl->add_object('admin', 'Practice Settings' , 'practice' , 10, 0, 'ACO'); + $gacl->add_object('admin', 'Superbill Codes Administration' , 'superbill', 10, 0, 'ACO'); + $gacl->add_object('admin', 'Users/Groups/Logs Administration', 'users' , 10, 0, 'ACO'); + $gacl->add_object('admin', 'Batch Communication Tool' , 'batchcom' , 10, 0, 'ACO'); + $gacl->add_object('admin', 'Language Interface Tool' , 'language' , 10, 0, 'ACO'); + $gacl->add_object('admin', 'Pharmacy Dispensary' , 'drugs' , 10, 0, 'ACO'); + + // Create ACOs for encounters. + // + $gacl->add_object('encounters', 'Authorize - my encounters' , 'auth' , 10, 0, 'ACO'); + $gacl->add_object('encounters', 'Authorize - any encounters' , 'auth_a' , 10, 0, 'ACO'); + $gacl->add_object('encounters', 'Coding - my encounters (write,wsome optional)' , 'coding' , 10, 0, 'ACO'); + $gacl->add_object('encounters', 'Coding - any encounters (write,wsome optional)' , 'coding_a', 10, 0, 'ACO'); + $gacl->add_object('encounters', 'Notes - my encounters (write,addonly optional)' , 'notes' , 10, 0, 'ACO'); + $gacl->add_object('encounters', 'Notes - any encounters (write,addonly optional)' , 'notes_a' , 10, 0, 'ACO'); + $gacl->add_object('encounters', 'Fix encounter dates - any encounters' , 'date_a' , 10, 0, 'ACO'); + $gacl->add_object('encounters', 'Less-private information (write,addonly optional)', 'relaxed' , 10, 0, 'ACO'); + + // Create ACOs for patients. + // + $gacl->add_object('patients', 'Appointments (write optional)' , 'appt' , 10, 0, 'ACO'); + $gacl->add_object('patients', 'Demographics (write,addonly optional)' , 'demo' , 10, 0, 'ACO'); + $gacl->add_object('patients', 'Medical/History (write,addonly optional)', 'med' , 10, 0, 'ACO'); + $gacl->add_object('patients', 'Transactions (write optional)' , 'trans', 10, 0, 'ACO'); + $gacl->add_object('patients', 'Documents (write,addonly optional)' , 'docs' , 10, 0, 'ACO'); + $gacl->add_object('patients', 'Patient Notes (write,addonly optional)' , 'notes', 10, 0, 'ACO'); + + // Create ACOs for sensitivities. + // + $gacl->add_object('sensitivities', 'Normal', 'normal', 10, 0, 'ACO'); + $gacl->add_object('sensitivities', 'High' , 'high' , 20, 0, 'ACO'); + + // Create ARO groups. + // + $users = $gacl->add_group('users', 'OpenEMR Users' , 0 , 'ARO'); + $admin = $gacl->add_group('admin', 'Administrators', $users, 'ARO'); + $clin = $gacl->add_group('clin' , 'Clinicians' , $users, 'ARO'); + $doc = $gacl->add_group('doc' , 'Physicians' , $users, 'ARO'); + $front = $gacl->add_group('front', 'Front Office' , $users, 'ARO'); + $back = $gacl->add_group('back' , 'Accounting' , $users, 'ARO'); + + // Create a Users section for the AROs (humans). + // + $gacl->add_object_section('Users', 'users', 10, 0, 'ARO'); + + // Create the Administrator in the above-created "users" section + // and add him/her to the above-created "admin" group. + // + $gacl->add_object('users', 'Administrator', 'admin' ,10, 0, 'ARO'); + $gacl->add_group_object($admin, 'users', 'admin', 'ARO'); + + // Set permissions for administrators. + // + $gacl->add_acl( + array( + 'acct'=>array('bill', 'eob', 'rep', 'rep_a'), + 'admin'=>array('calendar', 'database', 'forms', 'practice', 'superbill', 'users', 'batchcom', 'language', 'super', 'drugs'), + 'encounters'=>array('auth_a', 'coding_a', 'notes_a', 'date_a'), + 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes'), + 'sensitivities'=>array('normal', 'high') + ), + NULL, array($admin), NULL, NULL, + 1, 1, 'write', 'Administrators can do anything' + ); + + // Set permissions for physicians. + // + $gacl->add_acl( + array( + 'acct'=>array('rep'), + 'admin'=>array('drugs'), + 'encounters'=>array('auth_a', 'coding_a', 'notes_a', 'date_a'), + 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes'), + 'sensitivities'=>array('normal', 'high') + ), + NULL, array($doc), NULL, NULL, + 1, 1, 'write', 'Things that physicians can read and modify' + ); + + // Set permissions for clinicians. + // + $gacl->add_acl( + array( + 'encounters'=>array('notes', 'relaxed'), + 'patients'=>array('demo', 'med', 'docs', 'notes'), + 'sensitivities'=>array('normal') + ), + NULL, array($clin), NULL, NULL, + 1, 1, 'addonly', 'Things that clinicians can read and enter but not modify' + ); + $gacl->add_acl( + array( + 'admin'=>array('drugs'), + 'encounters'=>array('coding'), + 'patients'=>array('appt') + ), + NULL, array($clin), NULL, NULL, + 1, 1, 'write', 'Things that clinicians can read and modify' + ); + + // Set permissions for front office staff. + // + $gacl->add_acl( + array( + 'patients'=>array('appt', 'demo', 'trans', 'notes') + ), + NULL, array($front), NULL, NULL, + 1, 1, 'write', 'Things that front office can read and modify' + ); + + // Set permissions for back office staff. + // + $gacl->add_acl( + array( + 'acct'=>array('bill', 'eob', 'rep', 'rep_a'), + 'admin'=>array('practice', 'superbill'), + 'encounters'=>array('auth_a', 'coding_a', 'date_a'), + 'patients'=>array('appt', 'demo') + ), + NULL, array($back), NULL, NULL, + 1, 1, 'write', 'Things that back office can read and modify' + ); + +?> + + +OpenEMR ACL Setup + + + +OpenEMR ACL Setup +

+ + +All done! + + + + + diff --git a/library/acl.inc b/library/acl.inc index 07a7faccb..96e45eed9 100644 --- a/library/acl.inc +++ b/library/acl.inc @@ -6,7 +6,7 @@ // // $phpgacl_location = "/var/www/gacl"; - // Tentatively, the following Access Control Objects will be supported. + // The following Access Control Objects are currently be supported. // These are the "things to be protected": // // Section "admin" (Administration): @@ -19,7 +19,7 @@ // users Users/Groups/Logs Administration // batchcom Batch Communication Tool // language Language Interface Tool - // drugs Drugs Administration + // drugs Pharmacy Dispensary // // Section "acct" (Accounting): // bill Billing (write optional) @@ -48,6 +48,10 @@ // // Section "squads" applies to sports team use only: // acos in this section define the user-specified list of squads + // + // Section "sensitivities" (Sensitivities): + // normal Normal + // high High if (isset ($phpgacl_location)) { include_once("$phpgacl_location/gacl.class.php"); diff --git a/phpgacl_upgrade_1.php b/phpgacl_upgrade_1.php new file mode 100644 index 000000000..9db98f68d --- /dev/null +++ b/phpgacl_upgrade_1.php @@ -0,0 +1,190 @@ +Checking to ensure all the proper ACL(access control list) are present:
"; +//Get Administrator ACL ID number +$admin_write = getAclIdNumber('Administrators', 'write'); +//Get Doctor ACL ID Number +$doc_write = getAclIdNumber('Physicians', 'write'); +//Get Clinician ACL with write access ID number +$clin_write = getAclIdNumber('Clinicians', 'write'); +//Get Clinician ACL with addonly access ID number +$clin_addonly = getAclIdNumber('Clinicians', 'addonly'); +//Get Receptionist ACL ID number +$front_write = getAclIdNumber('Front Office', 'write'); +//Get Accountant ACL ID number +$back_write = getAclIdNumber('Accounting', 'write'); + + +//Add new User Defined Groups here(placemarker, since no new user defined groups since 2.8.1 have been added) + + +//Add new object Sections +echo "
Adding new object sections
"; +//Add 'Sensitivities' object section (added in 2.8.2) +addObjectSectionAcl('sensitivities', 'Sensitivities'); + + +//Add new Objects +echo "
Adding new objects
"; +//Add 'Normal' sensitivity object (added in 2.8.2) +addObjectAcl('sensitivities', 'Sensitivities', 'normal', 'Normal'); +//Add 'High' sensitivity object (added in 2.8.2) +addObjectAcl('sensitivities', 'Sensitivities', 'high', 'High'); +//Add 'Pharmacy Dispensary' object (added in 2.8.4) +addObjectAcl('admin', 'Administration', 'drugs', 'Pharmacy Dispensary'); + + +//Update the ACLs +echo "
Updating the ACLs(Access Control Lists)
"; +//Insert the 'super' object from the 'admin' section into the Administrators group write ACL (added in 2.8.2) +updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'super', 'Superuser', 'write'); +//Insert the 'high' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2) +updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'high', 'High', 'write'); +//Insert the 'normal' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2) +updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write'); +//Insert the 'high' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2) +updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'high', 'High', 'write'); +//Insert the 'normal' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2) +updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write'); +//Insert the 'normal' object from the 'sensitivities' section into the Clinicians group addonly ACL (added in 2.8.2) +updateAcl($clin_addonly, 'Clinicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'addonly'); +//Insert the 'drugs' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4) +updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write'); +//Insert the 'drugs' object from the 'admin' section into the Physicians group write ACL (added in 2.8.4) +updateAcl($doc_write, 'Physicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write'); +//Insert the 'drugs' object from the 'admin' section into the Clinicians group write ACL (added in 2.8.4) +updateAcl($clin_write, 'Clinicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write'); + + +//Function will return an array that contains the ACL ID number. +//It will also check to ensure the ACL exist and is not duplicated. +// $title = Title(string) of group. +// $return_value = What the acl returns (string), usually 'write' or 'addonly' +function getAclIdNumber($title, $return_value) { + global $gacl; + $temp_acl_id_array = $gacl->search_acl(FALSE, FALSE, FALSE, FALSE, $title, FALSE, FALSE, FALSE, $return_value); + switch (count($temp_acl_id_array)) { + case 0: + echo "ERROR, '$title' group '$return_value' ACL does not exist.
"; + break; + case 1: + echo "'$title' group '$return_value' ACL is present.
"; + break; + default: + echo "ERROR, Multiple '$title' group '$return_value' ACLs are present.
"; + break; + } + return $temp_acl_id_array; +} + + +//Function to add a group. +//This is just a placeholder function at this point, since have not added another group yet. +// $name = Identifier(string) of group +// $title = Title(string) of group +function addGroupAcl($name, $title) { + global $gacl; + return; +} + + +//Function to add an object section. +//It will check to ensure the object section doesn't already exist. +// $name = Identifier(string) of section +// $title = Title(string) of object +function addObjectSectionAcl($name, $title) { + global $gacl; + if ($gacl->get_object_section_section_id($title, $name, 'ACO')) { + echo "The '$title' object section already exist.
"; + } + else { + $tmp_boolean = $gacl->add_object_section($title , $name, 10, 0, 'ACO'); + if ($tmp_boolean) { + echo "The '$title' object section has been successfully added.
"; + } + else { + echo "ERROR,unable to create the '$title' object section.
"; + } + } + return; +} + + +//Function to add an object. +//It will check to ensure the object doesn't already exist. +// $section_name = Identifier(string) of section +// $section_title = Title(string) of section +// $object_name = Identifier(string) of object +// $object_title = Title(string) of object +function addObjectAcl($section_name, $section_title, $object_name, $object_title) { + global $gacl; + if ($gacl->get_object_id($section_name, $object_name, 'ACO')) { + echo "The '$object_title' object in the '$section_title' section already exist.
"; + } + else { + $tmp_boolean = $gacl->add_object($section_name, $object_title, $object_name, 10, 0, 'ACO'); + if ($tmp_boolean) { + echo "The '$object_title' object in the '$section_title' section has been successfully added.
"; + } + else { + echo "ERROR,unable to create the '$object_title' object in the '$section_title' section.
"; + } + } + return; +} + + +//Update the ACL +//It will check to ensure the ACL hasn't already been updated. +// $array_acl_id_number = array containing hopefully one element, which is an integer, and is identifier of acl to be updated. +// $group_title = Title(string) of group. +// $object_section_name = Identifier(string) of section +// $object_section_title = Title(string) of section +// $object_name = Identifier(string) of object +// $object_title = Title(string) of object +// $acl_return_value = What the acl returns (string), usually 'write' or 'addonly' +function updateAcl($array_acl_id_number, $group_title, $section_name, $section_title, $object_name, $object_title, $return_value) { + global $gacl; + $tmp_array = $gacl->search_acl($section_name, $object_name, FALSE, FALSE, $group_title, FALSE, FALSE, FALSE, $return_value); + switch (count($tmp_array)) { + case 0: + $tmp_boolean = @$gacl->append_acl($array_acl_id_number[0], NULL, NULL, NULL, NULL, array($section_name=>array($object_name))); + if ($tmp_boolean){ + echo "Successfully placed the '$object_title' object of the '$section_title' section into the '$group_title' group '$return_value' ACL.
"; + } + else { + echo "ERROR,unable to place the '$object_title' object of the '$section_title' section into the '$group_title' group '$return_value' ACL.
"; + } + break; + case 1: + echo "The '$object_title' object of the '$section_title' section is already found in the '$group_title' group '$return_value' ACL.
"; + break; + default: + echo "ERROR, Multiple '$group_title' group '$return_value' ACLs with the '$object_title' object of the '$section_title' section are present.
"; + break; + } + return; +} + +//All done +echo "
ALL DONE"; + +?> -- 2.11.4.GIT