PMC-119
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Session\TokenMismatchException;
|
||||
use Illuminate\Support\Str;
|
||||
use ProcessMaker\Model\User;
|
||||
|
||||
/**
|
||||
* We will send a case note in the actions by email
|
||||
@@ -493,3 +494,29 @@ if (!function_exists('set_magic_quotes_runtime')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the USER table with the last login date
|
||||
*
|
||||
* @param array $userLog
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*
|
||||
* @see workflow/engine/methods/login/authentication.php
|
||||
*/
|
||||
function updateUserLastLogin($userLog, $keyLastLogin = 'LOG_INIT_DATE')
|
||||
{
|
||||
try {
|
||||
$filters = [];
|
||||
$filters['USR_UID'] = $userLog['USR_UID'];
|
||||
|
||||
$user = User::query();
|
||||
$user->userFilters($filters);
|
||||
$res = $user->update(['USR_LAST_LOGIN' => $userLog[$keyLastLogin]]);
|
||||
|
||||
return $res;
|
||||
} catch (Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user