BUG-12021 Improvements Audit Log
Improvements Audit Log
This commit is contained in:
@@ -69,7 +69,7 @@ class AuthenticationSource extends BaseAuthenticationSource {
|
||||
$oConnection->begin();
|
||||
$iResult = $oAuthenticationSource->save();
|
||||
$oConnection->commit();
|
||||
G::auditLog("CreateAuthSource", $aData['AUTH_SOURCE_NAME']);
|
||||
G::auditLog("CreateAuthSource", "Authentication Source Name: ". $aData['AUTH_SOURCE_NAME']);
|
||||
return $aData['AUTH_SOURCE_UID'];
|
||||
}
|
||||
else {
|
||||
@@ -98,7 +98,7 @@ class AuthenticationSource extends BaseAuthenticationSource {
|
||||
$oConnection->begin();
|
||||
$iResult = $oAuthenticationSource->save();
|
||||
$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;
|
||||
}
|
||||
else {
|
||||
@@ -135,7 +135,7 @@ class AuthenticationSource extends BaseAuthenticationSource {
|
||||
$iResult = $oAuthenticationSource->delete();
|
||||
$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;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -237,7 +237,7 @@ class Roles extends BaseRoles {
|
||||
$result = $obj->save();
|
||||
$con->commit();
|
||||
$obj->setRolName($rol_name);
|
||||
G::auditLog("CreateRole", $rol_name);
|
||||
G::auditLog("CreateRole", "Role Name: ". $rol_name);
|
||||
} else {
|
||||
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
@@ -263,7 +263,7 @@ class Roles extends BaseRoles {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
$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;
|
||||
} else {
|
||||
$con->rollback();
|
||||
@@ -284,7 +284,7 @@ class Roles extends BaseRoles {
|
||||
Content::removeContent('ROL_NAME', '', $this->getRolUid());
|
||||
$result = $this->delete();
|
||||
$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;
|
||||
} catch( exception $e ) {
|
||||
$con->rollback();
|
||||
@@ -645,7 +645,7 @@ class Roles extends BaseRoles {
|
||||
$permission = $o->getPermissionName($PER_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) {
|
||||
|
||||
@@ -201,7 +201,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
'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'];
|
||||
} else {
|
||||
$sMessage = '';
|
||||
@@ -228,7 +228,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$oConnection->begin();
|
||||
$iResult = $oAdditionalTables->save();
|
||||
$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 {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oAdditionalTables->getValidationFailures();
|
||||
|
||||
@@ -253,9 +253,9 @@ class CalendarDefinition extends BaseCalendarDefinition
|
||||
if (! (is_object( $tr ) && get_class( $tr ) == 'CalendarDefinition')) {
|
||||
$tr = new CalendarDefinition();
|
||||
$tr->setCalendarCreateDate( 'now' );
|
||||
G::auditLog("CreateCalendar", $aData['CALENDAR_NAME']);
|
||||
G::auditLog("CreateCalendar", "Calendar Name: ".$aData['CALENDAR_NAME']);
|
||||
} else {
|
||||
G::auditLog("UpdateCalendar", $aData['CALENDAR_NAME']." (".$CalendarUid.") ");
|
||||
G::auditLog("UpdateCalendar", "Calendar Name: ".$aData['CALENDAR_NAME']." Calendar ID: (".$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.
|
||||
$res = $tr->save();
|
||||
$deletedCalendar = $tr->getCalendarName();
|
||||
G::auditLog("DeleteCalendar", $deletedCalendar." (".$CalendarUid.") ");
|
||||
G::auditLog("DeleteCalendar", "Calendar Name: ".$deletedCalendar." Calendar ID: (".$CalendarUid.") ");
|
||||
} else {
|
||||
// Something went wrong. We can now get the validationFailures and handle them.
|
||||
$msg = '';
|
||||
|
||||
@@ -70,7 +70,7 @@ class DashletInstance extends BaseDashletInstance
|
||||
$connection->commit();
|
||||
|
||||
$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'];
|
||||
} else {
|
||||
@@ -98,7 +98,7 @@ class DashletInstance extends BaseDashletInstance
|
||||
$result = $dashletInstance->delete();
|
||||
$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;
|
||||
} else {
|
||||
throw new Exception('Error trying to delete: The row "' . $dasInsUid. '" does not exist.');
|
||||
|
||||
@@ -115,7 +115,7 @@ class Department extends BaseDepartment
|
||||
|
||||
$con->commit();
|
||||
|
||||
G::auditLog("Create ".$msgLog, $aData['DEP_TITLE']);
|
||||
G::auditLog("Create".$msgLog, $msgLog." Name: ". $aData['DEP_TITLE']);
|
||||
|
||||
return $this->getDepUid();
|
||||
} else {
|
||||
@@ -290,7 +290,7 @@ class Department extends BaseDepartment
|
||||
Content::removeContent( 'DEPO_TITLE', '', $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();
|
||||
} else {
|
||||
throw (new Exception( "The row '$ProUid' in table Group doesn't exist!" ));
|
||||
|
||||
@@ -98,7 +98,7 @@ class GroupUser extends BaseGroupUser
|
||||
$oUsr = new Users();
|
||||
$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;
|
||||
} else {
|
||||
|
||||
@@ -301,7 +301,7 @@ class Language extends BaseLanguage
|
||||
$results->headers = $POHeaders;
|
||||
$results->errMsg = $errorMsg;
|
||||
|
||||
G::auditLog("UploadLanguage", $languageID);
|
||||
G::auditLog("UploadLanguage", "Language: ".$languageID);
|
||||
|
||||
return $results;
|
||||
} catch (Exception $oError) {
|
||||
@@ -551,7 +551,7 @@ class Language extends BaseLanguage
|
||||
}
|
||||
} //end foreach
|
||||
}
|
||||
G::auditLog("ExportLanguage", $_GET['LOCALE']);
|
||||
G::auditLog("ExportLanguage", "Language: ".$_GET['LOCALE']);
|
||||
G::streamFile( $sPOFile, true );
|
||||
}
|
||||
public function updateLanguagePlugin ($plugin, $idLanguage)
|
||||
|
||||
@@ -454,7 +454,7 @@ class Translation extends BaseTranslation
|
||||
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::auditLog("DeleteLanguage", $locale);
|
||||
G::auditLog("DeleteLanguage", "Language: ".$locale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1056,7 +1056,7 @@ class adminProxy extends HttpProxyController
|
||||
try {
|
||||
list($imageWidth, $imageHeight, $imageType) = @getimagesize($dir . '/' . 'tmp' . $fileName);
|
||||
G::resizeImage($dir . '/tmp' . $fileName, $imageWidth, 49, $dir . '/' . $fileName);
|
||||
G::auditLog("UploadLogo", $fileName);
|
||||
G::auditLog("UploadLogo", "File Name: ".$fileName);
|
||||
} catch (Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
@@ -1138,7 +1138,7 @@ class adminProxy extends HttpProxyController
|
||||
if (file_exists($dir . '/tmp' . $imgname)) {
|
||||
unlink ($dir . '/tmp' . $imgname);
|
||||
}
|
||||
G::auditLog("DeleteLogo", $imgname);
|
||||
G::auditLog("DeleteLogo", "File Name: ".$imgname);
|
||||
} else {
|
||||
echo '{success: false}';
|
||||
exit();
|
||||
@@ -1191,7 +1191,7 @@ class adminProxy extends HttpProxyController
|
||||
$oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '', '');
|
||||
|
||||
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels');
|
||||
G::auditLog("ReplaceLogo", $snameLogo);
|
||||
G::auditLog("ReplaceLogo", "File Name: ".$snameLogo);
|
||||
|
||||
break;
|
||||
case 'restoreLogo':
|
||||
|
||||
@@ -410,7 +410,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
if ($errors == '') {
|
||||
$result->success = true;
|
||||
$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 {
|
||||
$result->success = false;
|
||||
$result->message = $count. G::LoadTranslation( 'ID_TABLES_REMOVED_WITH_ERRORS' ) .$errors;
|
||||
@@ -509,7 +509,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
if ($obj->validate()) {
|
||||
$obj->save();
|
||||
$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 ();
|
||||
foreach ($primaryKeys as $primaryKey) {
|
||||
$method = 'get' . AdditionalTables::getPHPName( $primaryKey['FLD_NAME'] );
|
||||
@@ -582,7 +582,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -609,7 +609,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
|
||||
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->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->message = G::loadTranslation( 'ID_FILE_IMPORTED_SUCCESSFULLY', array ($filename
|
||||
) );
|
||||
G::auditLog("ImportTable", $filename);
|
||||
G::auditLog("ImportTable", "Table Name: ".$filename);
|
||||
}
|
||||
} else {
|
||||
$sMessage = G::LoadTranslation( 'ID_UPLOAD_VALID_CSV_FILE' );
|
||||
@@ -927,7 +927,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
// 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'] );
|
||||
}
|
||||
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;
|
||||
case '@DATA':
|
||||
$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, $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 );
|
||||
|
||||
@@ -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('EMAILS', '../mails/emailList', ucfirst (strtolower ( G::LoadTranslation('ID_EMAILS'))), '', '', 'logs');
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -235,9 +235,9 @@ switch ($_POST['action']) {
|
||||
$oDept->updateDepartmentManager( $dep_uid );
|
||||
|
||||
if ($dep_parent == '') {
|
||||
G::auditLog("UpdateDepartament", $dep_name." (".$dep_uid.") ");
|
||||
G::auditLog("UpdateDepartament", "Departament Name: ".$dep_name." (".$dep_uid.") ");
|
||||
} else {
|
||||
G::auditLog("UpdateSubDepartament", $dep_name." (".$dep_uid.") ");
|
||||
G::auditLog("UpdateSubDepartament", "Sub Departament Name: ".$dep_name." (".$dep_uid.") ");
|
||||
}
|
||||
|
||||
echo '{success: true}';
|
||||
|
||||
@@ -179,9 +179,9 @@ try {
|
||||
$result["success"] = $addon->setEnabled(($action == "enable"));
|
||||
|
||||
if ($action == "enable") {
|
||||
G::auditLog("EnablePlugin", $_REQUEST['addon']);
|
||||
G::auditLog("EnablePlugin", "Plugin Name: ".$_REQUEST['addon']);
|
||||
} else {
|
||||
G::auditLog("DisablePlugin", $_REQUEST['addon']);
|
||||
G::auditLog("DisablePlugin", "Plugin Name: ".$_REQUEST['addon']);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -270,7 +270,7 @@ switch ($option) {
|
||||
if ($result["status"] == "OK") {
|
||||
$response["status"] = $result["status"]; //OK
|
||||
$response["message"] = $result["message"];
|
||||
G::auditLog("InstallPlugin", $file);
|
||||
G::auditLog("InstallPlugin", "Plugin Name: ".$file);
|
||||
} else {
|
||||
throw (new Exception($result["message"]));
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ switch ($_POST['action']) {
|
||||
unset( $newGroup['GRP_UID'] );
|
||||
$group = new Groupwf();
|
||||
$group->create( $newGroup );
|
||||
G::auditLog("CreateGroup", $newGroup['GRP_TITLE']);
|
||||
G::auditLog("CreateGroup", "Group Name: ".$newGroup['GRP_TITLE']);
|
||||
|
||||
echo '{success: true}';
|
||||
|
||||
@@ -161,7 +161,7 @@ switch ($_POST['action']) {
|
||||
$editGroup['GRP_TITLE'] = trim( $_POST['name'] );
|
||||
$group = new Groupwf();
|
||||
$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}';
|
||||
break;
|
||||
case 'deleteGroup':
|
||||
@@ -171,7 +171,7 @@ switch ($_POST['action']) {
|
||||
return;
|
||||
}
|
||||
$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';
|
||||
$oProcess = new TaskUser();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
|
||||
@@ -104,7 +104,7 @@ if (isset( $_REQUEST['action'] )) {
|
||||
$pcat->setCategoryUid( G::GenerateUniqueID() );
|
||||
$pcat->setCategoryName( $catName );
|
||||
$pcat->save();
|
||||
G::auditLog("CreateCategory", $catName);
|
||||
G::auditLog("CreateCategory", "Category Name: ".$catName);
|
||||
echo '{success: true}';
|
||||
} catch (Exception $ex) {
|
||||
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||
@@ -135,7 +135,7 @@ if (isset( $_REQUEST['action'] )) {
|
||||
$pcat->setCategoryUid( $catUID );
|
||||
$pcat->setCategoryName( $catName );
|
||||
$pcat->save();
|
||||
g::auditLog("UpdateCategory", $catName." (".$catUID.") ");
|
||||
g::auditLog("UpdateCategory", "Category Name: ".$catName." Category ID: (".$catUID.") ");
|
||||
echo '{success: true}';
|
||||
} catch (Exception $ex) {
|
||||
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||
@@ -157,7 +157,7 @@ if (isset( $_REQUEST['action'] )) {
|
||||
$cat->setCategoryUid( $catUID );
|
||||
$catName = $cat->loadByCategoryId( $catUID );
|
||||
$cat->delete();
|
||||
G::auditLog("DeleteCategory", $catName." (".$catUID.") ");
|
||||
G::auditLog("DeleteCategory", "Category Name: ".$catName." Category ID: (".$catUID.") ");
|
||||
echo '{success: true}';
|
||||
} catch (Exception $ex) {
|
||||
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||
|
||||
@@ -12,7 +12,83 @@ $configPage = $c->getConfiguration( "auditLogList", "pageSize", null, $_SESSION[
|
||||
$config = array ();
|
||||
$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->addExtJsScript( "setup/auditLog", true );
|
||||
$oHeadPublisher->assign( "CONFIG", $config );
|
||||
$oHeadPublisher->assign( "ACTION", $arrayAction );
|
||||
G::RenderPage( "publish", "extJs" );
|
||||
|
||||
@@ -33,6 +33,12 @@ function auditLogArraySet ($str, $filter)
|
||||
$sw = 0;
|
||||
}
|
||||
|
||||
if ($filter["action"] != "ALL") {
|
||||
if ($action != $filter["action"]) {
|
||||
$sw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filter["dateFrom"] && $mktDate > 0) {
|
||||
if (! (mktimeDate( $filter["dateFrom"] ) <= $mktDate)) {
|
||||
$sw = 0;
|
||||
@@ -55,9 +61,11 @@ function auditLogArraySet ($str, $filter)
|
||||
}
|
||||
|
||||
$arrayData = array ();
|
||||
$newAction = preg_replace('/([A-Z])/', '_$1', $action);
|
||||
$newAction = "ID".strtoupper($newAction);
|
||||
|
||||
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;
|
||||
@@ -80,7 +88,6 @@ function getAuditLogData ($filter, $r, $i)
|
||||
|
||||
if ($strAux) {
|
||||
$arrayAux = auditLogArraySet($strAux, $filter);
|
||||
|
||||
if (count($arrayAux) > 0) {
|
||||
$count = $count + 1;
|
||||
|
||||
@@ -91,6 +98,7 @@ function getAuditLogData ($filter, $r, $i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array($count, $arrayData);
|
||||
}
|
||||
|
||||
@@ -102,11 +110,12 @@ switch ($option) {
|
||||
case "LST":
|
||||
$pageSize = $_REQUEST["pageSize"];
|
||||
$workspace = SYS_SYS;
|
||||
$action = $_REQUEST["action"];
|
||||
$description = $_REQUEST["description"];
|
||||
$dateFrom = $_REQUEST["dateFrom"];
|
||||
$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;
|
||||
|
||||
@@ -13,13 +13,13 @@ switch ($_GET['action']) {
|
||||
$oServerConf->setAuditLogProperty( 'AL_OPTION', 1, SYS_SYS );
|
||||
$oServerConf->unsetAuditLogProperty( 'AL_NEXT_DATE', SYS_SYS );
|
||||
$response->enable = true;
|
||||
G::auditLog("Enable AuditLog");
|
||||
G::auditLog("EnableAuditLog");
|
||||
} else {
|
||||
$oServerConf->setAuditLogProperty( 'AL_OPTION', 0, SYS_SYS );
|
||||
$oServerConf->unsetAuditLogProperty( 'AL_NEXT_DATE', SYS_SYS );
|
||||
$oServerConf->setAuditLogProperty( 'AL_TYPE', 'endaudit', SYS_SYS );
|
||||
$response->enable = false;
|
||||
G::auditLog("Disable AuditLog");
|
||||
G::auditLog("DisableAuditLog");
|
||||
}
|
||||
$response->success = true;
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ switch ($option) {
|
||||
}
|
||||
|
||||
$response["status"] = "OK";
|
||||
G::auditLog("Cron", "ClearCron");
|
||||
G::auditLog("ClearCron");
|
||||
} catch (Exception $e) {
|
||||
$response["message"] = $e->getMessage();
|
||||
$status = 0;
|
||||
|
||||
@@ -170,7 +170,7 @@ function newSkin ($baseSkin = 'classic')
|
||||
file_put_contents( $configFileFinal, $xmlConfiguration );
|
||||
$response['success'] = true;
|
||||
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESS_CREATE' );
|
||||
G::auditLog("CreateSkin", $skinName);
|
||||
G::auditLog("CreateSkin", "Skin Name: ".$skinName);
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
@@ -286,7 +286,7 @@ function importSkin ()
|
||||
|
||||
$response['success'] = true;
|
||||
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESSFUL_IMPORTED' );
|
||||
G::auditLog("ImportSkin", $skinName);
|
||||
G::auditLog("ImportSkin", "Skin Name: ".$skinName);
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
@@ -331,7 +331,7 @@ function exportSkin ($skinToExport = "")
|
||||
|
||||
$response['success'] = true;
|
||||
$response['message'] = $skinTar;
|
||||
G::auditLog("ExportSkin", $skinName);
|
||||
G::auditLog("ExportSkin", "Skin Name: ".$skinName);
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
@@ -357,7 +357,7 @@ function deleteSkin ()
|
||||
G::rm_dir( PATH_CUSTOM_SKINS . $folderId );
|
||||
$response['success'] = true;
|
||||
$response['message'] = "$folderId deleted";
|
||||
G::auditLog("DeleteSkin", $folderId);
|
||||
G::auditLog("DeleteSkin", "Skin Name: ".$folderId);
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
$response['error'] = $response['message'] = $e->getMessage();
|
||||
|
||||
@@ -187,7 +187,7 @@ switch ($_POST['action']) {
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$oUser->create($aData);
|
||||
G::auditLog("CreateUser", $aData['USR_USERNAME']);
|
||||
G::auditLog("CreateUser", "User Name: ". $aData['USR_USERNAME']);
|
||||
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
//print (PATH_IMAGES_ENVIRONMENT_USERS);
|
||||
@@ -364,7 +364,7 @@ switch ($_POST['action']) {
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$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']['tmp_name'] != '') {
|
||||
$aAux = explode('.', $_FILES['USR_PHOTO']['name']);
|
||||
|
||||
@@ -218,7 +218,7 @@ try {
|
||||
$criteria->add(ProcessUserPeer::USR_UID, $UID, Criteria::EQUAL);
|
||||
$criteria->add(ProcessUserPeer::PU_TYPE, "SUPERVISOR", Criteria::EQUAL);
|
||||
ProcessUserPeer::doDelete($criteria);
|
||||
G::auditLog("DeleteUser", $userName." (".$UID.") ");
|
||||
G::auditLog("DeleteUser", "User Name: ". $userName." User ID: (".$UID.") ");
|
||||
break;
|
||||
case 'changeUserStatus':
|
||||
$response = new stdclass();
|
||||
@@ -231,7 +231,7 @@ try {
|
||||
$userInstance->update($userData);
|
||||
|
||||
$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';
|
||||
} else {
|
||||
$response->status = 'ERROR';
|
||||
@@ -357,7 +357,7 @@ try {
|
||||
}
|
||||
$aData['USR_AUTH_USER_DN'] = $auth_dn;
|
||||
$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}';
|
||||
break;
|
||||
case 'usersList':
|
||||
|
||||
@@ -886,6 +886,11 @@ antes funcionaba.
|
||||
background-image: url(/skins/neoclassic/images/icons_silk/sprites.png) !important;
|
||||
background-position: 0 -10873px !important;
|
||||
}
|
||||
.ICON_AUDIT_LOG{
|
||||
background-image: url(/images/Audit.png) !important;
|
||||
width: 16px !important;
|
||||
height: 16px !important;
|
||||
}
|
||||
.ICON_EMAILS {
|
||||
/*ss_email_edit*/
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ audit.application = {
|
||||
this.baseParams = {
|
||||
"option": "LST",
|
||||
"pageSize": pageSize,
|
||||
"action": Ext.getCmp("cboAction").getValue(),
|
||||
"description": Ext.getCmp("fldDescription").getValue(),
|
||||
"dateFrom": Ext.getCmp("dateFrom").getValue(),
|
||||
"dateTo": Ext.getCmp("dateTo").getValue()
|
||||
@@ -126,6 +127,30 @@ audit.application = {
|
||||
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({
|
||||
id: "cboPageSize",
|
||||
|
||||
@@ -196,6 +221,9 @@ audit.application = {
|
||||
enableHdMenu: false,
|
||||
tbar: [
|
||||
"->",
|
||||
{xtype: "tbtext", text: _("ID_ACTION") + " "},
|
||||
cboAction,
|
||||
"-",
|
||||
{xtype: "tbtext", text: _("ID_DESCRIPTION") + " "},
|
||||
fldDescription,
|
||||
"-",
|
||||
|
||||
@@ -29,7 +29,7 @@ Ext.onReady(function() {
|
||||
],
|
||||
buttons : [{
|
||||
id : 'btn_save',
|
||||
text : _('ID_SAVE'),
|
||||
text : _('ID_SAVE_SETTINGS'),
|
||||
disabled: true,
|
||||
handler : saveOption
|
||||
}]
|
||||
|
||||
Reference in New Issue
Block a user