BUG-12021 Improvements Audit Log

Improvements Audit Log
This commit is contained in:
norahmollo
2014-10-10 12:19:34 -04:00
parent 7f443cce8e
commit ca237e9230
28 changed files with 177 additions and 59 deletions

View File

@@ -69,7 +69,7 @@ class AuthenticationSource extends BaseAuthenticationSource {
$oConnection->begin(); $oConnection->begin();
$iResult = $oAuthenticationSource->save(); $iResult = $oAuthenticationSource->save();
$oConnection->commit(); $oConnection->commit();
G::auditLog("CreateAuthSource", $aData['AUTH_SOURCE_NAME']); G::auditLog("CreateAuthSource", "Authentication Source Name: ". $aData['AUTH_SOURCE_NAME']);
return $aData['AUTH_SOURCE_UID']; return $aData['AUTH_SOURCE_UID'];
} }
else { else {
@@ -98,7 +98,7 @@ class AuthenticationSource extends BaseAuthenticationSource {
$oConnection->begin(); $oConnection->begin();
$iResult = $oAuthenticationSource->save(); $iResult = $oAuthenticationSource->save();
$oConnection->commit(); $oConnection->commit();
G::auditLog("UpdateAuthSource", $aData['AUTH_SOURCE_NAME']." (".$aData['AUTH_SOURCE_UID'].") "); G::auditLog("UpdateAuthSource", "Authentication Source Name: ".$aData['AUTH_SOURCE_NAME']." Authentication Source ID: (".$aData['AUTH_SOURCE_UID'].") ");
return $iResult; return $iResult;
} }
else { else {
@@ -135,7 +135,7 @@ class AuthenticationSource extends BaseAuthenticationSource {
$iResult = $oAuthenticationSource->delete(); $iResult = $oAuthenticationSource->delete();
$oConnection->commit(); $oConnection->commit();
G::auditLog("DeleteAuthSource", $authenticationSource['AUTH_SOURCE_NAME']." (".$sUID.") "); G::auditLog("DeleteAuthSource", "Authentication Source Name: ".$authenticationSource['AUTH_SOURCE_NAME']." Authentication Source ID: (".$sUID.") ");
return $iResult; return $iResult;
} }
else { else {

View File

@@ -237,7 +237,7 @@ class Roles extends BaseRoles {
$result = $obj->save(); $result = $obj->save();
$con->commit(); $con->commit();
$obj->setRolName($rol_name); $obj->setRolName($rol_name);
G::auditLog("CreateRole", $rol_name); G::auditLog("CreateRole", "Role Name: ". $rol_name);
} else { } else {
$e = new Exception("Failed Validation in class " . get_class($this) . "."); $e = new Exception("Failed Validation in class " . get_class($this) . ".");
$e->aValidationFailures = $this->getValidationFailures(); $e->aValidationFailures = $this->getValidationFailures();
@@ -263,7 +263,7 @@ class Roles extends BaseRoles {
$result = $this->save(); $result = $this->save();
$con->commit(); $con->commit();
$this->setRolName($rol_name); $this->setRolName($rol_name);
G::auditLog("UpdateRole", $rol_name." (".$fields['ROL_UID'].") "); G::auditLog("UpdateRole", "Role Name: ".$rol_name." Role ID: (".$fields['ROL_UID'].") ");
return $result; return $result;
} else { } else {
$con->rollback(); $con->rollback();
@@ -284,7 +284,7 @@ class Roles extends BaseRoles {
Content::removeContent('ROL_NAME', '', $this->getRolUid()); Content::removeContent('ROL_NAME', '', $this->getRolUid());
$result = $this->delete(); $result = $this->delete();
$con->commit(); $con->commit();
G::auditLog("DeleteRole", $rol_name['ROL_NAME']." (".$ROL_UID.") "); G::auditLog("DeleteRole", "Role Name: ".$rol_name['ROL_NAME']." Role UID: (".$ROL_UID.") ");
return $result; return $result;
} catch( exception $e ) { } catch( exception $e ) {
$con->rollback(); $con->rollback();
@@ -645,7 +645,7 @@ class Roles extends BaseRoles {
$permission = $o->getPermissionName($PER_UID); $permission = $o->getPermissionName($PER_UID);
$role = $this->load($ROL_UID); $role = $this->load($ROL_UID);
G::auditLog("DeletePermissionToRole", "Delete Permission ".$permission." (".$PER_UID.") to Role ".$role['ROL_NAME']." (".$ROL_UID.") "); G::auditLog("DeletePermissionToRole", "Delete Permission ".$permission." (".$PER_UID.") from Role ".$role['ROL_NAME']." (".$ROL_UID.") ");
} }
function numUsersWithRole($ROL_UID) { function numUsersWithRole($ROL_UID) {

View File

@@ -201,7 +201,7 @@ class AdditionalTables extends BaseAdditionalTables
'SHD_DATE' => date('Y-m-d H:i:s'))); 'SHD_DATE' => date('Y-m-d H:i:s')));
*/ */
G::auditLog("CreatePMTable", $aData['ADD_TAB_NAME']); G::auditLog("CreatePmtable", "PM Table Name: ".$aData['ADD_TAB_NAME']);
return $aData['ADD_TAB_UID']; return $aData['ADD_TAB_UID'];
} else { } else {
$sMessage = ''; $sMessage = '';
@@ -228,7 +228,7 @@ class AdditionalTables extends BaseAdditionalTables
$oConnection->begin(); $oConnection->begin();
$iResult = $oAdditionalTables->save(); $iResult = $oAdditionalTables->save();
$oConnection->commit(); $oConnection->commit();
G::auditLog("UpdatePMTable", $aData['ADD_TAB_NAME']." (".$aData['ADD_TAB_UID'].") "); G::auditLog("UpdatePmtable", "PM Table Name: ".$aData['ADD_TAB_NAME']." PM Table ID: (".$aData['ADD_TAB_UID'].") ");
} else { } else {
$sMessage = ''; $sMessage = '';
$aValidationFailures = $oAdditionalTables->getValidationFailures(); $aValidationFailures = $oAdditionalTables->getValidationFailures();

View File

@@ -253,9 +253,9 @@ class CalendarDefinition extends BaseCalendarDefinition
if (! (is_object( $tr ) && get_class( $tr ) == 'CalendarDefinition')) { if (! (is_object( $tr ) && get_class( $tr ) == 'CalendarDefinition')) {
$tr = new CalendarDefinition(); $tr = new CalendarDefinition();
$tr->setCalendarCreateDate( 'now' ); $tr->setCalendarCreateDate( 'now' );
G::auditLog("CreateCalendar", $aData['CALENDAR_NAME']); G::auditLog("CreateCalendar", "Calendar Name: ".$aData['CALENDAR_NAME']);
} else { } else {
G::auditLog("UpdateCalendar", $aData['CALENDAR_NAME']." (".$CalendarUid.") "); G::auditLog("UpdateCalendar", "Calendar Name: ".$aData['CALENDAR_NAME']." Calendar ID: (".$CalendarUid.") ");
} }
$tr->setCalendarUid( $CalendarUid ); $tr->setCalendarUid( $CalendarUid );
@@ -320,7 +320,7 @@ class CalendarDefinition extends BaseCalendarDefinition
// we save it, since we get no validation errors, or do whatever else you like. // we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save(); $res = $tr->save();
$deletedCalendar = $tr->getCalendarName(); $deletedCalendar = $tr->getCalendarName();
G::auditLog("DeleteCalendar", $deletedCalendar." (".$CalendarUid.") "); G::auditLog("DeleteCalendar", "Calendar Name: ".$deletedCalendar." Calendar ID: (".$CalendarUid.") ");
} else { } else {
// Something went wrong. We can now get the validationFailures and handle them. // Something went wrong. We can now get the validationFailures and handle them.
$msg = ''; $msg = '';

View File

@@ -70,7 +70,7 @@ class DashletInstance extends BaseDashletInstance
$connection->commit(); $connection->commit();
$dashletData = $this->load($data['DAS_INS_UID']); $dashletData = $this->load($data['DAS_INS_UID']);
G::auditLog($msg, $dashletData['DAS_INS_TITLE']." (".$dashletData['DAS_INS_UID'].") "); G::auditLog($msg, "Dashlet Instance Name: ".$dashletData['DAS_INS_TITLE']." Dashlet Instance ID: (".$dashletData['DAS_INS_UID'].") ");
return $data['DAS_INS_UID']; return $data['DAS_INS_UID'];
} else { } else {
@@ -98,7 +98,7 @@ class DashletInstance extends BaseDashletInstance
$result = $dashletInstance->delete(); $result = $dashletInstance->delete();
$connection->commit(); $connection->commit();
G::auditLog("DeleteDashletInstance", $dashletData['DAS_INS_TITLE']." (".$dasInsUid.") "); G::auditLog("DeleteDashletInstance", "Dashlet Instance Name: ". $dashletData['DAS_INS_TITLE']." Dashlet Instance ID: (".$dasInsUid.") ");
return $result; return $result;
} else { } else {
throw new Exception('Error trying to delete: The row "' . $dasInsUid. '" does not exist.'); throw new Exception('Error trying to delete: The row "' . $dasInsUid. '" does not exist.');

View File

@@ -115,7 +115,7 @@ class Department extends BaseDepartment
$con->commit(); $con->commit();
G::auditLog("Create ".$msgLog, $aData['DEP_TITLE']); G::auditLog("Create".$msgLog, $msgLog." Name: ". $aData['DEP_TITLE']);
return $this->getDepUid(); return $this->getDepUid();
} else { } else {
@@ -290,7 +290,7 @@ class Department extends BaseDepartment
Content::removeContent( 'DEPO_TITLE', '', $oPro->getDepUid() ); Content::removeContent( 'DEPO_TITLE', '', $oPro->getDepUid() );
Content::removeContent( 'DEPO_DESCRIPTION', '', $oPro->getDepUid() ); Content::removeContent( 'DEPO_DESCRIPTION', '', $oPro->getDepUid() );
G::auditLog("DeleteDepartament", $dptoTitle['DEPO_TITLE']." (".$oPro->getDepUid().") "); G::auditLog("DeleteDepartament", "Departament Name: ".$dptoTitle['DEPO_TITLE']." Departament ID: (".$oPro->getDepUid().") ");
return $oPro->delete(); return $oPro->delete();
} else { } else {
throw (new Exception( "The row '$ProUid' in table Group doesn't exist!" )); throw (new Exception( "The row '$ProUid' in table Group doesn't exist!" ));

View File

@@ -98,7 +98,7 @@ class GroupUser extends BaseGroupUser
$oUsr = new Users(); $oUsr = new Users();
$usrName = $oUsr->load($sUserUid); $usrName = $oUsr->load($sUserUid);
G::auditLog("AssignUsersToGroup", "Remove user ". $usrName['USR_USERNAME'] ." (".$sUserUid.") from group ".$grpName['CON_VALUE']." (".$sGrpUid.") "); G::auditLog("AssignUsersToGroup", "Remove user: ".$usrName['USR_USERNAME'] ." (".$sUserUid.") from group ".$grpName['CON_VALUE']." (".$sGrpUid.") ");
return $iResult; return $iResult;
} else { } else {

View File

@@ -301,7 +301,7 @@ class Language extends BaseLanguage
$results->headers = $POHeaders; $results->headers = $POHeaders;
$results->errMsg = $errorMsg; $results->errMsg = $errorMsg;
G::auditLog("UploadLanguage", $languageID); G::auditLog("UploadLanguage", "Language: ".$languageID);
return $results; return $results;
} catch (Exception $oError) { } catch (Exception $oError) {
@@ -551,7 +551,7 @@ class Language extends BaseLanguage
} }
} //end foreach } //end foreach
} }
G::auditLog("ExportLanguage", $_GET['LOCALE']); G::auditLog("ExportLanguage", "Language: ".$_GET['LOCALE']);
G::streamFile( $sPOFile, true ); G::streamFile( $sPOFile, true );
} }
public function updateLanguagePlugin ($plugin, $idLanguage) public function updateLanguagePlugin ($plugin, $idLanguage)

