| @@ 343-354 (lines=12) @@ | ||
| 340 | return 1 === $stmt->rowCount(); |
|
| 341 | } |
|
| 342 | ||
| 343 | public function isDisabledUser($externalUserId) |
|
| 344 | { |
|
| 345 | $stmt = $this->db->prepare( |
|
| 346 | 'SELECT COUNT(*) |
|
| 347 | FROM users |
|
| 348 | WHERE external_user_id = :external_user_id AND is_disabled = 1' |
|
| 349 | ); |
|
| 350 | $stmt->bindValue(':external_user_id', $externalUserId, PDO::PARAM_STR); |
|
| 351 | $stmt->execute(); |
|
| 352 | ||
| 353 | return 1 === intval($stmt->fetchColumn()); |
|
| 354 | } |
|
| 355 | ||
| 356 | public function getAllLogEntries() |
|
| 357 | { |
|
| @@ 110-122 (lines=13) @@ | ||
| 107 | return $userId; |
|
| 108 | } |
|
| 109 | ||
| 110 | public function getVootToken($externalUserId) |
|
| 111 | { |
|
| 112 | $userId = $this->getInternalUserId($externalUserId); |
|
| 113 | $stmt = $this->db->prepare( |
|
| 114 | 'SELECT voot_token |
|
| 115 | FROM voot_tokens |
|
| 116 | WHERE user_id = :user_id' |
|
| 117 | ); |
|
| 118 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 119 | $stmt->execute(); |
|
| 120 | ||
| 121 | return $stmt->fetchColumn(); |
|
| 122 | } |
|
| 123 | ||
| 124 | public function setVootToken($externalUserId, $vootToken) |
|
| 125 | { |
|
| @@ 179-191 (lines=13) @@ | ||
| 176 | return 1 === intval($stmt->fetchColumn()); |
|
| 177 | } |
|
| 178 | ||
| 179 | public function getTotpSecret($externalUserId) |
|
| 180 | { |
|
| 181 | $userId = $this->getInternalUserId($externalUserId); |
|
| 182 | $stmt = $this->db->prepare( |
|
| 183 | 'SELECT totp_secret |
|
| 184 | FROM totp_secrets |
|
| 185 | WHERE user_id = :user_id' |
|
| 186 | ); |
|
| 187 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 188 | $stmt->execute(); |
|
| 189 | ||
| 190 | return $stmt->fetchColumn(); |
|
| 191 | } |
|
| 192 | ||
| 193 | public function setTotpSecret($externalUserId, $totpSecret) |
|
| 194 | { |
|
| @@ 537-549 (lines=13) @@ | ||
| 534 | return $stmt->fetchColumn(); |
|
| 535 | } |
|
| 536 | ||
| 537 | public function setMotd($motdMessage) |
|
| 538 | { |
|
| 539 | $this->deleteMotd(); |
|
| 540 | ||
| 541 | $stmt = $this->db->prepare( |
|
| 542 | 'INSERT INTO motd (motd_message) VALUES(:motd_message)' |
|
| 543 | ); |
|
| 544 | ||
| 545 | $stmt->bindValue(':motd_message', $motdMessage, PDO::PARAM_STR); |
|
| 546 | $stmt->execute(); |
|
| 547 | ||
| 548 | return 1 === $stmt->rowCount(); |
|
| 549 | } |
|
| 550 | ||
| 551 | public function deleteMotd() |
|
| 552 | { |
|