mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-26 04:10:12 +01:00
you can search for the most frequent audit actions
This commit is contained in:
parent
2ba46f4b37
commit
ea46e391a2
@ -262,6 +262,17 @@ define('ACTION_UNAUTHORIZED_REMOVE_MESSAGE', 14);
|
|||||||
define('ACTION_DOWNLOAD_ATTACHMENT', 15);
|
define('ACTION_DOWNLOAD_ATTACHMENT', 15);
|
||||||
define('ACTION_UNAUTHORIZED_DOWNLOAD_ATTACHMENT', 16);
|
define('ACTION_UNAUTHORIZED_DOWNLOAD_ATTACHMENT', 16);
|
||||||
|
|
||||||
|
$actions = array(
|
||||||
|
'unknown' => 1,
|
||||||
|
'login' => 2,
|
||||||
|
'loginfailed' => 3,
|
||||||
|
'logout' => 4,
|
||||||
|
'view' => 5,
|
||||||
|
'restore' => 8,
|
||||||
|
'download' => 9,
|
||||||
|
'search' => 10
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
$counters = array(MEMCACHED_PREFIX . 'rcvd', MEMCACHED_PREFIX . 'virus', MEMCACHED_PREFIX . 'duplicate', MEMCACHED_PREFIX . 'ignore', MEMCACHED_PREFIX . 'counters_last_update');
|
$counters = array(MEMCACHED_PREFIX . 'rcvd', MEMCACHED_PREFIX . 'virus', MEMCACHED_PREFIX . 'duplicate', MEMCACHED_PREFIX . 'ignore', MEMCACHED_PREFIX . 'counters_last_update');
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ class ControllerAuditHelper extends Controller {
|
|||||||
|
|
||||||
private function fixup_request($data = array()) {
|
private function fixup_request($data = array()) {
|
||||||
$ndate = 0;
|
$ndate = 0;
|
||||||
|
global $actions;
|
||||||
|
|
||||||
if(!isset($data['search'])) { return; }
|
if(!isset($data['search'])) { return; }
|
||||||
|
|
||||||
@ -95,6 +96,7 @@ class ControllerAuditHelper extends Controller {
|
|||||||
while(list($k, $v) = each($b)) {
|
while(list($k, $v) = each($b)) {
|
||||||
if($v == '') { continue; }
|
if($v == '') { continue; }
|
||||||
|
|
||||||
|
if(preg_match("/(login|loginfailed|logout|view|download|search|restore)$/", $v) && isset($actions[$v])) { $this->a['action'] .= '*' . $actions[$v]; }
|
||||||
if(preg_match("/\@/", $v)) { $this->a['user'] .= '*' . $v; }
|
if(preg_match("/\@/", $v)) { $this->a['user'] .= '*' . $v; }
|
||||||
if(preg_match("/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/", $v)) { $this->a['ipaddr'] .= '*' . $v; }
|
if(preg_match("/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/", $v)) { $this->a['ipaddr'] .= '*' . $v; }
|
||||||
if(preg_match("/^\d{1,}$/", $v)) { $this->a['ref'] .= '*' . $v; }
|
if(preg_match("/^\d{1,}$/", $v)) { $this->a['ref'] .= '*' . $v; }
|
||||||
@ -108,6 +110,7 @@ class ControllerAuditHelper extends Controller {
|
|||||||
$this->a['user'] = preg_replace("/^\*/", "", $this->a['user']);
|
$this->a['user'] = preg_replace("/^\*/", "", $this->a['user']);
|
||||||
$this->a['ipaddr'] = preg_replace("/^\*/", "", $this->a['ipaddr']);
|
$this->a['ipaddr'] = preg_replace("/^\*/", "", $this->a['ipaddr']);
|
||||||
$this->a['ref'] = preg_replace("/^\*/", "", $this->a['ref']);
|
$this->a['ref'] = preg_replace("/^\*/", "", $this->a['ref']);
|
||||||
|
$this->a['action'] = preg_replace("/^\*/", "", $this->a['action']);
|
||||||
|
|
||||||
//if(isset($data['action'])) { $arr['action'] = $data['action']; }
|
//if(isset($data['action'])) { $arr['action'] = $data['action']; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user