adding posibility to disable user registration
Deploy / deploy (push) Successful in 1m43s

This commit is contained in:
2026-05-10 10:25:18 +02:00
parent 95a6973313
commit 1b95574b76
4 changed files with 68 additions and 2 deletions
+11
View File
@@ -54,4 +54,15 @@ function migrate($db) {
$rootDb->exec("ALTER TABLE neptune.network_nodes ADD COLUMN IF NOT EXISTS notes VARCHAR(1000) DEFAULT '' AFTER group_name");
} catch (Exception $e) {
}
$db->exec("CREATE TABLE IF NOT EXISTS neptune_settings (
setting_key VARCHAR(100) PRIMARY KEY,
setting_value TEXT NOT NULL
)");
try {
$stmt = $db->prepare("SELECT COUNT(*) as c FROM neptune_settings WHERE setting_key = 'registration_enabled'");
$stmt->execute();
if ($stmt->fetch()['c'] == 0) {
$db->exec("INSERT INTO neptune_settings (setting_key, setting_value) VALUES ('registration_enabled', '1')");
}
} catch (Exception $e) {}
}