Add the session status to user logs

This commit is contained in:
FusionPBX
2024-09-02 23:42:52 -06:00
committed by GitHub
parent ffd0545a22
commit 452ddc9539
4 changed files with 37 additions and 5 deletions

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2019-2021
Portions created by the Initial Developer are Copyright (C) 2019-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -63,8 +63,9 @@ if (!class_exists('user_logs')) {
* add user_logs
*/
public static function add($result) {
$array = [];
//prepare the array
$array = [];
$array['user_logs'][0]["timestamp"] = 'now()';
$array['user_logs'][0]["domain_uuid"] = $result['domain_uuid'];
$array['user_logs'][0]["user_uuid"] = $result['user_uuid'];
@@ -72,6 +73,7 @@ if (!class_exists('user_logs')) {
$array['user_logs'][0]["type"] = 'login';
$array['user_logs'][0]["remote_address"] = $_SERVER['REMOTE_ADDR'];
$array['user_logs'][0]["user_agent"] = $_SERVER['HTTP_USER_AGENT'];
$array['user_logs'][0]["session_id"] = session_id();
$array['user_logs'][0]["type"] = 'login';
if ($result["authorized"] == "true") {
$array['user_logs'][0]["result"] = 'success';