database-upgrade

.
This commit is contained in:
Paula V. Quispe
2016-08-18 12:21:29 -04:00
parent 3ef9f577e8
commit fc92f308ed
7 changed files with 34 additions and 21 deletions

View File

@@ -5433,8 +5433,9 @@ class G
public static function auditLog($actionToLog, $valueToLog = "") public static function auditLog($actionToLog, $valueToLog = "")
{ {
$workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined'; $workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
$oServerConf = & serverConf::getSingleton(); $conf = new Configurations();
$sflagAudit = $oServerConf->getAuditLogProperty( 'AL_OPTION', $workspace ); $sflag = $conf->getConfiguration('AUDIT_LOG', 'log');
$sflagAudit = $sflag == 'true' ? true : false;
$ipClient = G::getIpAddress(); $ipClient = G::getIpAddress();
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/

View File

@@ -88,9 +88,9 @@ class Configurations // extends Configuration
} }
} }
public function exists($cfgID) public function exists($cfgID,$objID='')
{ {
return $this->Configuration->exists($cfgID,"",'','',''); return $this->Configuration->exists($cfgID,$objID,'','','');
} }
/** /**

View File

@@ -763,6 +763,9 @@ class workspaceTools
$this->checkSequenceNumber(); $this->checkSequenceNumber();
$this->migrateIteeToDummytask($this->name); $this->migrateIteeToDummytask($this->name);
$this->upgradeConfiguration(); $this->upgradeConfiguration();
/*----------------------------------********---------------------------------*/
$this->upgradeAuditLog($this->name);
/*----------------------------------********---------------------------------*/
//There records in table "EMAIL_SERVER" //There records in table "EMAIL_SERVER"
$criteria = new Criteria("workflow"); $criteria = new Criteria("workflow");
@@ -3274,4 +3277,16 @@ class workspaceTools
$conf->saveConfig('SKIN_CRON', ''); $conf->saveConfig('SKIN_CRON', '');
} }
public function upgradeAuditLog($workspace){
G::LoadClass("configuration");
$conf = new Configurations();
if (!$conf->exists('AUDIT_LOG','log')) {
CLI::logging("> Updating Auditlog Config \n");
$oServerConf = &serverConf::getSingleton();
$sAudit = $oServerConf->getAuditLogProperty('AL_OPTION', $workspace);
$conf->aConfig = ($sAudit == 1) ? 'true' : 'false';
$conf->saveConfig('AUDIT_LOG', 'log');
}
}
} }

View File

@@ -61526,7 +61526,8 @@ INSERT INTO CONFIGURATION (CFG_UID,OBJ_UID,CFG_VALUE,PRO_UID,USR_UID,APP_UID) VA
('ENVIRONMENT_SETTINGS','','a:1:{s:18:"directoryStructure";i:2;}','','',''), ('ENVIRONMENT_SETTINGS','','a:1:{s:18:"directoryStructure";i:2;}','','',''),
('MIGRATED_LIST','list','true','list','list','list'), ('MIGRATED_LIST','list','true','list','list','list'),
('MIGRATED_LIST_UNASSIGNED','list','true','list','list','list'), ('MIGRATED_LIST_UNASSIGNED','list','true','list','list','list'),
('SKIN_CRON','','s:10:"neoclassic";','','',''); ('SKIN_CRON','','s:10:"neoclassic";','','',''),
('AUDIT_LOG','log','s:5:"false";','','','');
INSERT INTO CATALOG (CAT_UID, CAT_LABEL_ID, CAT_TYPE, CAT_FLAG, CAT_OBSERVATION, CAT_CREATE_DATE, CAT_UPDATE_DATE) VALUES INSERT INTO CATALOG (CAT_UID, CAT_LABEL_ID, CAT_TYPE, CAT_FLAG, CAT_OBSERVATION, CAT_CREATE_DATE, CAT_UPDATE_DATE) VALUES
('10','ID_BARS','GRAPHIC','','','2015-03-04','2015-03-04'), ('10','ID_BARS','GRAPHIC','','','2015-03-04','2015-03-04'),

