Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
53 | public function authenticate(): bool |
||
54 | { |
||
55 | if (preg_match('#^/index.php/api/v2/office/wopi/files/#', $_SERVER['ORIG_SCRIPT_NAME']) === false) { |
||
56 | return false; |
||
57 | } |
||
58 | |||
59 | $token = $_GET['access_token'] ?? null; |
||
60 | |||
61 | if ($token === null) { |
||
62 | return false; |
||
63 | } |
||
64 | |||
65 | $user = $this->manager->authenticate($token); |
||
66 | |||
67 | $this->identifier = $user->getUsername(); |
||
68 | $this->attributes = $user->getAttributes(); |
||
69 | |||
70 | return true; |
||
71 | } |
||
72 | |||
81 |