mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Fixes #4766 User-audit login event data.
This commit is contained in:
parent
7a9610740a
commit
903f51561f
@ -754,8 +754,8 @@ class audit_log_ui extends e_admin_ui
|
|||||||
'dblog_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => array('mask'=>'dd MM yyyy hh:ii:ss'), 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'dblog_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => array('mask'=>'dd MM yyyy hh:ii:ss'), 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'dblog_microtime' => array ( 'title' => 'Microtime', 'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
'dblog_microtime' => array ( 'title' => 'Microtime', 'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||||
'dblog_eventcode' => array ( 'title' => 'Eventcode', 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
'dblog_eventcode' => array ( 'title' => 'Eventcode', 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||||
'dblog_user_id' => array ( 'title' => LAN_USER, 'type' => 'user', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'dblog_user_id' => array ( 'title' => LAN_USER, 'type' => 'user', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms'=>'link=1', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'dblog_user_name' => array ( 'title' => LAN_USER, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
// 'dblog_user_name' => array ( 'title' => LAN_USER, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'dblog_ip' => array ( 'title' => LAN_IP, 'type' => 'ip', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'dblog_ip' => array ( 'title' => LAN_IP, 'type' => 'ip', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'dblog_title' => array ( 'title' => LAN_TITLE, 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'dblog_title' => array ( 'title' => LAN_TITLE, 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'dblog_remarks' => array ( 'title' => 'Remarks', 'type' => 'method', 'data' => 'str', 'width' => '30%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'dblog_remarks' => array ( 'title' => 'Remarks', 'type' => 'method', 'data' => 'str', 'width' => '30%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
|
@ -449,13 +449,13 @@ class e_admin_log
|
|||||||
* Log user-related events
|
* Log user-related events
|
||||||
* @param string $event_type
|
* @param string $event_type
|
||||||
* @param array|string $event_data is an array of data fields whose keys and values are logged (usually user data, but doesn't have to be - can add messages here)
|
* @param array|string $event_data is an array of data fields whose keys and values are logged (usually user data, but doesn't have to be - can add messages here)
|
||||||
* @param string $id
|
* @param int $id user-id
|
||||||
* @param string $u_name
|
* @param string $u_name user-name
|
||||||
* both $id and $u_name are left blank except for admin edits and user login, where they specify the id and login name of the 'target' user
|
* both $id and $u_name are left blank except for admin edits and user login, where they specify the id and login name of the 'target' user
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function user_audit($event_type, $event_data, $id = '', $u_name = '')
|
function user_audit($event_type, $event_data, $id = null, $u_name = '')
|
||||||
{
|
{
|
||||||
list($time_usec, $time_sec) = explode(' ', microtime()); // Log event time immediately to minimise uncertainty
|
list($time_usec, $time_sec) = explode(' ', microtime()); // Log event time immediately to minimise uncertainty
|
||||||
|
|
||||||
|
@ -740,7 +740,7 @@ class userlogin
|
|||||||
$userAuditPref = e107::getPref('user_audit_class', e_UC_NOBODY);
|
$userAuditPref = e107::getPref('user_audit_class', e_UC_NOBODY);
|
||||||
if (check_class($userAuditPref, $class_list))
|
if (check_class($userAuditPref, $class_list))
|
||||||
{
|
{
|
||||||
e107::getLog()->user_audit(USER_AUDIT_LOGIN,'', $edata_li);
|
e107::getLog()->user_audit(USER_AUDIT_LOGIN, $edata_li, $userData['user_id'], $userData['user_name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
e107::getEvent()->trigger("login", $edata_li);
|
e107::getEvent()->trigger("login", $edata_li);
|
||||||
|
@ -35,7 +35,7 @@ class e_user_providerTest extends \Codeception\Test\Unit
|
|||||||
$this->assertIsArray($result);
|
$this->assertIsArray($result);
|
||||||
$this->assertContains("Facebook", $result);
|
$this->assertContains("Facebook", $result);
|
||||||
$this->assertContains("Twitter", $result);
|
$this->assertContains("Twitter", $result);
|
||||||
$this->assertCount(51, $result,
|
$this->assertCount(52, $result,
|
||||||
"The number of Hybridauth providers has changed! If this is intentional, note the change " .
|
"The number of Hybridauth providers has changed! If this is intentional, note the change " .
|
||||||
"in Hybridauth providers in the release changelog and update the count in this test."
|
"in Hybridauth providers in the release changelog and update the count in this test."
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user