Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit e51d001

Browse files
Merge pull request #12 from pajavyskocil/logging
Every successfully log in is logged with notice level
2 parents 6d4254c + 71e909f commit e51d001

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
[Added]
6+
- Every successfully log in is logged with notice level
57

68
## [v2.0.0]
79
[Added]

lib/Auth/Process/statistics.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ public function process(&$request)
2525
{
2626
$dateTime = new DateTime();
2727
DatabaseCommand::insertLogin($request, $dateTime);
28+
29+
$eduPersonUniqueId = $request['Attributes']['eduPersonUniqueId'][0];
30+
$spEntityId = $request['SPMetadata']['entityid'];
31+
$sourceIdPEppn = $request['Attributes']['sourceIdPEppn'][0];
32+
$sourceIdPEntityId = $request['Attributes']['sourceIdPEntityID'][0];
33+
34+
if (isset($request['perun']['user'])) {
35+
$user = $request['perun']['user'];
36+
SimpleSAML\Logger::notice('UserId: ' . $user->getId() . ', identity: ' . $eduPersonUniqueId . ', service: ' . $spEntityId .
37+
', external identity: ' . $sourceIdPEppn . ' from ' . $sourceIdPEntityId);
38+
} else {
39+
SimpleSAML\Logger::notice('User identity: ' . $eduPersonUniqueId . ', service: ' . $spEntityId .
40+
', external identity: ' . $sourceIdPEppn . ' from ' . $sourceIdPEntityId);
41+
}
42+
2843
}
2944

3045
}

0 commit comments

Comments
 (0)