| @@ 119-130 (lines=12) @@ | ||
| 116 | return 1 === $stmt->rowCount(); |
|
| 117 | } |
|
| 118 | ||
| 119 | public function deleteVootToken($externalUserId) |
|
| 120 | { |
|
| 121 | $userId = $this->getUserId($externalUserId); |
|
| 122 | $stmt = $this->db->prepare( |
|
| 123 | 'DELETE FROM voot_tokens WHERE user_id = :user_id' |
|
| 124 | ); |
|
| 125 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 126 | ||
| 127 | $stmt->execute(); |
|
| 128 | ||
| 129 | return 1 === $stmt->rowCount(); |
|
| 130 | } |
|
| 131 | ||
| 132 | public function hasTotpSecret($externalUserId) |
|
| 133 | { |
|
| @@ 132-144 (lines=13) @@ | ||
| 129 | return 1 === $stmt->rowCount(); |
|
| 130 | } |
|
| 131 | ||
| 132 | public function hasTotpSecret($externalUserId) |
|
| 133 | { |
|
| 134 | $userId = $this->getUserId($externalUserId); |
|
| 135 | $stmt = $this->db->prepare( |
|
| 136 | 'SELECT COUNT(*) |
|
| 137 | FROM totp_secrets |
|
| 138 | WHERE user_id = :user_id' |
|
| 139 | ); |
|
| 140 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 141 | $stmt->execute(); |
|
| 142 | ||
| 143 | return 1 === intval($stmt->fetchColumn()); |
|
| 144 | } |
|
| 145 | ||
| 146 | public function getTotpSecret($externalUserId) |
|
| 147 | { |
|
| @@ 174-185 (lines=12) @@ | ||
| 171 | return 1 === $stmt->rowCount(); |
|
| 172 | } |
|
| 173 | ||
| 174 | public function deleteTotpSecret($externalUserId) |
|
| 175 | { |
|
| 176 | $userId = $this->getUserId($externalUserId); |
|
| 177 | $stmt = $this->db->prepare( |
|
| 178 | 'DELETE FROM totp_secrets WHERE user_id = :user_id' |
|
| 179 | ); |
|
| 180 | $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR); |
|
| 181 | ||
| 182 | $stmt->execute(); |
|
| 183 | ||
| 184 | return 1 === $stmt->rowCount(); |
|
| 185 | } |
|
| 186 | ||
| 187 | public function deleteUser($externalUserId) |
|
| 188 | { |
|
| @@ 293-304 (lines=12) @@ | ||
| 290 | return 1 === $stmt->rowCount(); |
|
| 291 | } |
|
| 292 | ||
| 293 | public function isDisabledUser($externalUserId) |
|
| 294 | { |
|
| 295 | $stmt = $this->db->prepare( |
|
| 296 | 'SELECT COUNT(*) |
|
| 297 | FROM users |
|
| 298 | WHERE external_user_id = :external_user_id AND is_disabled = 1' |
|
| 299 | ); |
|
| 300 | $stmt->bindValue(':external_user_id', $externalUserId, PDO::PARAM_STR); |
|
| 301 | $stmt->execute(); |
|
| 302 | ||
| 303 | return 1 === intval($stmt->fetchColumn()); |
|
| 304 | } |
|
| 305 | ||
| 306 | public function clientConnect($profileId, $commonName, $ip4, $ip6, $connectedAt) |
|
| 307 | { |
|
| @@ 445-457 (lines=13) @@ | ||
| 442 | return $stmt->fetchColumn(); |
|
| 443 | } |
|
| 444 | ||
| 445 | public function setMotd($motdMessage) |
|
| 446 | { |
|
| 447 | $this->deleteMotd(); |
|
| 448 | ||
| 449 | $stmt = $this->db->prepare( |
|
| 450 | 'INSERT INTO motd (motd_message) VALUES(:motd_message)' |
|
| 451 | ); |
|
| 452 | ||
| 453 | $stmt->bindValue(':motd_message', $motdMessage, PDO::PARAM_STR); |
|
| 454 | $stmt->execute(); |
|
| 455 | ||
| 456 | return 1 === $stmt->rowCount(); |
|
| 457 | } |
|
| 458 | ||
| 459 | public function deleteMotd() |
|
| 460 | { |
|