View File

@@ -454,7 +454,7 @@ class Translation extends BaseTranslation
if (file_exists( PATH_CORE . PATH_SEP . 'content' . PATH_SEP . 'translations' . PATH_SEP . 'processmaker' . $locale . '.po' )) { if (file_exists( PATH_CORE . PATH_SEP . 'content' . PATH_SEP . 'translations' . PATH_SEP . 'processmaker' . $locale . '.po' )) {
G::rm_dir( PATH_CORE . PATH_SEP . 'content' . PATH_SEP . 'translations' . PATH_SEP . 'processmaker' . $locale . '.po' ); G::rm_dir( PATH_CORE . PATH_SEP . 'content' . PATH_SEP . 'translations' . PATH_SEP . 'processmaker' . $locale . '.po' );
} }
G::auditLog("DeleteLanguage", $locale); G::auditLog("DeleteLanguage", "Language: ".$locale);
} }
} }

View File

@@ -1056,7 +1056,7 @@ class adminProxy extends HttpProxyController
try { try {
list($imageWidth, $imageHeight, $imageType) = @getimagesize($dir . '/' . 'tmp' . $fileName); list($imageWidth, $imageHeight, $imageType) = @getimagesize($dir . '/' . 'tmp' . $fileName);
G::resizeImage($dir . '/tmp' . $fileName, $imageWidth, 49, $dir . '/' . $fileName); G::resizeImage($dir . '/tmp' . $fileName, $imageWidth, 49, $dir . '/' . $fileName);
G::auditLog("UploadLogo", $fileName); G::auditLog("UploadLogo", "File Name: ".$fileName);
} catch (Exception $e) { } catch (Exception $e) {
$error = $e->getMessage(); $error = $e->getMessage();
} }
@@ -1138,7 +1138,7 @@ class adminProxy extends HttpProxyController
if (file_exists($dir . '/tmp' . $imgname)) { if (file_exists($dir . '/tmp' . $imgname)) {
unlink ($dir . '/tmp' . $imgname); unlink ($dir . '/tmp' . $imgname);
} }
G::auditLog("DeleteLogo", $imgname); G::auditLog("DeleteLogo", "File Name: ".$imgname);
} else { } else {
echo '{success: false}'; echo '{success: false}';
exit(); exit();
@@ -1191,7 +1191,7 @@ class adminProxy extends HttpProxyController
$oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '', ''); $oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '', '');
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels'); G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels');
G::auditLog("ReplaceLogo", $snameLogo); G::auditLog("ReplaceLogo", "File Name: ".$snameLogo);
break; break;
case 'restoreLogo': case 'restoreLogo':

