BUG-12021 Improvements Audit Log
Improvements Audit Log
This commit is contained in:
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user