We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dcabee7 commit fb01e9dCopy full SHA for fb01e9d
1 file changed
caliper/app/Caliper/Traits/Util.php
@@ -31,12 +31,21 @@ protected function getUser(string $id): ?User
31
}
32
33
34
- public function getAnonymizedUsername(User $actor): string
+ public function getUsername(User $actor): ?string
35
{
36
if ($this->isEnabledEppn()) {
37
- $username = ($actor->auth === 'lti')
+ return ($actor->auth === 'lti')
38
? $actor->alternatename
39
: $actor->username;
40
+ } else {
41
+ return $actor->username;
42
+ }
43
44
+
45
+ public function getAnonymizedUsername(User $actor): string
46
+ {
47
+ if ($this->isEnabledEppn()) {
48
+ $username = $this->getUsername($actor);
49
$hash = $username ? hash('sha256', $username) : '';
50
$eppn = Eppn::where('username', $username)->first();
51
if (is_null($eppn)) {
0 commit comments