OtHireAdapter.php

main 36 lines · 803 bytes Raw
Alex Alex Commit Initial commit 01/10/2026 09:20
1<?php
2/**
3 * otHire: accounts have no `name` column, an account is identified by its
4 * numeric id everywhere a TFS-based engine would use a name.
5 */
6final class OtHireAdapter implements ServerAdapterInterface
7{
8 public function key(): string {
9 return 'OTHIRE';
10 }
11
12 public function login(string $username, string $password): int|false {
13 return user_login($username, $password);
14 }
15
16 public function accountIdentityColumn(): string {
17 return 'id';
18 }
19
20 public function accountDisplayColumn(): string {
21 return '`a`.`id`';
22 }
23
24 public function supportsLegacyTwoFactor(): bool {
25 return false;
26 }
27
28 public function onlineCount(): int {
29 return znote_sql_count("SELECT COUNT(*) AS `c` FROM `players` WHERE `online` > 0;");
30 }
31
32 public function normalizedEngine(): string {
33 return 'OTHIRE';
34 }
35}
36
Top