View File

@@ -410,7 +410,7 @@ class pmTablesProxy extends HttpProxyController
if ($errors == '') { if ($errors == '') {
$result->success = true; $result->success = true;
$result->message = $count.G::LoadTranslation( 'ID_TABLES_REMOVED_SUCCESSFULLY' ); $result->message = $count.G::LoadTranslation( 'ID_TABLES_REMOVED_SUCCESSFULLY' );
G::auditLog("DeletePMTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") "); G::auditLog("DeletePmtable", "Table Name: ".$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
} else { } else {
$result->success = false; $result->success = false;
$result->message = $count. G::LoadTranslation( 'ID_TABLES_REMOVED_WITH_ERRORS' ) .$errors; $result->message = $count. G::LoadTranslation( 'ID_TABLES_REMOVED_WITH_ERRORS' ) .$errors;
@@ -509,7 +509,7 @@ class pmTablesProxy extends HttpProxyController
if ($obj->validate()) { if ($obj->validate()) {
$obj->save(); $obj->save();
$toSave = true; $toSave = true;
G::auditLog("AddDataInPMTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") "); G::auditLog("AddDataInPMTable", "Table Name: "$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
$primaryKeysValues = array (); $primaryKeysValues = array ();
foreach ($primaryKeys as $primaryKey) { foreach ($primaryKeys as $primaryKey) {
$method = 'get' . AdditionalTables::getPHPName( $primaryKey['FLD_NAME'] ); $method = 'get' . AdditionalTables::getPHPName( $primaryKey['FLD_NAME'] );
@@ -582,7 +582,7 @@ class pmTablesProxy extends HttpProxyController
} }
if ($result) { if ($result) {
G::auditLog("UpdateDataInPMTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") "); G::auditLog("UpdateDataInPMTable", "Table Name: ".$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
} }
$this->success = $result; $this->success = $result;
@@ -609,7 +609,7 @@ class pmTablesProxy extends HttpProxyController
require_once $sPath . $this->className . '.php'; require_once $sPath . $this->className . '.php';
G::auditLog("DeleteDataInPMTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") "); G::auditLog("DeleteDataInPMTable", "Table Name: ".$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
$this->success = $this->_dataDestroy( $httpData->rows ); $this->success = $this->_dataDestroy( $httpData->rows );
$this->message = $this->success ? G::loadTranslation( 'ID_DELETED_SUCCESSFULLY' ) : G::loadTranslation( 'ID_DELETE_FAILED' ); $this->message = $this->success ? G::loadTranslation( 'ID_DELETED_SUCCESSFULLY' ) : G::loadTranslation( 'ID_DELETE_FAILED' );
@@ -685,7 +685,7 @@ class pmTablesProxy extends HttpProxyController
$this->success = true; $this->success = true;
$this->message = G::loadTranslation( 'ID_FILE_IMPORTED_SUCCESSFULLY', array ($filename $this->message = G::loadTranslation( 'ID_FILE_IMPORTED_SUCCESSFULLY', array ($filename
) ); ) );
G::auditLog("ImportTable", $filename); G::auditLog("ImportTable", "Table Name: ".$filename);
} }
} else { } else {
$sMessage = G::LoadTranslation( 'ID_UPLOAD_VALID_CSV_FILE' ); $sMessage = G::LoadTranslation( 'ID_UPLOAD_VALID_CSV_FILE' );
@@ -927,7 +927,7 @@ class pmTablesProxy extends HttpProxyController
// is a report table, try populate it // is a report table, try populate it
$additionalTable->populateReportTable( $table['ADD_TAB_NAME'], pmTable::resolveDbSource( $table['DBS_UID'] ), $table['ADD_TAB_TYPE'], $table['PRO_UID'], $table['ADD_TAB_GRID'], $table['ADD_TAB_UID'] ); $additionalTable->populateReportTable( $table['ADD_TAB_NAME'], pmTable::resolveDbSource( $table['DBS_UID'] ), $table['ADD_TAB_TYPE'], $table['PRO_UID'], $table['ADD_TAB_GRID'], $table['ADD_TAB_UID'] );
} }
G::auditLog("ImportTable", $table['ADD_TAB_NAME']." (".$table['ADD_TAB_UID'].") "); G::auditLog("ImportTable", "Table Name: ".$table['ADD_TAB_NAME']." Table ID: (".$table['ADD_TAB_UID'].") ");
break; break;
case '@DATA': case '@DATA':
$fstName = intval( fread( $fp, 9 ) ); $fstName = intval( fread( $fp, 9 ) );
@@ -1113,7 +1113,7 @@ class pmTablesProxy extends HttpProxyController
$bytesSaved += fwrite( $fp, $fsData ); //writing the size of xml file $bytesSaved += fwrite( $fp, $fsData ); //writing the size of xml file
$bytesSaved += fwrite( $fp, $SDATA ); //writing the xmlfile $bytesSaved += fwrite( $fp, $SDATA ); //writing the xmlfile
} }
G::auditLog("ExportTable", $table->ADD_TAB_NAME." (".$table->ADD_TAB_UID.") "); G::auditLog("ExportTable", "Table Name: ".$table->ADD_TAB_NAME." Table ID: (".$table->ADD_TAB_UID.") ");
} }
fclose( $fp ); fclose( $fp );

