| @@ 121-133 (lines=13) @@ | ||
| 118 | return 1 === $stmt->rowCount(); |
|
| 119 | } |
|
| 120 | ||
| 121 | public function hasVootToken($externalUserId) |
|
| 122 | { |
|
| 123 | $userId = $this->getUserId($externalUserId); |
|
| 124 | $stmt = $this->db->prepare( |
|
| 125 | 'SELECT COUNT(*) |
|
| 126 | FROM voot_tokens |
|
| 127 | WHERE user_id = :user_id' |
|
| 128 | ); |
|
| 129 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 130 | $stmt->execute(); |
|
| 131 | ||
| 132 | return 1 === intval($stmt->fetchColumn()); |
|
| 133 | } |
|
| 134 | ||
| 135 | public function deleteVootToken($externalUserId) |
|
| 136 | { |
|
| @@ 135-146 (lines=12) @@ | ||
| 132 | return 1 === intval($stmt->fetchColumn()); |
|
| 133 | } |
|
| 134 | ||
| 135 | public function deleteVootToken($externalUserId) |
|
| 136 | { |
|
| 137 | $userId = $this->getUserId($externalUserId); |
|
| 138 | $stmt = $this->db->prepare( |
|
| 139 | 'DELETE FROM voot_tokens WHERE user_id = :user_id' |
|
| 140 | ); |
|
| 141 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 142 | ||
| 143 | $stmt->execute(); |
|
| 144 | ||
| 145 | return 1 === $stmt->rowCount(); |
|
| 146 | } |
|
| 147 | ||
| 148 | public function hasTotpSecret($externalUserId) |
|
| 149 | { |
|
| @@ 148-160 (lines=13) @@ | ||
| 145 | return 1 === $stmt->rowCount(); |
|
| 146 | } |
|
| 147 | ||
| 148 | public function hasTotpSecret($externalUserId) |
|
| 149 | { |
|
| 150 | $userId = $this->getUserId($externalUserId); |
|
| 151 | $stmt = $this->db->prepare( |
|
| 152 | 'SELECT COUNT(*) |
|
| 153 | FROM totp_secrets |
|
| 154 | WHERE user_id = :user_id' |
|
| 155 | ); |
|
| 156 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 157 | $stmt->execute(); |
|
| 158 | ||
| 159 | return 1 === intval($stmt->fetchColumn()); |
|
| 160 | } |
|
| 161 | ||
| 162 | public function getTotpSecret($externalUserId) |
|
| 163 | { |
|
| @@ 195-206 (lines=12) @@ | ||
| 192 | return true; |
|
| 193 | } |
|
| 194 | ||
| 195 | public function deleteTotpSecret($externalUserId) |
|
| 196 | { |
|
| 197 | $userId = $this->getUserId($externalUserId); |
|
| 198 | $stmt = $this->db->prepare( |
|
| 199 | 'DELETE FROM totp_secrets WHERE user_id = :user_id' |
|
| 200 | ); |
|
| 201 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 202 | ||
| 203 | $stmt->execute(); |
|
| 204 | ||
| 205 | return 1 === $stmt->rowCount(); |
|
| 206 | } |
|
| 207 | ||
| 208 | public function deleteUser($externalUserId) |
|
| 209 | { |
|
| @@ 314-325 (lines=12) @@ | ||
| 311 | return 1 === $stmt->rowCount(); |
|
| 312 | } |
|
| 313 | ||
| 314 | public function isDisabledUser($externalUserId) |
|
| 315 | { |
|
| 316 | $stmt = $this->db->prepare( |
|
| 317 | 'SELECT COUNT(*) |
|
| 318 | FROM users |
|
| 319 | WHERE external_user_id = :external_user_id AND is_disabled = 1' |
|
| 320 | ); |
|
| 321 | $stmt->bindValue(':external_user_id', $externalUserId, PDO::PARAM_STR); |
|
| 322 | $stmt->execute(); |
|
| 323 | ||
| 324 | return 1 === intval($stmt->fetchColumn()); |
|
| 325 | } |
|
| 326 | ||
| 327 | public function getAllLogEntries() |
|
| 328 | { |
|
| @@ 485-497 (lines=13) @@ | ||
| 482 | return $stmt->fetchColumn(); |
|
| 483 | } |
|
| 484 | ||
| 485 | public function setMotd($motdMessage) |
|
| 486 | { |
|
| 487 | $this->deleteMotd(); |
|
| 488 | ||
| 489 | $stmt = $this->db->prepare( |
|
| 490 | 'INSERT INTO motd (motd_message) VALUES(:motd_message)' |
|
| 491 | ); |
|
| 492 | ||
| 493 | $stmt->bindValue(':motd_message', $motdMessage, PDO::PARAM_STR); |
|
| 494 | $stmt->execute(); |
|
| 495 | ||
| 496 | return 1 === $stmt->rowCount(); |
|
| 497 | } |
|
| 498 | ||
| 499 | public function deleteMotd() |
|
| 500 | { |
|