<?php
require __DIR__ . '/config.php';
$users = [];
foreach ($CEGIC_ACCOUNTS as $key => $account) {
    $users[] = [
        'user' => $key,
        'name' => $account['name'] ?? '',
        'has_password' => isset($account['password']) && $account['password'] !== ''
    ];
}
cegic_json([
    'ok' => true,
    'php' => PHP_VERSION,
    'users' => $users,
    'posts_file_writable' => is_writable(dirname(CEGIC_POSTS_FILE)) || is_writable(CEGIC_POSTS_FILE),
    'upload_dir_exists' => is_dir(CEGIC_UPLOAD_DIR),
    'upload_dir_writable' => is_writable(CEGIC_UPLOAD_DIR)
]);
