()
| 31 | } |
| 32 | |
| 33 | public static function hasAnyUsers(): bool |
| 34 | { |
| 35 | self::ensureUserCaseMigration(); |
| 36 | $usersFile = USERS_DIR . USERS_FILE; |
| 37 | if (!is_file($usersFile)) { |
| 38 | return false; |
| 39 | } |
| 40 | |
| 41 | $lines = file($usersFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: []; |
| 42 | foreach ($lines as $line) { |
| 43 | $parts = explode(':', trim($line)); |
| 44 | if (count($parts) >= 3 && preg_match(REGEX_USER, $parts[0])) { |
| 45 | return true; |
| 46 | } |
| 47 | } |
| 48 | return false; |
| 49 | } |
| 50 | |
| 51 | public static function isInitialSetupAllowed(): bool |
| 52 | { |
no test coverage detected