@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function createUser(string $userId, string $displayName) : void |
61 | 61 | { |
62 | 62 | $user = array("userId"=>$userId, |
63 | - "displayName"=>$displayName); |
|
63 | + "displayName"=>$displayName); |
|
64 | 64 | $this->_saveUser($userId, $user); |
65 | 65 | } |
66 | 66 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | if ($data = $this->_loadUser($userId)) { |
92 | 92 | if (isset($data["notificationType"])) { |
93 | - return $data["notificationType"]; |
|
93 | + return $data["notificationType"]; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | return ''; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | if ($data = $this->_loadUser($userId)) { |
115 | 115 | if (isset($data["notificationAddress"])) { |
116 | - return $data["notificationAddress"]; |
|
116 | + return $data["notificationAddress"]; |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | $this->logger->info('Unable to find notification address for user'); |
@@ -54,8 +54,8 @@ |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | $envelope = array("expire"=>$expire, |
57 | - "createdAt"=>time(), |
|
58 | - "value"=>$value); |
|
57 | + "createdAt"=>time(), |
|
58 | + "value"=>$value); |
|
59 | 59 | $filename = $this->getFilenameByKey($key); |
60 | 60 | |
61 | 61 | if (!file_put_contents($filename, serialize($envelope))) { |
@@ -21,7 +21,6 @@ |
||
21 | 21 | * |
22 | 22 | * |
23 | 23 | * Create SQL table (MySQL): |
24 | - |
|
25 | 24 | * CREATE TABLE IF NOT EXISTS tiqrstate ( |
26 | 25 | key varchar(255) PRIMARY KEY, |
27 | 26 | expire BIGINT, |
@@ -571,17 +571,17 @@ discard block |
||
571 | 571 | } |
572 | 572 | |
573 | 573 | $metadata = array("service"=> |
574 | - array("displayName" => $this->_name, |
|
575 | - "identifier" => $this->_identifier, |
|
576 | - "logoUrl" => $this->_logoUrl, |
|
577 | - "infoUrl" => $this->_infoUrl, |
|
578 | - "authenticationUrl" => $authenticationUrl, |
|
579 | - "ocraSuite" => $this->_ocraSuite, |
|
580 | - "enrollmentUrl" => $enrollmentUrl |
|
581 | - ), |
|
582 | - "identity"=> |
|
583 | - array("identifier" =>$data["userId"], |
|
584 | - "displayName"=>$data["displayName"])); |
|
574 | + array("displayName" => $this->_name, |
|
575 | + "identifier" => $this->_identifier, |
|
576 | + "logoUrl" => $this->_logoUrl, |
|
577 | + "infoUrl" => $this->_infoUrl, |
|
578 | + "authenticationUrl" => $authenticationUrl, |
|
579 | + "ocraSuite" => $this->_ocraSuite, |
|
580 | + "enrollmentUrl" => $enrollmentUrl |
|
581 | + ), |
|
582 | + "identity"=> |
|
583 | + array("identifier" =>$data["userId"], |
|
584 | + "displayName"=>$data["displayName"])); |
|
585 | 585 | |
586 | 586 | $this->_unsetStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey); |
587 | 587 | |
@@ -611,28 +611,28 @@ discard block |
||
611 | 611 | */ |
612 | 612 | public function getEnrollmentSecret(string $enrollmentKey): string |
613 | 613 | { |
614 | - $data = $this->_getStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey); |
|
615 | - if (!is_array($data)) { |
|
616 | - $this->logger->error('getEnrollmentSecret: enrollment key not found'); |
|
617 | - throw new RuntimeException('enrollment key not found'); |
|
618 | - } |
|
619 | - $userId = $data["userId"] ?? NULL; |
|
620 | - $sessionId = $data["sessionId"] ?? NULL; |
|
621 | - if (!is_string($userId) || !(is_string($sessionId))) { |
|
622 | - throw new RuntimeException('getEnrollmentSecret: invalid enrollment data'); |
|
623 | - } |
|
624 | - $enrollmentData = [ |
|
625 | - "userId" => $userId, |
|
626 | - "sessionId" => $sessionId |
|
627 | - ]; |
|
628 | - $enrollmentSecret = $this->_uniqueSessionKey(); |
|
629 | - $this->_setStateValue( |
|
630 | - self::PREFIX_ENROLLMENT_SECRET, |
|
631 | - $enrollmentSecret, |
|
632 | - $enrollmentData, |
|
633 | - self::ENROLLMENT_EXPIRE |
|
634 | - ); |
|
635 | - return $enrollmentSecret; |
|
614 | + $data = $this->_getStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey); |
|
615 | + if (!is_array($data)) { |
|
616 | + $this->logger->error('getEnrollmentSecret: enrollment key not found'); |
|
617 | + throw new RuntimeException('enrollment key not found'); |
|
618 | + } |
|
619 | + $userId = $data["userId"] ?? NULL; |
|
620 | + $sessionId = $data["sessionId"] ?? NULL; |
|
621 | + if (!is_string($userId) || !(is_string($sessionId))) { |
|
622 | + throw new RuntimeException('getEnrollmentSecret: invalid enrollment data'); |
|
623 | + } |
|
624 | + $enrollmentData = [ |
|
625 | + "userId" => $userId, |
|
626 | + "sessionId" => $sessionId |
|
627 | + ]; |
|
628 | + $enrollmentSecret = $this->_uniqueSessionKey(); |
|
629 | + $this->_setStateValue( |
|
630 | + self::PREFIX_ENROLLMENT_SECRET, |
|
631 | + $enrollmentSecret, |
|
632 | + $enrollmentData, |
|
633 | + self::ENROLLMENT_EXPIRE |
|
634 | + ); |
|
635 | + return $enrollmentSecret; |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | /** |
@@ -30,13 +30,11 @@ |
||
30 | 30 | notificationtype varchar(10), |
31 | 31 | notificationaddress varchar(64) |
32 | 32 | ); |
33 | - |
|
34 | 33 | * |
35 | 34 | * In version 3.0 the format of the tmpblocktimestamp was changed from a datetime format to an integer. |
36 | 35 | * Because it holds a unix timestamp a 64-bit (8-byte) integer. To upgrade the user table to the new format use: |
37 | 36 | |
38 | 37 | ALTER TABLE user MODIFY tmpblocktimestamp BIGINT; |
39 | - |
|
40 | 38 | */ |
41 | 39 | |
42 | 40 | use Psr\Log\LoggerInterface; |