//Get Receptionist ACL ID number $front_write = getAclIdNumber('Front Office', 'write'); //Get Accountant ACL ID number $back_write = getAclIdNumber('Accounting', 'write'); //Add new object Sections echo "<BR/><B>Adding new object sections</B><BR/>"; //Add 'Sensitivities' object section (added in 2.8.2) addObjectSectionAcl('sensitivities', 'Sensitivities'); //Add 'Lists' object section (added in 3.0.2) addObjectSectionAcl('lists', 'Lists'); //Add 'Placeholder' object section (added in 3.0.2) addObjectSectionAcl('placeholder', 'Placeholder'); //Add 'Nation Notes' object section (added in 4.1.0) addObjectSectionAcl('nationnotes', 'Nation Notes'); //Add 'Patient Portal' object section (added in 4.1.0) addObjectSectionAcl('patientportal', 'Patient Portal'); //Add new Objects echo "<BR/><B>Adding new objects</B><BR/>"; //Add 'Normal' sensitivity object, order variable is default 10 (added in 2.8.2) addObjectAcl('sensitivities', 'Sensitivities', 'normal', 'Normal'); //Add 'High' sensitivity object, order variable is set to 20 (added in 2.8.2) addObjectAclWithOrder('sensitivities', 'Sensitivities', 'high', 'High', 20); //Add 'Pharmacy Dispensary' object (added in 2.8.4) addObjectAcl('admin', 'Administration', 'drugs', 'Pharmacy Dispensary'); //Add 'ACL Administration' object (added in 2.8.4) addObjectAcl('admin', 'Administration', 'acl', 'ACL Administration'); //Add 'Price Discounting' object (added in 2.8.4) addObjectAcl('acct', 'Accounting', 'disc', 'Price Discounting'); //Add 'Default List (write,addonly optional)' object (added in 3.0.2) addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)'); //Add 'State List (write,addonly optional)' object (added in 3.0.2)
//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 object Sections echo "<BR/><B>Adding new object sections</B><BR/>"; //Add 'Sensitivities' object section (added in 2.8.2) addObjectSectionAcl('sensitivities', 'Sensitivities'); //Add 'Lists' object section (added in 3.0.2) addObjectSectionAcl('lists', 'Lists'); //Add 'Placeholder' object section (added in 3.0.2) addObjectSectionAcl('placeholder', 'Placeholder'); //Add new Objects echo "<BR/><B>Adding new objects</B><BR/>"; //Add 'Normal' sensitivity object, order variable is default 10 (added in 2.8.2) addObjectAcl('sensitivities', 'Sensitivities', 'normal', 'Normal'); //Add 'High' sensitivity object, order variable is set to 20 (added in 2.8.2) addObjectAclWithOrder('sensitivities', 'Sensitivities', 'high', 'High', 20); //Add 'Pharmacy Dispensary' object (added in 2.8.4) addObjectAcl('admin', 'Administration', 'drugs', 'Pharmacy Dispensary'); //Add 'ACL Administration' object (added in 2.8.4) addObjectAcl('admin', 'Administration', 'acl', 'ACL Administration'); //Add 'Price Discounting' object (added in 2.8.4) addObjectAcl('acct', 'Accounting', 'disc', 'Price Discounting'); //Add 'Default List (write,addonly optional)' object (added in 3.0.2) addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)'); //Add 'State List (write,addonly optional)' object (added in 3.0.2)
/** * this will be used to register a module * @param unknown_type $directory * @param unknown_type $rel_path * @param unknown_type $state * @param unknown_type $base * @return boolean */ public function register($directory, $rel_path, $state = 0, $base = "custom_modules") { /*$check = sqlQuery("select mod_active from modules where mod_directory='$directory'");*/ $sql = "SELECT mod_active FROM modules WHERE mod_directory = ?"; $params = array($directory); $check = $this->applicationTable->sqlQuery($sql, $params); if ($check->count() == 0) { $added = ""; $typeSet = ""; if ($base != "custom_modules") { $added = "module/"; $typeSet = "type=1,"; } $lines = @file($GLOBALS['srcdir'] . "/../interface/modules/{$base}/{$added}{$directory}/info.txt"); if ($lines) { $name = $lines[0]; } else { $name = $directory; } $uiname = ucwords(strtolower($directory)); $sql = "INSERT INTO modules SET mod_name = ?,\n mod_active = ?, \n mod_ui_name = ?, \n mod_relative_link = ?,\n {$typeSet} \n mod_directory = ?, \n date=NOW()\n "; $params = array($name, $state, $uiname, strtolower($rel_path), mysql_escape_string($directory)); $result = $this->applicationTable->sqlQuery($sql, $params); $moduleInsertId = $result->getGeneratedValue(); /*$moduleInsertId = sqlInsert("insert into modules set mod_name='$name', mod_active='$state', mod_ui_name= '$uiname', mod_relative_link= '" . strtolower($rel_path) . "',".$typeSet." mod_directory='".mysql_escape_string($directory)."', date=NOW() ");*/ if (file_exists($GLOBALS['srcdir'] . "/../interface/modules/{$base}/{$added}{$directory}/moduleSettings.php")) { $ModuleObject = 'modules_' . strtolower($directory); $ModuleObjectTitle = 'Module ' . ucwords($directory); global $MODULESETTINGS; include_once $GLOBALS['srcdir'] . "/../interface/modules/{$base}/{$added}{$directory}/moduleSettings.php"; foreach ($MODULESETTINGS as $Settings => $SettingsArray) { if ($Settings == 'ACL') { $SettingsVal = 1; } elseif ($Settings == 'preferences') { $SettingsVal = 2; } else { $SettingsVal = 3; } $i = 0; foreach ($SettingsArray as $k => $v) { if ($SettingsVal == 1) { if ($i == 0) { addObjectSectionAcl($ModuleObject, $ModuleObjectTitle); } addObjectAcl($ModuleObject, $ModuleObjectTitle, $k, $v['menu_name']); $i++; } /*sqlStatement("INSERT INTO modules_settings VALUES (?,?,?,?,?)",array($moduleInsertId,$SettingsVal,$k,$v['menu_name'],$v['[path']));*/ $sql = "INSERT INTO modules_settings VALUES (?,?,?,?,?)"; $params = array($moduleInsertId, $SettingsVal, $k, $v['menu_name'], $v['[path']); $result = $this->applicationTable->sqlQuery($sql, $params); } } } /*sqlStatement("INSERT INTO module_acl_sections VALUES (?,?,?,?)",array($moduleInsertId,$name,0,strtolower($directory)));*/ $sql = "INSERT INTO module_acl_sections VALUES (?,?,?,?,?)"; $params = array($moduleInsertId, $name, 0, strtolower($directory), $moduleInsertId); $result = $this->applicationTable->sqlQuery($sql, $params); return $moduleInsertId; } return false; }
$acl_version = $upgrade_acl; } // Upgrade for acl_version 3 $upgrade_acl = 3; if ($acl_version < $upgrade_acl) { echo "<B>UPGRADING ACCESS CONTROLS TO VERSION " . $upgrade_acl . ":</B></BR>"; //Collect the ACL ID numbers. echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>"; //Get Administrator ACL ID number $admin_write = getAclIdNumber('Administrators', 'write'); //Get Emergency ACL ID number $emergency_write = getAclIdNumber('Emergency Login', 'write'); //Add new object Sections echo "<BR/><B>Adding new object sections</B><BR/>"; //Add 'Menus' object section (added in 4.1.3) addObjectSectionAcl('menus', 'Menus'); //Add new Objects echo "<BR/><B>Adding new objects</B><BR/>"; //Add 'modules' object (added in 4.1.3) addObjectAcl('menus', 'Menus', 'modle', 'Modules'); //Update already existing Objects echo "<BR/><B>Upgrading objects</B><BR/>"; //Add new ACLs here (will return the ACL ID of newly created or already existant ACL) // (will also place in the appropriate group and CREATE a new group if needed) echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>"; //Update the ACLs echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>"; //Insert the 'Modules' object from the 'Menus' section into the Administrators group write ACL (added in 4.1.3) updateAcl($admin_write, 'Administrators', 'menus', 'Menus', 'modle', 'Modules', 'write'); //Insert the 'Modules' object from the 'Menus' section into the Emergency Login group write ACL (added in 4.1.3) updateAcl($emergency_write, 'Emergency Login', 'menus', 'Menus', 'modle', 'Modules', '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 object Sections echo "<BR/><B>Adding new object sections</B><BR/>"; //Add 'Sensitivities' object section (added in 2.8.2) addObjectSectionAcl('sensitivities', 'Sensitivities'); //Add 'Lists' object section (added in 3.0.2) addObjectSectionAcl('lists', 'Lists'); //Add 'Placeholder' object section (added in 3.0.2) addObjectSectionAcl('placeholder', 'Placeholder'); //Add 'Nation Notes' object section (added in 4.1.0) addObjectSectionAcl('nationnotes', 'Nation Notes'); //Add new Objects echo "<BR/><B>Adding new objects</B><BR/>"; //Add 'Normal' sensitivity object, order variable is default 10 (added in 2.8.2) addObjectAcl('sensitivities', 'Sensitivities', 'normal', 'Normal'); //Add 'High' sensitivity object, order variable is set to 20 (added in 2.8.2) addObjectAclWithOrder('sensitivities', 'Sensitivities', 'high', 'High', 20); //Add 'Pharmacy Dispensary' object (added in 2.8.4) addObjectAcl('admin', 'Administration', 'drugs', 'Pharmacy Dispensary'); //Add 'ACL Administration' object (added in 2.8.4) addObjectAcl('admin', 'Administration', 'acl', 'ACL Administration'); //Add 'Price Discounting' object (added in 2.8.4) addObjectAcl('acct', 'Accounting', 'disc', 'Price Discounting'); //Add 'Default List (write,addonly optional)' object (added in 3.0.2) addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)'); //Add 'State List (write,addonly optional)' object (added in 3.0.2)