View File

@@ -99,7 +99,7 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) {
$G_TMP_MENU->AddIdRawOption("CRON", "../setup/cron", G::LoadTranslation("ID_CRON_ACTIONS"), null, null, "logs"); $G_TMP_MENU->AddIdRawOption("CRON", "../setup/cron", G::LoadTranslation("ID_CRON_ACTIONS"), null, null, "logs");
$G_TMP_MENU->AddIdRawOption('EMAILS', '../mails/emailList', ucfirst (strtolower ( G::LoadTranslation('ID_EMAILS'))), '', '', 'logs'); $G_TMP_MENU->AddIdRawOption('EMAILS', '../mails/emailList', ucfirst (strtolower ( G::LoadTranslation('ID_EMAILS'))), '', '', 'logs');
if (isset($sAudit) && $sAudit != false) { if (isset($sAudit) && $sAudit != false) {
$G_TMP_MENU->AddIdRawOption('AUDIT_LOG', '../setup/auditLog', ucfirst (strtolower ( G::LoadTranslation('ID_AUDITLOG_DISPLAY'))), '', '', 'logs'); $G_TMP_MENU->AddIdRawOption('AUDIT_LOG', '../setup/auditLog', ucfirst (G::LoadTranslation('ID_AUDITLOG_DISPLAY')), '', '', 'logs');
} }
} }

View File

@@ -650,7 +650,7 @@ function fieldSave()
} }
G::auditLog("Set ".$list." List Columns", $msgLog); G::auditLog("SetColumns", "Set ".$list." List Columns".$msgLog);
echo G::json_encode($result); echo G::json_encode($result);
} }

View File

