BUG-12021 Audit Log
Ip client column added
This commit is contained in:
@@ -5277,12 +5277,13 @@ class G
|
||||
{
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
$sflagAudit = $oServerConf->getAuditLogProperty( 'AL_OPTION', SYS_SYS );
|
||||
$ipClient = G::getIpAddress();
|
||||
|
||||
if ($sflagAudit) {
|
||||
$workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
|
||||
$username = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : 'Unknow User';
|
||||
$fullname = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : '-';
|
||||
G::log("|". $workspace ."|". $username . "|" . $fullname ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log");
|
||||
G::log("|". $workspace ."|". $ipClient ."|". $username . "|" . $fullname ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1056,6 +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);
|
||||
} catch (Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
@@ -1073,7 +1074,6 @@ class adminProxy extends HttpProxyController
|
||||
} elseif ($_FILES['img']['type'] != '') {
|
||||
$failed = "1";
|
||||
}
|
||||
G::auditLog("UploadLogo", $fileName);
|
||||
echo '{success: true, failed: ' . $failed . ', uploaded: ' . $uploaded . ', type: "' . $_FILES['img']['type'] . '"}';
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -19,9 +19,10 @@ function auditLogArraySet ($str, $filter)
|
||||
if (count( $arrayAux ) > 1) {
|
||||
$date = (isset( $arrayAux[0] )) ? trim( $arrayAux[0] ) : "";
|
||||
$workspace = (isset( $arrayAux[1] )) ? trim( $arrayAux[1] ) : "";
|
||||
$user = (isset( $arrayAux[3] )) ? trim( $arrayAux[3] ) : "";
|
||||
$action = (isset( $arrayAux[4] )) ? trim( $arrayAux[4] ) : "";
|
||||
$description = (isset( $arrayAux[5] )) ? trim( $arrayAux[5] ) : "";
|
||||
$ip = (isset( $arrayAux[2] )) ? trim( $arrayAux[2] ) : "";
|
||||
$user = (isset( $arrayAux[4] )) ? trim( $arrayAux[4] ) : "";
|
||||
$action = (isset( $arrayAux[5] )) ? trim( $arrayAux[5] ) : "";
|
||||
$description = (isset( $arrayAux[6] )) ? trim( $arrayAux[6] ) : "";
|
||||
}
|
||||
|
||||
$mktDate = (! empty( $date )) ? mktimeDate( $date ) : 0;
|
||||
@@ -48,7 +49,7 @@ function auditLogArraySet ($str, $filter)
|
||||
$sw = 0;
|
||||
$string = $filter["description"];
|
||||
|
||||
if ( (stristr($date, $string) !== false) || (stristr($user, $string) !== false) || (stristr($action, $string) !== false) || (stristr($description, $string) !== false) ) {
|
||||
if ( (stristr($date, $string) !== false) || (stristr($ip, $string) !== false) || (stristr($user, $string) !== false) || (stristr($action, $string) !== false) || (stristr($description, $string) !== false) ) {
|
||||
$sw = 1;
|
||||
}
|
||||
}
|
||||
@@ -56,7 +57,7 @@ function auditLogArraySet ($str, $filter)
|
||||
$arrayData = array ();
|
||||
|
||||
if ($sw == 1) {
|
||||
$arrayData = array ("DATE" => $date, "USER" => $user, "ACTION" => $action, "DESCRIPTION" => $description);
|
||||
$arrayData = array ("DATE" => $date, "USER" => $user, "IP" =>$ip, "ACTION" => $action, "DESCRIPTION" => $description);
|
||||
}
|
||||
|
||||
return $arrayData;
|
||||
|
||||
@@ -43,6 +43,7 @@ audit.application = {
|
||||
if (typeof record != "undefined") {
|
||||
var strData = "<b>" + _("ID_DATE_LABEL") + "</b><br />" + record.get("DATE") + "<br />";
|
||||
strData = strData + "<b>" + _("ID_USER") + "</b><br />" + record.get("WORKSPACE") + "<br />";
|
||||
strData = strData + "<b>" + _("ID_IP") + "</b><br />" + record.get("IP") + "<br />";
|
||||
strData = strData + "<b>" + _("ID_ACTION") + "</b><br />" + record.get("ACTION") + "<br />";
|
||||
strData = strData + "<b>" + _("ID_DESCRIPTION") + "</b><br />" + record.get("DESCRIPTION") + "<br />";
|
||||
|
||||
@@ -65,6 +66,7 @@ audit.application = {
|
||||
fields: [
|
||||
{name: "DATE"},
|
||||
{name: "USER"},
|
||||
{name: "IP"},
|
||||
{name: "ACTION"},
|
||||
{name: "DESCRIPTION"}
|
||||
]
|
||||
@@ -161,8 +163,9 @@ audit.application = {
|
||||
},
|
||||
columns: [
|
||||
{id: "ID", dataIndex: "DATE", hidden: true, hideable: false},
|
||||
{header: _("ID_DATE_LABEL"), dataIndex: "DATE", width: 10},
|
||||
{header: _("ID_DATE_LABEL"), dataIndex: "DATE", width: 15},
|
||||
{header: _("ID_USER"), dataIndex: "USER", width: 15},
|
||||
{header: _("ID_IP"), dataIndex: "IP", width: 10},
|
||||
{header: _("ID_ACTION"), dataIndex: "ACTION", width: 15},
|
||||
{header: _("ID_DESCRIPTION"), dataIndex: "DESCRIPTION"}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user