View File

@@ -27,8 +27,8 @@ global $RBAC;
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false; $partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$oServerConf = &serverConf::getSingleton(); $conf = new Configurations();
$sAudit = $oServerConf->getAuditLogProperty('AL_OPTION', SYS_SYS); $sAudit = $conf->getConfiguration('AUDIT_LOG', 'log');
$licensedFeatures = &PMLicensedFeatures::getSingleton(); $licensedFeatures = &PMLicensedFeatures::getSingleton();
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
if ($RBAC->userCanAccess('PM_SETUP') === 1) { if ($RBAC->userCanAccess('PM_SETUP') === 1) {

View File

@@ -3,13 +3,10 @@
global $RBAC; global $RBAC;
$RBAC->requirePermissions( 'PM_SETUP' ); $RBAC->requirePermissions( 'PM_SETUP' );
$oHeadPublisher = & headPublisher::getSingleton(); $conf = new Configurations();
G::LoadClass( 'serverConfiguration' ); $sflag = $conf->getConfiguration('AUDIT_LOG', 'log');
$oServerConf = & serverConf::getSingleton(); $auditLogChecked = $sflag == 'true' ? true : false;
$sflag = $oServerConf->getAuditLogProperty( 'AL_OPTION', SYS_SYS );
$auditLogChecked = $sflag == 1 ? true : false;
$oHeadPublisher->addExtJsScript( 'setup/auditLogConfig', true ); //adding a javascript file .js $oHeadPublisher->addExtJsScript( 'setup/auditLogConfig', true ); //adding a javascript file .js
$oHeadPublisher->assign( 'auditLogChecked', $auditLogChecked ); $oHeadPublisher->assign( 'auditLogChecked', $auditLogChecked );

View File

@@ -7,22 +7,21 @@ switch ($_GET['action']) {
G::LoadClass( 'serverConfiguration' ); G::LoadClass( 'serverConfiguration' );
$oServerConf = & serverConf::getSingleton(); $oServerConf = & serverConf::getSingleton();
$response = new $oServerConf; $response = new $oServerConf;
G::LoadClass("configuration");
$conf = new Configurations();
/*you can use SYS_TEMP or SYS_SYS ON AUDIT_LOG_CONF to save for each workspace*/ /*you can use SYS_TEMP or SYS_SYS ON AUDIT_LOG_CONF to save for each workspace*/
$oServerConf->unsetAuditLogProperty( 'AL_TYPE', SYS_SYS );
if (isset( $_POST['acceptAL'] )) { if (isset( $_POST['acceptAL'] )) {
$oServerConf->setAuditLogProperty( 'AL_OPTION', 1, SYS_SYS ); $conf->aConfig = 'true';
$oServerConf->unsetAuditLogProperty( 'AL_NEXT_DATE', SYS_SYS ); $conf->saveConfig('AUDIT_LOG', 'log');
$response->enable = true; $response->enable = true;
G::auditLog("EnableAuditLog"); G::auditLog("EnableAuditLog");
} else { } else {
G::auditLog("DisableAuditLog"); G::auditLog("DisableAuditLog");
$oServerConf->setAuditLogProperty( 'AL_OPTION', 0, SYS_SYS ); $conf->aConfig = 'false';
$oServerConf->unsetAuditLogProperty( 'AL_NEXT_DATE', SYS_SYS ); $conf->saveConfig('AUDIT_LOG', 'log');
$oServerConf->setAuditLogProperty( 'AL_TYPE', 'endaudit', SYS_SYS );
$response->enable = false; $response->enable = false;
} }
$response->success = true; $response->success = true;
} catch (Exception $e) { } catch (Exception $e) {
$response->success = false; $response->success = false;
$response->msg = $e->getMessage(); $response->msg = $e->getMessage();