@@ -235,9 +235,9 @@ switch ($_POST['action']) {
$oDept->updateDepartmentManager( $dep_uid ); $oDept->updateDepartmentManager( $dep_uid );
if ($dep_parent == '') { if ($dep_parent == '') {
G::auditLog("UpdateDepartament", $dep_name." (".$dep_uid.") "); G::auditLog("UpdateDepartament", "Departament Name: ".$dep_name." (".$dep_uid.") ");
} else { } else {
G::auditLog("UpdateSubDepartament", $dep_name." (".$dep_uid.") "); G::auditLog("UpdateSubDepartament", "Sub Departament Name: ".$dep_name." (".$dep_uid.") ");
} }
echo '{success: true}'; echo '{success: true}';

View File

@@ -179,9 +179,9 @@ try {
$result["success"] = $addon->setEnabled(($action == "enable")); $result["success"] = $addon->setEnabled(($action == "enable"));
if ($action == "enable") { if ($action == "enable") {
G::auditLog("EnablePlugin", $_REQUEST['addon']); G::auditLog("EnablePlugin", "Plugin Name: ".$_REQUEST['addon']);
} else { } else {
G::auditLog("DisablePlugin", $_REQUEST['addon']); G::auditLog("DisablePlugin", "Plugin Name: ".$_REQUEST['addon']);
} }
break; break;

View File

@@ -270,7 +270,7 @@ switch ($option) {
if ($result["status"] == "OK") { if ($result["status"] == "OK") {
$response["status"] = $result["status"]; //OK $response["status"] = $result["status"]; //OK
$response["message"] = $result["message"]; $response["message"] = $result["message"];
G::auditLog("InstallPlugin", $file); G::auditLog("InstallPlugin", "Plugin Name: ".$file);
} else { } else {
throw (new Exception($result["message"])); throw (new Exception($result["message"]));
} }

View File

@@ -149,7 +149,7 @@ switch ($_POST['action']) {
unset( $newGroup['GRP_UID'] ); unset( $newGroup['GRP_UID'] );
$group = new Groupwf(); $group = new Groupwf();
$group->create( $newGroup ); $group->create( $newGroup );
G::auditLog("CreateGroup", $newGroup['GRP_TITLE']); G::auditLog("CreateGroup", "Group Name: ".$newGroup['GRP_TITLE']);
echo '{success: true}'; echo '{success: true}';
@@ -161,7 +161,7 @@ switch ($_POST['action']) {
$editGroup['GRP_TITLE'] = trim( $_POST['name'] ); $editGroup['GRP_TITLE'] = trim( $_POST['name'] );
$group = new Groupwf(); $group = new Groupwf();
$group->update( $editGroup ); $group->update( $editGroup );
G::auditLog("UpdateGroup", $editGroup['GRP_TITLE']." (".$_POST['grp_uid'].") "); G::auditLog("UpdateGroup", "Group Name: ".$editGroup['GRP_TITLE']." Group ID: (".$_POST['grp_uid'].") ");
echo '{success: true}'; echo '{success: true}';
break; break;
case 'deleteGroup': case 'deleteGroup':
@@ -171,7 +171,7 @@ switch ($_POST['action']) {
return; return;
} }
$group->remove( urldecode( $_POST['GRP_UID'] ) ); $group->remove( urldecode( $_POST['GRP_UID'] ) );
G::auditLog("DeleteGroup", $_POST['GRP_NAME']." (".$_POST['GRP_UID'].") "); G::auditLog("DeleteGroup", "Group Name: ".$_POST['GRP_NAME']." Group ID: (".$_POST['GRP_UID'].") ");
require_once 'classes/model/TaskUser.php'; require_once 'classes/model/TaskUser.php';
$oProcess = new TaskUser(); $oProcess = new TaskUser();
$oCriteria = new Criteria( 'workflow' ); $oCriteria = new Criteria( 'workflow' );

View File

@@ -104,7 +104,7 @@ if (isset( $_REQUEST['action'] )) {
$pcat->setCategoryUid( G::GenerateUniqueID() ); $pcat->setCategoryUid( G::GenerateUniqueID() );
$pcat->setCategoryName( $catName ); $pcat->setCategoryName( $catName );
$pcat->save(); $pcat->save();
G::auditLog("CreateCategory", $catName); G::auditLog("CreateCategory", "Category Name: ".$catName);
echo '{success: true}'; echo '{success: true}';
} catch (Exception $ex) { } catch (Exception $ex) {
echo '{success: false, error: ' . $ex->getMessage() . '}'; echo '{success: false, error: ' . $ex->getMessage() . '}';
@@ -135,7 +135,7 @@ if (isset( $_REQUEST['action'] )) {
$pcat->setCategoryUid( $catUID ); $pcat->setCategoryUid( $catUID );
$pcat->setCategoryName( $catName ); $pcat->setCategoryName( $catName );
$pcat->save(); $pcat->save();
g::auditLog("UpdateCategory", $catName." (".$catUID.") "); g::auditLog("UpdateCategory", "Category Name: ".$catName." Category ID: (".$catUID.") ");
echo '{success: true}'; echo '{success: true}';
} catch (Exception $ex) { } catch (Exception $ex) {
echo '{success: false, error: ' . $ex->getMessage() . '}'; echo '{success: false, error: ' . $ex->getMessage() . '}';
@@ -157,7 +157,7 @@ if (isset( $_REQUEST['action'] )) {
$cat->setCategoryUid( $catUID ); $cat->setCategoryUid( $catUID );
$catName = $cat->loadByCategoryId( $catUID ); $catName = $cat->loadByCategoryId( $catUID );
$cat->delete(); $cat->delete();
G::auditLog("DeleteCategory", $catName." (".$catUID.") "); G::auditLog("DeleteCategory", "Category Name: ".$catName." Category ID: (".$catUID.") ");
echo '{success: true}'; echo '{success: true}';
} catch (Exception $ex) { } catch (Exception $ex) {
echo '{success: false, error: ' . $ex->getMessage() . '}'; echo '{success: false, error: ' . $ex->getMessage() . '}';

View File

@@ -12,7 +12,83 @@ $configPage = $c->getConfiguration( "auditLogList", "pageSize", null, $_SESSION[
$config = array (); $config = array ();
$config["pageSize"] = (isset( $configPage["pageSize"] )) ? $configPage["pageSize"] : 20; $config["pageSize"] = (isset( $configPage["pageSize"] )) ? $configPage["pageSize"] : 20;
$arrayAction = array (array ("ALL", G::LoadTranslation( "ID_ALL" )),
array ("CreateUser", G::LoadTranslation( "ID_CREATE_USER" )),
array ("UpdateUser", G::LoadTranslation( "ID_UPDATE_USER" )),
array ("DeleteUser", G::LoadTranslation( "ID_DELETE_USER" )),
array ("EnableUser", G::LoadTranslation( "ID_ENABLE_USER" )),
array ("DisableUser", G::LoadTranslation( "ID_DISABLE_USER" )),
array ("AssignAuthenticationSource", G::LoadTranslation( "ID_ASSIGN_AUTHENTICATION_SOURCE" )),
array ("AssignUsersToGroup", G::LoadTranslation( "ID_ASSIGN_USER_TO_GROUP" )),
array ("CreateAuthSource", G::LoadTranslation( "ID_CREATE_AUTH_SOURCE" )),
array ("UpdateAuthSource", G::LoadTranslation( "ID_UPDATE_AUTH_SOURCE" )),
array ("DeleteAuthSource", G::LoadTranslation( "ID_DELETE_AUTH_SOURCE" )),
array ("CreateRole", G::LoadTranslation( "ID_CREATE_ROLE" )),
array ("UpdateRole", G::LoadTranslation( "ID_UPDATE_ROLE" )),
array ("DeleteRole", G::LoadTranslation( "ID_DELETE_ROLE" )),
array ("AssignUsersToRole", G::LoadTranslation( "ID_ASSIGN_USER_TO_ROLE" )),
array ("DeleteUsersToRole", G::LoadTranslation( "ID_DELETE_USER_TO_ROLE" )),
array ("AddPermissionToRole", G::LoadTranslation( "ID_ADD_PERMISSION_TO_ROLE" )),
array ("DeletePermissionToRole", G::LoadTranslation( "ID_DELETE_PERMISSION_TO_ROLE" )),
array ("CreateSkin", G::LoadTranslation( "ID_CREATE_SKIN" )),
array ("ImportSkin", G::LoadTranslation( "ID_IMPORT_SKIN" )),
array ("ExportSkin", G::LoadTranslation( "ID_EXPORT_SKIN" )),
array ("DeleteSkin", G::LoadTranslation( "ID_DELETE_SKIN" )),
array ("CreateGroup", G::LoadTranslation( "ID_CREATE_GROUP" )),
array ("UpdateGroup", G::LoadTranslation( "ID_UPDATE_GROUP" )),
array ("DeleteGroup", G::LoadTranslation( "ID_DELETE_GROUP" )),
array ("CreateCategory", G::LoadTranslation( "ID_CREATE_CATEGORY" )),
array ("UpdateCategory", G::LoadTranslation( "ID_UPDATE_CATEGORY" )),
array ("DeleteCategory", G::LoadTranslation( "ID_DELETE_CATEGORY" )),
array ("BuildCache", G::LoadTranslation( "ID_BUILD_CACHE" )),
array ("ClearCache", G::LoadTranslation( "ID_CLEAR_CACHE" )),
array ("ClearCron", G::LoadTranslation( "ID_CLEAR_CRON" )),
array ("UpdateEnvironmentSettings", G::LoadTranslation( "ID_UPDATE_ENVIRONMENTS_SETTINGS" )),
array ("UpdateLoginSettings", G::LoadTranslation( "ID_UPDATE_LOGIN_SETTINGS" )),
array ("EnableHeartBeat", G::LoadTranslation( "ID_ENABLE_HEART_BEAT" )),
array ("DisableHeartBeat", G::LoadTranslation( "ID_DISABLE_HEART_BEAT" )),
array ("CreatePmtable", G::LoadTranslation( "ID_CREATE_PMTABLE" )),
array ("UpdatePmtable", G::LoadTranslation( "ID_UPDATE_PMTABLE" )),
array ("DeletePmtable", G::LoadTranslation( "ID_DELETE_PMTABLE" )),
array ("AddDataPmtable", G::LoadTranslation( "ID_ADD_DATA_PMTABLE" )),
array ("UpdateDataPmtable", G::LoadTranslation( "ID_UPDATE_DATA_PMTABLE" )),
array ("DeleteDataPmtable", G::LoadTranslation( "ID_DELETE_DATA_PMTABLE" )),
array ("ImportTable", G::LoadTranslation( "ID_IMPORT_TABLE" )),
array ("ExportTable", G::LoadTranslation( "ID_EXPORT_TABLE" )),
array ("CreateCalendar", G::LoadTranslation( "ID_CREATE_CALENDAR" )),
array ("UpdateCalendar", G::LoadTranslation( "ID_UPDATE_CALENDAR" )),
array ("DeleteCalendar", G::LoadTranslation( "ID_DELETE_CALENDAR" )),
array ("CreateDashletInstance", G::LoadTranslation( "ID_CREATE_DASHLET_INSTANCE" )),
array ("UpdateDashletInstance", G::LoadTranslation( "ID_UPDATE_DASHLET_INSTANCE" )),
array ("DeleteDashletInstance", G::LoadTranslation( "ID_DELETE_DASHLET_INSTANCE" )),
array ("CreateDepartament", G::LoadTranslation( "ID_CREATE_DEPARTAMENT" )),
array ("CreateSubDepartament", G::LoadTranslation( "ID_CREATE_SUB_DEPARTAMENT" )),
array ("UpdateDepartament", G::LoadTranslation( "ID_UPDATE_DEPARTAMENT" )),
array ("UpdateSubDepartament", G::LoadTranslation( "ID_UPDATE_SUB_DEPARTAMENT" )),
array ("DeleteDepartament", G::LoadTranslation( "ID_DELETE_DEPARTAMENT" )),
array ("AssignManagerToDepartament", G::LoadTranslation( "ID_ASSIGN_MANAGER_TO_DEPARTAMENT" )),
array ("AssignUsersToDepartament", G::LoadTranslation( "ID_ASSIGN_USER_TO_DEPARTAMENT" )),
array ("RemoveUsersFromDepartament", G::LoadTranslation( "ID_REMOVE_USERS_FROM_DEPARTAMENT" )),
array ("AssignUsersToGroup", G::LoadTranslation( "ID_ASSIGN_USER_TO_GROUP" )),
array ("UploadLanguage", G::LoadTranslation( "ID_UPLOAD_LANGUAGE" )),
array ("ExportLanguage", G::LoadTranslation( "ID_EXPORT_LANGUAGE" )),
array ("DeleteLanguage", G::LoadTranslation( "ID_DELETE_LAGUAGE" )),
array ("UploadSystemSettings", G::LoadTranslation( "ID_UPLOAD_SYSTEM_SETTINGS" )),
array ("UpdateEmailSettings", G::LoadTranslation( "ID_UPDATE_EMAIL_SETTINGS" )),
array ("CreateEmailSettings", G::LoadTranslation( "ID_CREATE_EMAIL_SETTINGS" )),
array ("UploadLogo", G::LoadTranslation( "ID_UPLOAD_LOGO" )),
array ("DeleteLogo", G::LoadTranslation( "ID_DELETE_LOGO" )),
array ("RestoreLogo", G::LoadTranslation( "ID_RESTORE_LOGO" )),
array ("InstallPlugin", G::LoadTranslation( "ID_INSTALL_PLUGIN" )),
array ("EnablePlugin", G::LoadTranslation( "ID_ENABLE_PLUGIN" )),
array ("DisablePlugin", G::LoadTranslation( "ID_DISABLE_PLUGIN" )),
array ("SetColumns", G::LoadTranslation( "ID_SET_COLUMNS" )),
array ("EnableAuditLog", G::LoadTranslation( "ID_ENABLE_AUDIT_LOG" )),
array ("DisableAuditLog", G::LoadTranslation( "ID_DISABLE_AUDIT_LOG" )),
);
$oHeadPublisher = &headPublisher::getSingleton(); $oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( "setup/auditLog", true ); $oHeadPublisher->addExtJsScript( "setup/auditLog", true );
$oHeadPublisher->assign( "CONFIG", $config ); $oHeadPublisher->assign( "CONFIG", $config );
$oHeadPublisher->assign( "ACTION", $arrayAction );
G::RenderPage( "publish", "extJs" ); G::RenderPage( "publish", "extJs" );

View File

@@ -33,6 +33,12 @@ function auditLogArraySet ($str, $filter)
$sw = 0; $sw = 0;
} }
if ($filter["action"] != "ALL") {
if ($action != $filter["action"]) {
$sw = 0;
}
}
if ($filter["dateFrom"] && $mktDate > 0) { if ($filter["dateFrom"] && $mktDate > 0) {
if (! (mktimeDate( $filter["dateFrom"] ) <= $mktDate)) { if (! (mktimeDate( $filter["dateFrom"] ) <= $mktDate)) {
$sw = 0; $sw = 0;
@@ -55,9 +61,11 @@ function auditLogArraySet ($str, $filter)
} }
$arrayData = array (); $arrayData = array ();
$newAction = preg_replace('/([A-Z])/', '_$1', $action);
$newAction = "ID".strtoupper($newAction);
if ($sw == 1) { if ($sw == 1) {
$arrayData = array ("DATE" => $date, "USER" => $user, "IP" =>$ip, "ACTION" => $action, "DESCRIPTION" => $description); $arrayData = array ("DATE" => $date, "USER" => $user, "IP" =>$ip, "ACTION" => G::LoadTranslation($newAction), "DESCRIPTION" => $description);
} }
return $arrayData; return $arrayData;
@@ -80,7 +88,6 @@ function getAuditLogData ($filter, $r, $i)
if ($strAux) { if ($strAux) {
$arrayAux = auditLogArraySet($strAux, $filter); $arrayAux = auditLogArraySet($strAux, $filter);
if (count($arrayAux) > 0) { if (count($arrayAux) > 0) {
$count = $count + 1; $count = $count + 1;
@@ -91,6 +98,7 @@ function getAuditLogData ($filter, $r, $i)
} }
} }
} }
return array($count, $arrayData); return array($count, $arrayData);
} }
@@ -102,11 +110,12 @@ switch ($option) {
case "LST": case "LST":
$pageSize = $_REQUEST["pageSize"]; $pageSize = $_REQUEST["pageSize"];
$workspace = SYS_SYS; $workspace = SYS_SYS;
$action = $_REQUEST["action"];
$description = $_REQUEST["description"]; $description = $_REQUEST["description"];
$dateFrom = $_REQUEST["dateFrom"]; $dateFrom = $_REQUEST["dateFrom"];
$dateTo = $_REQUEST["dateTo"]; $dateTo = $_REQUEST["dateTo"];
$arrayFilter = array ("workspace" => $workspace,"description" => $description,"dateFrom" => str_replace( "T00:00:00", null, $dateFrom ),"dateTo" => str_replace( "T00:00:00", null, $dateTo ) $arrayFilter = array ("workspace" => $workspace, "action" => $action, "description" => $description,"dateFrom" => str_replace( "T00:00:00", null, $dateFrom ),"dateTo" => str_replace( "T00:00:00", null, $dateTo )
); );
$limit = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : $pageSize; $limit = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : $pageSize;

View File

@@ -144,7 +144,7 @@ switch ($option) {
} }
$response["status"] = "OK"; $response["status"] = "OK";
G::auditLog("Cron", "ClearCron"); G::auditLog("ClearCron");
} catch (Exception $e) { } catch (Exception $e) {
$response["message"] = $e->getMessage(); $response["message"] = $e->getMessage();
$status = 0; $status = 0;

View File

@@ -170,7 +170,7 @@ function newSkin ($baseSkin = 'classic')
file_put_contents( $configFileFinal, $xmlConfiguration ); file_put_contents( $configFileFinal, $xmlConfiguration );
$response['success'] = true; $response['success'] = true;
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESS_CREATE' ); $response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESS_CREATE' );
G::auditLog("CreateSkin", $skinName); G::auditLog("CreateSkin", "Skin Name: ".$skinName);
print_r( G::json_encode( $response ) ); print_r( G::json_encode( $response ) );
} catch (Exception $e) { } catch (Exception $e) {
$response['success'] = false; $response['success'] = false;
@@ -286,7 +286,7 @@ function importSkin ()
$response['success'] = true; $response['success'] = true;
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESSFUL_IMPORTED' ); $response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESSFUL_IMPORTED' );
G::auditLog("ImportSkin", $skinName); G::auditLog("ImportSkin", "Skin Name: ".$skinName);
print_r( G::json_encode( $response ) ); print_r( G::json_encode( $response ) );
} catch (Exception $e) { } catch (Exception $e) {
$response['success'] = false; $response['success'] = false;
@@ -331,7 +331,7 @@ function exportSkin ($skinToExport = "")
$response['success'] = true; $response['success'] = true;
$response['message'] = $skinTar; $response['message'] = $skinTar;
G::auditLog("ExportSkin", $skinName); G::auditLog("ExportSkin", "Skin Name: ".$skinName);
print_r( G::json_encode( $response ) ); print_r( G::json_encode( $response ) );
} catch (Exception $e) { } catch (Exception $e) {
$response['success'] = false; $response['success'] = false;
@@ -357,7 +357,7 @@ function deleteSkin ()
G::rm_dir( PATH_CUSTOM_SKINS . $folderId ); G::rm_dir( PATH_CUSTOM_SKINS . $folderId );
$response['success'] = true; $response['success'] = true;
$response['message'] = "$folderId deleted"; $response['message'] = "$folderId deleted";
G::auditLog("DeleteSkin", $folderId); G::auditLog("DeleteSkin", "Skin Name: ".$folderId);
} catch (Exception $e) { } catch (Exception $e) {
$response['success'] = false; $response['success'] = false;
$response['error'] = $response['message'] = $e->getMessage(); $response['error'] = $response['message'] = $e->getMessage();

View File

@@ -187,7 +187,7 @@ switch ($_POST['action']) {
require_once 'classes/model/Users.php'; require_once 'classes/model/Users.php';
$oUser = new Users(); $oUser = new Users();
$oUser->create($aData); $oUser->create($aData);
G::auditLog("CreateUser", $aData['USR_USERNAME']); G::auditLog("CreateUser", "User Name: ". $aData['USR_USERNAME']);
if ($_FILES['USR_PHOTO']['error'] != 1) { if ($_FILES['USR_PHOTO']['error'] != 1) {
//print (PATH_IMAGES_ENVIRONMENT_USERS); //print (PATH_IMAGES_ENVIRONMENT_USERS);
@@ -364,7 +364,7 @@ switch ($_POST['action']) {
require_once 'classes/model/Users.php'; require_once 'classes/model/Users.php';
$oUser = new Users(); $oUser = new Users();
$oUser->update($aData); $oUser->update($aData);
G::auditLog("UpdateUser", $aData['USR_USERNAME']." (".$aData['USR_UID'].") "); G::auditLog("UpdateUser", "User Name: ". $aData['USR_USERNAME']." User ID: (".$aData['USR_UID'].") ");
if ($_FILES['USR_PHOTO']['error'] != 1) { if ($_FILES['USR_PHOTO']['error'] != 1) {
if ($_FILES['USR_PHOTO']['tmp_name'] != '') { if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
$aAux = explode('.', $_FILES['USR_PHOTO']['name']); $aAux = explode('.', $_FILES['USR_PHOTO']['name']);

View File

@@ -218,7 +218,7 @@ try {
$criteria->add(ProcessUserPeer::USR_UID, $UID, Criteria::EQUAL); $criteria->add(ProcessUserPeer::USR_UID, $UID, Criteria::EQUAL);
$criteria->add(ProcessUserPeer::PU_TYPE, "SUPERVISOR", Criteria::EQUAL); $criteria->add(ProcessUserPeer::PU_TYPE, "SUPERVISOR", Criteria::EQUAL);
ProcessUserPeer::doDelete($criteria); ProcessUserPeer::doDelete($criteria);
G::auditLog("DeleteUser", $userName." (".$UID.") "); G::auditLog("DeleteUser", "User Name: ". $userName." User ID: (".$UID.") ");
break; break;
case 'changeUserStatus': case 'changeUserStatus':
$response = new stdclass(); $response = new stdclass();
@@ -231,7 +231,7 @@ try {
$userInstance->update($userData); $userInstance->update($userData);
$msg = $_REQUEST['NEW_USR_STATUS'] == 'ACTIVE'? "Enable User" : "Disable User"; $msg = $_REQUEST['NEW_USR_STATUS'] == 'ACTIVE'? "Enable User" : "Disable User";
G::auditLog($msg, $userData['USR_USERNAME']." (".$userData['USR_UID'].") "); G::auditLog($msg, "User Name: ".$userData['USR_USERNAME']." User ID: (".$userData['USR_UID'].") ");
$response->status = 'OK'; $response->status = 'OK';
} else { } else {
$response->status = 'ERROR'; $response->status = 'ERROR';
@@ -357,7 +357,7 @@ try {
} }
$aData['USR_AUTH_USER_DN'] = $auth_dn; $aData['USR_AUTH_USER_DN'] = $auth_dn;
$RBAC->updateUser($aData); $RBAC->updateUser($aData);
g::auditLog("AssignAuthenticationSource", $aData['USR_USERNAME'].' ('.$aData['USR_UID'].') assign to '.$aData['USR_AUTH_TYPE']); g::auditLog("AssignAuthenticationSource", "User Name: ".$aData['USR_USERNAME'].' User ID: ('.$aData['USR_UID'].') assign to '.$aData['USR_AUTH_TYPE']);
echo '{success: true}'; echo '{success: true}';
break; break;
case 'usersList': case 'usersList':

View File

@@ -886,6 +886,11 @@ antes funcionaba.
background-image: url(/skins/neoclassic/images/icons_silk/sprites.png) !important; background-image: url(/skins/neoclassic/images/icons_silk/sprites.png) !important;
background-position: 0 -10873px !important; background-position: 0 -10873px !important;
} }
.ICON_AUDIT_LOG{
background-image: url(/images/Audit.png) !important;
width: 16px !important;
height: 16px !important;
}
.ICON_EMAILS { .ICON_EMAILS {
/*ss_email_edit*/ /*ss_email_edit*/

View File

@@ -80,6 +80,7 @@ audit.application = {
this.baseParams = { this.baseParams = {
"option": "LST", "option": "LST",
"pageSize": pageSize, "pageSize": pageSize,
"action": Ext.getCmp("cboAction").getValue(),
"description": Ext.getCmp("fldDescription").getValue(), "description": Ext.getCmp("fldDescription").getValue(),
"dateFrom": Ext.getCmp("dateFrom").getValue(), "dateFrom": Ext.getCmp("dateFrom").getValue(),
"dateTo": Ext.getCmp("dateTo").getValue() "dateTo": Ext.getCmp("dateTo").getValue()
@@ -126,6 +127,30 @@ audit.application = {
width: 150 width: 150
}); });
var storeAction = new Ext.data.ArrayStore({
idIndex: 0,
fields: ["id", "value"],
data: ACTION
});
var cboAction = new Ext.form.ComboBox({
id: "cboAction",
valueField: "id",
displayField: "value",
value: "ALL",
store: storeAction,
triggerAction: "all",
mode: "local",
editable: false,
width: 150,
listeners: {
select: function (combo, record, index)
{
pagingAudit.moveFirst();
}
}
});
var cboPageSize = new Ext.form.ComboBox({ var cboPageSize = new Ext.form.ComboBox({
id: "cboPageSize", id: "cboPageSize",
@@ -196,6 +221,9 @@ audit.application = {
enableHdMenu: false, enableHdMenu: false,
tbar: [ tbar: [
"->", "->",
{xtype: "tbtext", text: _("ID_ACTION") + "&nbsp;"},
cboAction,
"-",
{xtype: "tbtext", text: _("ID_DESCRIPTION") + "&nbsp;"}, {xtype: "tbtext", text: _("ID_DESCRIPTION") + "&nbsp;"},
fldDescription, fldDescription,
"-", "-",

View File

@@ -29,7 +29,7 @@ Ext.onReady(function() {
], ],
buttons : [{ buttons : [{
id : 'btn_save', id : 'btn_save',
text : _('ID_SAVE'), text : _('ID_SAVE_SETTINGS'),
disabled: true, disabled: true,
handler : saveOption handler : saveOption
}] }]