add return to core/header (#2995)
[openemr.git] / acl_upgrade.php
blobc635f235c27c202f30881e2a9bd4b06e0633fa20
1 <?php
2 /**
3 * Upgrade script for access controls.
5 * This script will update the phpGACL database, which include
6 * Access Control Objects(ACO), Groups(ARO), and Access Control
7 * Lists(ACL) to the most recent version.
8 * It will display whether each update already exist
9 * or if it was updated succesfully.
10 * To avoid reversing customizations, upgrade is done in versions,
11 * which are recorded in the database. To add another version of
12 * changes, use the following template:
13 * <pre>// Upgrade for acl_version <acl_version_here>
14 * $upgrade_acl = <acl_version_here>;
15 * if ($acl_version < $upgrade_acl) {
16 * echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
18 * //Collect the ACL ID numbers.
19 * echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
21 * //Add new object Sections
22 * echo "<BR/><B>Adding new object sections</B><BR/>";
24 * //Add new Objects
25 * echo "<BR/><B>Adding new objects</B><BR/>";
27 * //Update already existing Objects
28 * echo "<BR/><B>Upgrading objects</B><BR/>";
30 * //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
31 * // (will also place in the appropriate group and CREATE a new group if needed)
32 * echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
34 * //Update the ACLs
35 * echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
37 * //DONE with upgrading to this version
38 * $acl_version = $upgrade_acl;
39 * }
40 * </pre>
42 * Updates included:
43 * <pre>---VERSION 1 ACL---
44 * 2.8.2
45 * Section "sensitivities" (Sensitivities):
46 * ADD normal Normal (Administrators, Physicians, Clinicians(addonly))
47 * ADD high High (Administrators, Physicians)
48 * Section "admin" (Administration):
49 * ADD super Superuser (Adminstrators)
50 * 2.8.4
51 * Section "admin" (Administration):
52 * ADD drugs Pharmacy Dispensary (Administrators, Physicians, Clinicians(write))
53 * ADD acl ACL Administration (Administrators)
54 * Section "sensitivities" (Sensitivities):
55 * EDIT high High (ensure the order variable is '20')
56 * Section "acct" (Accounting):
57 * ADD disc Price Discounting (Administrators, Physicians, Accounting(write))
58 * 3.0.2
59 * ADD Section "lists" (Lists):
60 * ADD default Default List (write,addonly optional) (Administrators)
61 * ADD state State List (write,addonly optional) (Administrators)
62 * ADD country Country List (write,addonly optional) (Administrators)
63 * ADD language Language List (write,addonly optional) (Administrators)
64 * ADD ethrace Ethnicity-Race List (write,addonly optional) (Administrators)
65 * ADD Section "placeholder" (Placeholder):
66 * ADD filler Placeholder (Maintains empty ACLs)
67 * ACL/Group doc addonly "Physicians" (filler aco)
68 * ACL/Group front addonly "Front Office" (filler aco)
69 * ACL/Group back addonly "Accounting" (filler aco)
70 * 3.3.0
71 * Section "patients" (Patients):
72 * ADD sign Sign Lab Results (Physicians)
73 * ACL/Group breakglass write "Emergency Login" (added all aco's to it)
74 * 4.1.0
75 * Section "nationnotes" (Nation Notes):
76 * ADD nn_configure Nation Notes Configure (Administrators, Emergency Login)
77 * Section "patientportal" (Patient Portal):
78 * ADD portal Patient Portal (Administrators, Emergency Login)
79 * 4.1.1
80 * ACL/Group doc wsome "Physicians" (filler aco)
81 * ACL/Group clin wsome "Clinicians" (filler aco)
82 * ACL/Group front wsome "Front Office" (filler aco)
83 * ACL/Group back wsome "Accounting" (filler aco)
84 * ACL/Group doc view "Physicians" (filler aco)
85 * ACL/Group clin view "Clinicians" (filler aco)
86 * ACL/Group front view "Front Office" (filler aco)
87 * ACL/Group back view "Accounting" (filler aco)
88 * 4.1.3
89 * Section "menus" (Menus):
90 * ADD modle Module (Administrators, Emergency Login)
91 * 5.0.1
92 * Section "patients" (Patients):
93 * ADD reminder Patient Reminders (Physicians,Clinicians(addonly))
94 * ADD alert Clinical Reminders/Alerts (Physicians,Clinicians,Front Office(view),Accounting(view))
95 * ADD disclosure Disclosures (Physicians,Clinicians(addonly))
96 * ADD rx Prescriptions (Physicians,Clinicians(addonly))
97 * ADD amendment Amendments (Physicians,Clinicians(addonly))
98 * ADD lab Lab Results (Physicians,Clinicians(addonly))
99 * ADD docs_rm Documents Delete (Administrators)
100 * Section "admin" (Administration):
101 * ADD multipledb Multipledb (Administrators)
102 * ADD menu Menu (Administrators)
103 * Section "groups" (Groups):
104 * ADD gadd View/Add/Update groups (Administrators)
105 * ADD gcalendar View/Create/Update groups appointment in calendar (Administrators,Physicians,Clinicians)
106 * ADD glog Group encounter log (Administrators,Physicians, Clinicians)
107 * ADD gdlog Group detailed log of appointment in patient record (Administrators)
108 * ADD gm Send message from the permanent group therapist to the personal therapist (Administrators)
109 * 5.0.2
110 * Section "patients" (Patients):
111 * ADD pat_rep Patient Report (Administrators)
112 * </pre>
114 * @package OpenEMR
115 * @link http://www.open-emr.org
116 * @author Brady Miller <brady.g.miller@gmail.com>
117 * @copyright Copyright (c) 2012-2017 Brady Miller <brady.g.miller@gmail.com>
118 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
121 // Checks if the server's PHP version is compatible with OpenEMR:
122 require_once(dirname(__FILE__) . "/src/Common/Compatibility/Checker.php");
123 $response = OpenEMR\Common\Compatibility\Checker::checkPhpVersion();
124 if ($response !== true) {
125 die(htmlspecialchars($response));
128 $ignoreAuth = true; // no login required
130 require_once('interface/globals.php');
132 use OpenEMR\Common\Acl\AclExtended;
134 $acl_version = AclExtended::getAclVersion();
135 if (empty($acl_version)) {
136 $acl_version = 0;
139 // Upgrade for acl_version 1
140 $upgrade_acl = 1;
141 if ($acl_version < $upgrade_acl) {
142 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
144 //Collect the ACL ID numbers.
145 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
146 //Get Administrator ACL ID number
147 $admin_write = AclExtended::getAclIdNumber('Administrators', 'write');
148 //Get Doctor ACL ID Number
149 $doc_write = AclExtended::getAclIdNumber('Physicians', 'write');
150 //Get Clinician ACL with write access ID number
151 $clin_write = AclExtended::getAclIdNumber('Clinicians', 'write');
152 //Get Clinician ACL with addonly access ID number
153 $clin_addonly = AclExtended::getAclIdNumber('Clinicians', 'addonly');
154 //Get Receptionist ACL ID number
155 $front_write = AclExtended::getAclIdNumber('Front Office', 'write');
156 //Get Accountant ACL ID number
157 $back_write = AclExtended::getAclIdNumber('Accounting', 'write');
159 //Add new object Sections
160 echo "<BR/><B>Adding new object sections</B><BR/>";
161 //Add 'Sensitivities' object section (added in 2.8.2)
162 AclExtended::addObjectSectionAcl('sensitivities', 'Sensitivities');
163 //Add 'Lists' object section (added in 3.0.2)
164 AclExtended::addObjectSectionAcl('lists', 'Lists');
165 //Add 'Placeholder' object section (added in 3.0.2)
166 AclExtended::addObjectSectionAcl('placeholder', 'Placeholder');
167 //Add 'Nation Notes' object section (added in 4.1.0)
168 AclExtended::addObjectSectionAcl('nationnotes', 'Nation Notes');
169 //Add 'Patient Portal' object section (added in 4.1.0)
170 AclExtended::addObjectSectionAcl('patientportal', 'Patient Portal');
172 //Add new Objects
173 echo "<BR/><B>Adding new objects</B><BR/>";
174 //Add 'Normal' sensitivity object, order variable is default 10 (added in 2.8.2)
175 AclExtended::addObjectAcl('sensitivities', 'Sensitivities', 'normal', 'Normal');
176 //Add 'High' sensitivity object, order variable is set to 20 (added in 2.8.2)
177 AclExtended::addObjectAclWithOrder('sensitivities', 'Sensitivities', 'high', 'High', 20);
178 //Add 'Pharmacy Dispensary' object (added in 2.8.4)
179 AclExtended::addObjectAcl('admin', 'Administration', 'drugs', 'Pharmacy Dispensary');
180 //Add 'ACL Administration' object (added in 2.8.4)
181 AclExtended::addObjectAcl('admin', 'Administration', 'acl', 'ACL Administration');
182 //Add 'Price Discounting' object (added in 2.8.4)
183 AclExtended::addObjectAcl('acct', 'Accounting', 'disc', 'Price Discounting');
184 //Add 'Default List (write,addonly optional)' object (added in 3.0.2)
185 AclExtended::addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)');
186 //Add 'State List (write,addonly optional)' object (added in 3.0.2)
187 AclExtended::addObjectAcl('lists', 'Lists', 'state', 'State List (write,addonly optional)');
188 //Add 'Country List (write,addonly optional)' object (added in 3.0.2)
189 AclExtended::addObjectAcl('lists', 'Lists', 'country', 'Country List (write,addonly optional)');
190 //Add 'Language List (write,addonly optional)' object (added in 3.0.2)
191 AclExtended::addObjectAcl('lists', 'Lists', 'language', 'Language List (write,addonly optional)');
192 //Add 'Ethnicity-Race List (write,addonly optional)' object (added in 3.0.2)
193 AclExtended::addObjectAcl('lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)');
194 //Add 'Placeholder (Maintains empty ACLs)' object (added in 3.0.2)
195 AclExtended::addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)');
196 //Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0)
197 AclExtended::addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)');
198 //Add 'nationnotes' object (added in 4.1.0)
199 AclExtended::addObjectAcl('nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure');
200 //Add 'patientportal' object (added in 4.1.0)
201 AclExtended::addObjectAcl('patientportal', 'Patient Portal', 'portal', 'Patient Portal');
203 //Update already existing Objects
204 echo "<BR/><B>Upgrading objects</B><BR/>";
205 //Ensure that 'High' sensitivity object order variable is set to 20
206 AclExtended::editObjectAcl('sensitivities', 'Sensitivities', 'high', 'High', 20);
208 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
209 // (will also place in the appropriate group and CREATE a new group if needed)
210 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
211 //Add 'Physicians' ACL with 'addonly' and collect the ID number (added in 3.0.2)
212 $doc_addonly = AclExtended::addNewACL('Physicians', 'doc', 'addonly', 'Things that physicians can read and enter but not modify');
213 //Add 'Front Office' ACL with 'addonly' and collect the ID number (added in 3.0.2)
214 $front_addonly = AclExtended::addNewACL('Front Office', 'front', 'addonly', 'Things that front office can read and enter but not modify');
215 //Add 'Accounting' ACL with 'addonly' and collect the ID number (added in 3.0.2)
216 $back_addonly = AclExtended::addNewACL('Accounting', 'back', 'addonly', 'Things that back office can read and enter but not modify');
217 //Add 'Emergency Login' ACL with 'write' and collect the ID number (added in 3.3.0)
218 $emergency_write = AclExtended::addNewACL('Emergency Login', 'breakglass', 'write', 'Things that can use for emergency login, can read and modify');
220 //Update the ACLs
221 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
222 //Insert the 'super' object from the 'admin' section into the Administrators group write ACL (added in 2.8.2)
223 AclExtended::updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'super', 'Superuser', 'write');
224 //Insert the 'high' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2)
225 AclExtended::updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
226 //Insert the 'normal' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2)
227 AclExtended::updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
228 //Insert the 'high' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2)
229 AclExtended::updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
230 //Insert the 'normal' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2)
231 AclExtended::updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
232 //Insert the 'normal' object from the 'sensitivities' section into the Clinicians group addonly ACL (added in 2.8.2)
233 AclExtended::updateAcl($clin_addonly, 'Clinicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'addonly');
234 //Insert the 'drugs' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4)
235 AclExtended::updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
236 //Insert the 'drugs' object from the 'admin' section into the Physicians group write ACL (added in 2.8.4)
237 AclExtended::updateAcl($doc_write, 'Physicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
238 //Insert the 'drugs' object from the 'admin' section into the Clinicians group write ACL (added in 2.8.4)
239 AclExtended::updateAcl($clin_write, 'Clinicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
240 //Insert the 'acl' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4)
241 AclExtended::updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'acl', 'ACL Administration', 'write');
242 //Insert the 'disc' object from the 'acct' section into the Administrators group write ACL (added in 2.8.4)
243 AclExtended::updateAcl($admin_write, 'Administrators', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
244 //Insert the 'disc' object from the 'acct' section into the Accounting group write ACL (added in 2.8.4)
245 AclExtended::updateAcl($back_write, 'Accounting', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
246 //Insert the 'disc' object from the 'acct' section into the Physicians group write ACL (added in 2.8.4)
247 AclExtended::updateAcl($doc_write, 'Physicians', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
248 //Insert the 'default' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
249 AclExtended::updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'default', 'Default List (write,addonly optional)', 'write');
250 //Insert the 'state' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
251 AclExtended::updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'state', 'State List (write,addonly optional)', 'write');
252 //Insert the 'country' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
253 AclExtended::updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'country', 'Country List (write,addonly optional)', 'write');
254 //Insert the 'language' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
255 AclExtended::updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'language', 'Language List (write,addonly optional)', 'write');
256 //Insert the 'race' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
257 AclExtended::updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)', 'write');
258 //Update ACLs for Emergency Login
259 //Insert the 'disc' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
260 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
261 //Insert the 'bill' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
262 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'bill', 'Billing (write optional)', 'write');
263 //Insert the 'eob' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
264 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'eob', 'EOB Data Entry', 'write');
265 //Insert the 'rep' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
266 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'rep', 'Financial Reporting - my encounters', 'write');
267 //Insert the 'rep_a' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
268 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'rep_a', 'Financial Reporting - anything', 'write');
269 //Insert the 'calendar' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
270 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'calendar', 'Calendar Settings', 'write');
271 //Insert the 'database' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
272 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'database', 'Database Reporting', 'write');
273 //Insert the 'forms' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
274 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'forms', 'Forms Administration', 'write');
275 //Insert the 'practice' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
276 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'practice', 'Practice Settings', 'write');
277 //Insert the 'superbill' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
278 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'superbill', 'Superbill Codes Administration', 'write');
279 //Insert the 'users' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
280 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'users', 'Users/Groups/Logs Administration', 'write');
281 //Insert the 'batchcom' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
282 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'batchcom', 'Batch Communication Tool', 'write');
283 //Insert the 'language' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
284 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'language', 'Language Interface Tool', 'write');
285 //Insert the 'super' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
286 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'super', 'Superuser', 'write');
287 //Insert the 'drugs' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
288 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
289 //Insert the 'acl' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
290 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'acl', 'ACL Administration', 'write');
291 //Insert the 'auth_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
292 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'auth_a', 'Authorize - any encounters', 'write');
293 //Insert the 'coding_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
294 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'coding_a', 'Coding - any encounters (write,wsome optional)', 'write');
295 //Insert the 'notes_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
296 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'notes_a', 'Notes - any encounters (write,addonly optional)', 'write');
297 //Insert the 'date_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
298 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'date_a', 'Fix encounter dates - any encounters', 'write');
299 //Insert the 'default' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
300 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'default', 'Default List (write,addonly optional)', 'write');
301 //Insert the 'state' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
302 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'state', 'State List (write,addonly optional)', 'write');
303 //Insert the 'country' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
304 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'country', 'Country List (write,addonly optional)', 'write');
305 //Insert the 'language' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
306 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'language', 'Language List (write,addonly optional)', 'write');
307 //Insert the 'ethrace' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
308 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)', 'write');
309 //Insert the 'appt' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
310 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'appt', 'Appointments (write,wsome optional)', 'write');
311 //Insert the 'demo' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
312 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'demo', 'Demographics (write,addonly optional)', 'write');
313 //Insert the 'med' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
314 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'med', 'Medical/History (write,addonly optional)', 'write');
315 //Insert the 'trans' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
316 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'trans', 'Transactions (write optional)', 'write');
317 //Insert the 'docs' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
318 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'docs', 'Documents (write,addonly optional)', 'write');
319 //Insert the 'notes' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
320 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'notes', 'Patient Notes (write,addonly optional)', 'write');
321 //Insert the 'high' object from the 'sensitivities' section into the Emergency Login group write ACL (added in 3.3.0)
322 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
323 //Insert the 'normal' object from the 'sensitivities' section into the Emergency Login group write ACL (added in 3.3.0)
324 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
325 //Insert the 'sign' object from the 'patients' section into the Physicians group write ACL (added in 3.3.0)
326 AclExtended::updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');
327 //Insert the 'sign' object from the 'nationnotes' section into the Administrators group write ACL (added in 3.3.0)
328 AclExtended::updateAcl($admin_write, 'Administrators', 'nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure', 'write');
329 //Insert the 'sign' object from the 'nationnotes' section into the Emergency Login group write ACL (added in 3.3.0)
330 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure', 'write');
331 //Insert the 'patientportal' object from the 'patientportal' section into the Administrators group write ACL (added in 4.1.0)
332 AclExtended::updateAcl($admin_write, 'Administrators', 'patientportal', 'Patient Portal', 'portal', 'Patient Portal', 'write');
333 //Insert the 'patientportal' object from the 'patientportal' section into the Emergency Login group write ACL (added in 4.1.0)
334 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patientportal', 'Patient Portal', 'portal', 'Patient Portal', 'write');
336 //DONE with upgrading to this version
337 $acl_version = $upgrade_acl;
340 // Upgrade for acl_version 2
341 $upgrade_acl = 2;
342 if ($acl_version < $upgrade_acl) {
343 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
345 //Collect the ACL ID numbers.
346 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
348 //Add new object Sections
349 echo "<BR/><B>Adding new object sections</B><BR/>";
351 //Add new Objects
352 echo "<BR/><B>Adding new objects</B><BR/>";
354 //Update already existing Objects
355 echo "<BR/><B>Upgrading objects</B><BR/>";
357 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
358 // (will also place in the appropriate group and CREATE a new group if needed)
359 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
360 AclExtended::addNewACL('Physicians', 'doc', 'wsome', 'Things that physicians can read and partly modify');
361 AclExtended::addNewACL('Clinicians', 'clin', 'wsome', 'Things that clinicians can read and partly modify');
362 AclExtended::addNewACL('Front Office', 'front', 'wsome', 'Things that front office can read and partly modify');
363 AclExtended::addNewACL('Accounting', 'back', 'wsome', 'Things that back office can read and partly modify');
364 AclExtended::addNewACL('Physicians', 'doc', 'view', 'Things that physicians can only read');
365 AclExtended::addNewACL('Clinicians', 'clin', 'view', 'Things that clinicians can only read');
366 AclExtended::addNewACL('Front Office', 'front', 'view', 'Things that front office can only read');
367 AclExtended::addNewACL('Accounting', 'back', 'view', 'Things that back office can only read');
369 //Update the ACLs
370 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
372 //DONE with upgrading to this version
373 $acl_version = $upgrade_acl;
376 // Upgrade for acl_version 3
377 $upgrade_acl = 3;
378 if ($acl_version < $upgrade_acl) {
379 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
381 //Collect the ACL ID numbers.
382 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
383 //Get Administrator ACL ID number
384 $admin_write = AclExtended::getAclIdNumber('Administrators', 'write');
385 //Get Emergency ACL ID number
386 $emergency_write = AclExtended::getAclIdNumber('Emergency Login', 'write');
388 //Add new object Sections
389 echo "<BR/><B>Adding new object sections</B><BR/>";
390 //Add 'Menus' object section (added in 4.1.3)
391 AclExtended::addObjectSectionAcl('menus', 'Menus');
393 //Add new Objects
394 echo "<BR/><B>Adding new objects</B><BR/>";
395 //Add 'modules' object (added in 4.1.3)
396 AclExtended::addObjectAcl('menus', 'Menus', 'modle', 'Modules');
398 //Update already existing Objects
399 echo "<BR/><B>Upgrading objects</B><BR/>";
401 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
402 // (will also place in the appropriate group and CREATE a new group if needed)
403 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
405 //Update the ACLs
406 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
407 //Insert the 'Modules' object from the 'Menus' section into the Administrators group write ACL (added in 4.1.3)
408 AclExtended::updateAcl($admin_write, 'Administrators', 'menus', 'Menus', 'modle', 'Modules', 'write');
409 //Insert the 'Modules' object from the 'Menus' section into the Emergency Login group write ACL (added in 4.1.3)
410 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'menus', 'Menus', 'modle', 'Modules', 'write');
412 //DONE with upgrading to this version
413 $acl_version = $upgrade_acl;
416 // Upgrade for acl_version 4
417 $upgrade_acl = 4;
418 if ($acl_version < $upgrade_acl) {
419 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
421 //Collect the ACL ID numbers.
422 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
423 //Get Administrator ACL ID number
424 $admin_write = AclExtended::getAclIdNumber('Administrators', 'write');
425 //Get Doctor ACL ID Number
426 $doc_write = AclExtended::getAclIdNumber('Physicians', 'write');
427 //Get Clinician ACL with write access ID number
428 $clin_write = AclExtended::getAclIdNumber('Clinicians', 'write');
429 //Get Clinician ACL with addonly access ID number
430 $clin_addonly = AclExtended::getAclIdNumber('Clinicians', 'addonly');
431 //Get Receptionist ACL ID number
432 $front_write = AclExtended::getAclIdNumber('Front Office', 'write');
433 //Get Accountant ACL ID number
434 $back_write = AclExtended::getAclIdNumber('Accounting', 'write');
436 //Add new object Sections
437 // echo "<BR/><B>Adding new object sections</B><BR/>";
439 //Add new Objects
440 echo "<BR/><B>Adding new objects</B><BR/>";
441 // Add 'Patient Reminders (write,addonly optional)' object (added in 5.0.1)
442 AclExtended::addObjectAcl('patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)');
443 // Add 'Clinical Reminders/Alerts (write,addonly optional)' object (added in 5.0.1)
444 AclExtended::addObjectAcl('patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)');
445 // Add 'Disclosures (write,addonly optional)' object (added in 5.0.1)
446 AclExtended::addObjectAcl('patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)');
447 // Add 'Prescriptions (write,addonly optional)' object (added in 5.0.1)
448 AclExtended::addObjectAcl('patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)');
449 // Add 'Amendments (write,addonly optional)' object (added in 5.0.1)
450 AclExtended::addObjectAcl('patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)');
451 // Add 'Lab Results (write,addonly optional)' object (added in 5.0.1)
452 AclExtended::addObjectAcl('patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)');
454 //Update already existing Objects
455 // echo "<BR/><B>Upgrading objects</B><BR/>";
457 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
458 // (will also place in the appropriate group and CREATE a new group if needed)
459 // echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
461 //Update the ACLs
462 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
463 //Insert the 'reminder' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
464 AclExtended::updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)', 'write');
465 //Insert the 'alert' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
466 AclExtended::updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'write');
467 //Insert the 'disclosure' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
468 AclExtended::updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)', 'write');
469 //Insert the 'rx' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
470 AclExtended::updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)', 'write');
471 //Insert the 'amendment' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
472 AclExtended::updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)', 'write');
473 //Insert the 'lab' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
474 AclExtended::updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)', 'write');
475 //DONE with upgrading to this version
476 $acl_version = $upgrade_acl;
479 //This is a template for a new revision, when needed
480 // Upgrade for acl_version 5
481 $upgrade_acl = 5;
482 if ($acl_version < $upgrade_acl) {
483 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
485 //Collect the ACL ID numbers.
486 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
487 //Get Accountant ACL ID number
488 $admin_write = AclExtended::getAclIdNumber('Administrators', 'write');
491 //Add new object Sections
492 echo "<BR/><B>Adding new object sections</B><BR/>";
493 // Add 'Groups' object (added in 5.0.1)
494 AclExtended::addObjectSectionAcl('groups', 'Groups');
497 //Add new Objects
498 echo "<BR/><B>Adding new objects</B><BR/>";
499 // Add 'Multipledb' object (added in 5.0.1)
500 AclExtended::addObjectAcl('admin', 'Administration', 'multipledb', 'Multipledb');
501 AclExtended::addObjectAcl('groups', 'Groups', 'gadd', 'View/Add/Update groups');
502 AclExtended::addObjectAcl('groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar');
503 AclExtended::addObjectAcl('groups', 'Groups', 'glog', 'Group encounter log');
504 AclExtended::addObjectAcl('groups', 'Groups', 'gdlog', 'Group detailed log of appointment in patient record');
505 AclExtended::addObjectAcl('groups', 'Groups', 'gm', 'Send message from the permanent group therapist to the personal therapist');
506 //Update already existing Objects
507 echo "<BR/><B>Upgrading objects</B><BR/>";
509 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
510 // (will also place in the appropriate group and CREATE a new group if needed)
511 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
513 //Update the ACLs
514 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
515 AclExtended::updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'gadd', 'View/Add/Update groups', 'write');
516 AclExtended::updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
517 AclExtended::updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'glog', 'Group encounter log', 'write');
518 AclExtended::updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'gdlog', 'Group detailed log of appointment in patient record', 'write');
519 AclExtended::updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'gm', 'Send message from the permanent group therapist to the personal therapist', 'write');
520 //Insert the 'Multipledb' object from the 'admin' section into the Administrators group write ACL (added in 5.0.1)
521 AclExtended::updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'multipledb', 'Multipledb', 'write');
522 //DONE with upgrading to this version
523 $acl_version = $upgrade_acl;
526 // Upgrade for acl_version 6
527 $upgrade_acl = 6;
528 if ($acl_version < $upgrade_acl) {
529 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
531 //Collect the ACL ID numbers.
532 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
533 $admin_write = AclExtended::getAclIdNumber('Administrators', 'write');
534 $doc_write = AclExtended::getAclIdNumber('Physicians', 'write');
535 $clin_addonly = AclExtended::getAclIdNumber('Clinicians', 'addonly');
536 $clin_write = AclExtended::getAclIdNumber('Clinicians', 'write');
537 $front_view = AclExtended::getAclIdNumber('Front Office', 'view');
538 $front_write = AclExtended::getAclIdNumber('Front Office', 'write');
539 $back_view = AclExtended::getAclIdNumber('Accounting', 'view');
540 $emergency_write = AclExtended::getAclIdNumber('Emergency Login', 'write');
542 //Add new object Sections
543 echo "<BR/><B>Adding new object sections</B><BR/>";
544 AclExtended::addObjectAcl('admin', 'Administration', 'menu', 'Menu');
546 //Add new Objects
547 echo "<BR/><B>Adding new objects</B><BR/>";
549 //Update already existing Objects
550 echo "<BR/><B>Upgrading objects</B><BR/>";
552 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
553 // (will also place in the appropriate group and CREATE a new group if needed)
554 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
556 //Update the ACLs
557 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
558 AclExtended::updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'menu', 'Menu', 'write');
560 AclExtended::updateAcl($admin_write, 'Administrators', 'encounters', 'Encounters', 'auth', 'Authorize - my encounters', 'write');
561 AclExtended::updateAcl($admin_write, 'Administrators', 'encounters', 'Encounters', 'coding', 'Coding - my encounters (write,wsome optional)', 'write');
562 AclExtended::updateAcl($admin_write, 'Administrators', 'encounters', 'Encounters', 'notes', 'Notes - my encounters (write,addonly optional)', 'write');
563 AclExtended::updateAcl($admin_write, 'Administrators', 'encounters', 'Encounters', 'relaxed', 'Less-private information (write,addonly optional)', 'write');
565 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');
566 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)', 'write');
567 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'write');
568 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)', 'write');
569 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)', 'write');
570 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)', 'write');
571 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)', 'write');
573 AclExtended::updateAcl($doc_write, 'Physicians', 'encounters', 'Encounters', 'auth', 'Authorize - my encounters', 'write');
574 AclExtended::updateAcl($doc_write, 'Physicians', 'encounters', 'Encounters', 'coding', 'Coding - my encounters (write,wsome optional)', 'write');
575 AclExtended::updateAcl($doc_write, 'Physicians', 'encounters', 'Encounters', 'notes', 'Notes - my encounters (write,addonly optional)', 'write');
576 AclExtended::updateAcl($doc_write, 'Physicians', 'encounters', 'Encounters', 'relaxed', 'Less-private information (write,addonly optional)', 'write');
578 AclExtended::updateAcl($doc_write, 'Physicians', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
579 AclExtended::updateAcl($doc_write, 'Physicians', 'groups', 'Groups', 'glog', 'Group encounter log', 'write');
581 AclExtended::updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'trans', 'Transactions (write optional)', 'addonly');
582 AclExtended::updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)', 'addonly');
583 AclExtended::updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'addonly');
584 AclExtended::updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)', 'addonly');
585 AclExtended::updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)', 'addonly');
586 AclExtended::updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)', 'addonly');
587 AclExtended::updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)', 'addonly');
589 AclExtended::updateAcl($clin_write, 'Clinicians', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
590 AclExtended::updateAcl($clin_write, 'Clinicians', 'groups', 'Groups', 'glog', 'Group encounter log', 'write');
592 AclExtended::updateAcl($front_view, 'Front Office', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'view');
594 AclExtended::updateAcl($front_write, 'Front Office', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
596 AclExtended::updateAcl($back_view, 'Accounting', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'view');
598 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'multipledb', 'Multipledb', 'write');
599 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'menu', 'Menu', 'write');
600 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'auth', 'Authorize - my encounters', 'write');
601 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'coding', 'Coding - my encounters (write,wsome optional)', 'write');
602 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'notes', 'Notes - my encounters (write,addonly optional)', 'write');
603 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'relaxed', 'Less-private information (write,addonly optional)', 'write');
604 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');
605 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)', 'write');
606 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'write');
607 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)', 'write');
608 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)', 'write');
609 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)', 'write');
610 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)', 'write');
611 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'gadd', 'View/Add/Update groups', 'write');
612 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
613 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'glog', 'Group encounter log', 'write');
614 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'gdlog', 'Group detailed log of appointment in patient record', 'write');
615 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'gm', 'Send message from the permanent group therapist to the personal therapist', 'write');
617 //DONE with upgrading to this version
618 $acl_version = $upgrade_acl;
622 // Upgrade for acl_version 7
623 $upgrade_acl = 7;
624 if ($acl_version < $upgrade_acl) {
625 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
627 //Collect the ACL ID numbers.
628 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
629 $admin_write = AclExtended::getAclIdNumber('Administrators', 'write');
630 $emergency_write = AclExtended::getAclIdNumber('Emergency Login', 'write');
632 //Add new object Sections
633 echo "<BR/><B>Adding new object sections</B><BR/>";
634 AclExtended::addObjectAcl('admin', 'Administration', 'manage_modules', 'Manage modules');
636 //Add new Objects
637 echo "<BR/><B>Adding new objects</B><BR/>";
639 //Update already existing Objects
640 echo "<BR/><B>Upgrading objects</B><BR/>";
642 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
643 // (will also place in the appropriate group and CREATE a new group if needed)
644 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
645 AclExtended::updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'manage_modules', 'Manage modules', 'write');
646 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'manage_modules', 'Manage modules', 'write');
648 //Update the ACLs
649 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
651 //DONE with upgrading to this version
652 $acl_version = $upgrade_acl;
655 // Upgrade for acl_version 8
656 $upgrade_acl = 8;
657 if ($acl_version < $upgrade_acl) {
658 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
660 //Collect the ACL ID numbers.
661 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
662 $admin_write = AclExtended::getAclIdNumber('Administrators', 'write');
663 $emergency_write = AclExtended::getAclIdNumber('Emergency Login', 'write');
665 //Add new object Sections
666 echo "<BR/><B>Adding new object sections</B><BR/>";
667 AclExtended::addObjectAcl('patients', 'Patients', 'docs_rm', 'Documents Delete');
669 //Add new Objects
670 echo "<BR/><B>Adding new objects</B><BR/>";
672 //Update already existing Objects
673 echo "<BR/><B>Upgrading objects</B><BR/>";
675 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
676 // (will also place in the appropriate group and CREATE a new group if needed)
677 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
678 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'docs_rm', 'Documents Delete', 'write');
679 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'docs_rm', 'Documents Delete', 'write');
682 //Update the ACLs
683 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
685 //DONE with upgrading to this version
686 $acl_version = $upgrade_acl;
689 // Upgrade for acl_version 9
690 $upgrade_acl = 9;
691 if ($acl_version < $upgrade_acl) {
692 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
694 //Collect the ACL ID numbers.
695 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
696 $admin_write = AclExtended::getAclIdNumber('Administrators', 'write');
697 $accounting_view = AclExtended::getAclIdNumber('Accounting', 'view');
698 $clinicians_view = AclExtended::getAclIdNumber('Clinicians', 'view');
699 $emergency_write = AclExtended::getAclIdNumber('Emergency Login', 'write');
700 $frontoffice_view = AclExtended::getAclIdNumber('Front Office', 'view');
701 $physicians_view = AclExtended::getAclIdNumber('Physicians', 'view');
703 //Add new object Sections
704 echo "<BR/><B>Adding new object sections</B><BR/>";
706 //Add new Objects
707 echo "<BR/><B>Adding new objects</B><BR/>";
708 AclExtended::addObjectAcl('patients', 'Patients', 'pat_rep', 'Patient Report');
710 //Update already existing Objects
711 echo "<BR/><B>Upgrading objects</B><BR/>";
713 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
714 // (will also place in the appropriate group and CREATE a new group if needed)
715 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
716 AclExtended::updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'write');
717 AclExtended::updateAcl($accounting_view, 'Accounting', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'view');
718 AclExtended::updateAcl($clinicians_view, 'Clinicians', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'view');
719 AclExtended::updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'write');
720 AclExtended::updateAcl($frontoffice_view, 'Front Office', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'view');
721 AclExtended::updateAcl($physicians_view, 'Physicians', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'view');
723 //Update the ACLs
724 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
726 //DONE with upgrading to this version
727 $acl_version = $upgrade_acl;
730 /* This is a template for a new revision, when needed
731 // Upgrade for acl_version 10
732 $upgrade_acl = 10;
733 if ($acl_version < $upgrade_acl) {
734 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
736 //Collect the ACL ID numbers.
737 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
739 //Add new object Sections
740 echo "<BR/><B>Adding new object sections</B><BR/>";
742 //Add new Objects
743 echo "<BR/><B>Adding new objects</B><BR/>";
745 //Update already existing Objects
746 echo "<BR/><B>Upgrading objects</B><BR/>";
748 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
749 // (will also place in the appropriate group and CREATE a new group if needed)
750 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
752 //Update the ACLs
753 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
755 //DONE with upgrading to this version
756 $acl_version = $upgrade_acl;
760 /* This is a template for a new revision, when needed
761 // Upgrade for acl_version 11
762 $upgrade_acl = 11;
763 if ($acl_version < $upgrade_acl) {
764 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
766 //Collect the ACL ID numbers.
767 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
769 //Add new object Sections
770 echo "<BR/><B>Adding new object sections</B><BR/>";
772 //Add new Objects
773 echo "<BR/><B>Adding new objects</B><BR/>";
775 //Update already existing Objects
776 echo "<BR/><B>Upgrading objects</B><BR/>";
778 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
779 // (will also place in the appropriate group and CREATE a new group if needed)
780 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
782 //Update the ACLs
783 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
785 //DONE with upgrading to this version
786 $acl_version = $upgrade_acl;
790 //All done
791 $response = AclExtended::setAclVersion($acl_version);
793 if ($response) {
794 echo "DONE upgrading access controls";
795 } else {
796 echo "ERROR upgrading access control version";