| @@ 119-131 (lines=13) @@ | ||
| 116 | return 1 === $stmt->rowCount(); |
|
| 117 | } |
|
| 118 | ||
| 119 | public function hasVootToken($externalUserId) |
|
| 120 | { |
|
| 121 | $userId = $this->getUserId($externalUserId); |
|
| 122 | $stmt = $this->db->prepare( |
|
| 123 | 'SELECT COUNT(*) |
|
| 124 | FROM voot_tokens |
|
| 125 | WHERE user_id = :user_id' |
|
| 126 | ); |
|
| 127 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 128 | $stmt->execute(); |
|
| 129 | ||
| 130 | return 1 === intval($stmt->fetchColumn()); |
|
| 131 | } |
|
| 132 | ||
| 133 | public function deleteVootToken($externalUserId) |
|
| 134 | { |
|
| @@ 133-144 (lines=12) @@ | ||
| 130 | return 1 === intval($stmt->fetchColumn()); |
|
| 131 | } |
|
| 132 | ||
| 133 | public function deleteVootToken($externalUserId) |
|
| 134 | { |
|
| 135 | $userId = $this->getUserId($externalUserId); |
|
| 136 | $stmt = $this->db->prepare( |
|
| 137 | 'DELETE FROM voot_tokens WHERE user_id = :user_id' |
|
| 138 | ); |
|
| 139 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 140 | ||
| 141 | $stmt->execute(); |
|
| 142 | ||
| 143 | return 1 === $stmt->rowCount(); |
|
| 144 | } |
|
| 145 | ||
| 146 | public function hasTotpSecret($externalUserId) |
|
| 147 | { |
|
| @@ 146-158 (lines=13) @@ | ||
| 143 | return 1 === $stmt->rowCount(); |
|
| 144 | } |
|
| 145 | ||
| 146 | public function hasTotpSecret($externalUserId) |
|
| 147 | { |
|
| 148 | $userId = $this->getUserId($externalUserId); |
|
| 149 | $stmt = $this->db->prepare( |
|
| 150 | 'SELECT COUNT(*) |
|
| 151 | FROM totp_secrets |
|
| 152 | WHERE user_id = :user_id' |
|
| 153 | ); |
|
| 154 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 155 | $stmt->execute(); |
|
| 156 | ||
| 157 | return 1 === intval($stmt->fetchColumn()); |
|
| 158 | } |
|
| 159 | ||
| 160 | public function getTotpSecret($externalUserId) |
|
| 161 | { |
|
| @@ 188-199 (lines=12) @@ | ||
| 185 | return 1 === $stmt->rowCount(); |
|
| 186 | } |
|
| 187 | ||
| 188 | public function deleteTotpSecret($externalUserId) |
|
| 189 | { |
|
| 190 | $userId = $this->getUserId($externalUserId); |
|
| 191 | $stmt = $this->db->prepare( |
|
| 192 | 'DELETE FROM totp_secrets WHERE user_id = :user_id' |
|
| 193 | ); |
|
| 194 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 195 | ||
| 196 | $stmt->execute(); |
|
| 197 | ||
| 198 | return 1 === $stmt->rowCount(); |
|
| 199 | } |
|
| 200 | ||
| 201 | public function deleteUser($externalUserId) |
|
| 202 | { |
|
| @@ 307-318 (lines=12) @@ | ||
| 304 | return 1 === $stmt->rowCount(); |
|
| 305 | } |
|
| 306 | ||
| 307 | public function isDisabledUser($externalUserId) |
|
| 308 | { |
|
| 309 | $stmt = $this->db->prepare( |
|
| 310 | 'SELECT COUNT(*) |
|
| 311 | FROM users |
|
| 312 | WHERE external_user_id = :external_user_id AND is_disabled = 1' |
|
| 313 | ); |
|
| 314 | $stmt->bindValue(':external_user_id', $externalUserId, PDO::PARAM_STR); |
|
| 315 | $stmt->execute(); |
|
| 316 | ||
| 317 | return 1 === intval($stmt->fetchColumn()); |
|
| 318 | } |
|
| 319 | ||
| 320 | public function clientConnect($profileId, $commonName, $ip4, $ip6, $connectedAt) |
|
| 321 | { |
|
| @@ 460-472 (lines=13) @@ | ||
| 457 | return $stmt->fetchColumn(); |
|
| 458 | } |
|
| 459 | ||
| 460 | public function setMotd($motdMessage) |
|
| 461 | { |
|
| 462 | $this->deleteMotd(); |
|
| 463 | ||
| 464 | $stmt = $this->db->prepare( |
|
| 465 | 'INSERT INTO motd (motd_message) VALUES(:motd_message)' |
|
| 466 | ); |
|
| 467 | ||
| 468 | $stmt->bindValue(':motd_message', $motdMessage, PDO::PARAM_STR); |
|
| 469 | $stmt->execute(); |
|
| 470 | ||
| 471 | return 1 === $stmt->rowCount(); |
|
| 472 | } |
|
| 473 | ||
| 474 | public function deleteMotd() |
|
| 475 | { |
|