Commit 45c5a3de authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #17253 TIME 2:30 History for userlogin and userlogout

parent 8e2bd9ce
......@@ -56,7 +56,7 @@ if ($notification['is_enabled'] === 'N') {
//SECOND STEP
writeLog(['message' => "Loading events for notification {$notificationId}", 'level' => 'INFO']);
$events = \Notification\models\NotificationsEventsModel::get(['select' => ['*'], 'where' => ['notification_sid = ?', 'exec_date is NULL'], 'data' => [$notification['notification_sid']]]);
$events = \Notification\models\NotificationsEventsModel::get(['select' => ['*'], 'where' => ['notification_sid = ?', 'exec_date is NULL'], 'data' => [$notification['notification_sid']], 'orderBy' => ['event_date desc']]);
$totalEventsToProcess = count($events);
$currentEvent = 0;
if ($totalEventsToProcess === 0) {
......
......@@ -15,6 +15,6 @@
<img src="assets/spinner.gif"/>
</div>
</app-root>
<script src="runtime-es2015.497d8eb67297abf47895.js" type="module"></script><script src="runtime-es5.497d8eb67297abf47895.js" nomodule defer></script><script src="polyfills-es5.c174c1516561194600a5.js" nomodule defer></script><script src="polyfills-es2015.b86be9c6fde12488a69f.js" type="module"></script><script src="scripts.b9f328a06b6423d59d32.js" defer></script><script src="main-es2015.eba8f2d1042a0c38cabe.js" type="module"></script><script src="main-es5.eba8f2d1042a0c38cabe.js" nomodule defer></script></body>
<script src="runtime-es2015.497d8eb67297abf47895.js" type="module"></script><script src="runtime-es5.497d8eb67297abf47895.js" nomodule defer></script><script src="polyfills-es5.c174c1516561194600a5.js" nomodule defer></script><script src="polyfills-es2015.b86be9c6fde12488a69f.js" type="module"></script><script src="scripts.b9f328a06b6423d59d32.js" defer></script><script src="main-es2015.bfe25a50af1fc8cac5ad.js" type="module"></script><script src="main-es5.bfe25a50af1fc8cac5ad.js" nomodule defer></script></body>
</html>
\ No newline at end of file
......@@ -31,4 +31,6 @@ INSERT INTO contacts_parameters (identifier, mandatory, filling, searchable, dis
UPDATE entities SET external_id = external_id - 'fastParapheurSubscriberId';
UPDATE entities SET external_id = jsonb_set(external_id, '{fastParapheurSubscriberId}', to_jsonb(business_id)) WHERE business_id IS NOT NULL;
UPDATE history SET event_id = 'userlogin' WHERE event_id = 'login';
UPDATE parameters SET param_value_string = '21.03.5' WHERE id = 'database_version';
......@@ -371,7 +371,7 @@ class AuthenticationController
'eventType' => 'LOGIN',
'info' => _LOGIN . ' : ' . $login,
'moduleId' => 'authentication',
'eventId' => 'login'
'eventId' => 'userlogin'
]);
return $response->withStatus(204);
......@@ -393,6 +393,15 @@ class AuthenticationController
$logoutUrl = $disconnection['logoutUrl'];
}
HistoryController::add([
'tableName' => 'users',
'recordId' => $GLOBALS['id'],
'eventType' => 'LOGOUT',
'info' => _LOGOUT . ' : ' . $GLOBALS['login'],
'moduleId' => 'authentication',
'eventId' => 'userlogout'
]);
return $response->withJson(['logoutUrl' => $logoutUrl]);
}
......
......@@ -160,6 +160,7 @@ define('_DOCUMENT_UNSIGNED', 'Document unsigned');
define('_LINK_ADDED_TAG', 'Tag link added');
define('_LINK_DELETED_TAG', 'Tag link deleted');
define('_LOGIN', 'User connection');
define('_LOGOUT', 'User disconnection');
// ADMINISTRATION
define('_USERS', 'Users');
......
......@@ -160,6 +160,7 @@ define('_DOCUMENT_UNSIGNED', 'Document dé-signé');
define('_LINK_ADDED_TAG', 'Liaison de mot-clé ajoutée');
define('_LINK_DELETED_TAG', 'Liaison de mot-clé supprimée');
define('_LOGIN', 'Connexion de l\'utilisateur');
define('_LOGOUT', 'Déconnexion de l\'utilisateur');
// ADMINISTRATION
define('_USERS', 'Utilisateurs');
......
......@@ -59,7 +59,7 @@
</a>
</div>
<div *ngIf="showLogout()" style="text-align:right;flex:2;">
<a (click)="authService.logout()" style="cursor:pointer; color: white;padding-right: 10px;">
<a (click)="authService.logout(true, false, true)" style="cursor:pointer; color: white;padding-right: 10px;">
<span class="badge action-header-profile">{{'lang.logout' | translate}}</span>
</a>
</div>
......
......@@ -123,11 +123,14 @@ export class AuthService {
);
}
async logout(cleanUrl: boolean = true, forcePageLogin: boolean = false) {
async logout(cleanUrl: boolean = true, forcePageLogin: boolean = false, history: boolean = false) {
if (['cas', 'keycloak'].indexOf(this.authMode) > -1 && !forcePageLogin) {
this.SsoLogout(cleanUrl);
} else {
// AVOID UNLOCK ON DESROY COMPONENT
if (history) {
this.http.get('../rest/authenticate/logout').subscribe();
}
// AVOID UNLOCK ON DESTROY COMPONENT
if (['process', 'signatureBook'].indexOf(this.router.url.split('/')[1]) > -1) {
this.router.navigate(['/home']);
setTimeout(() => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment