From 3fbdf735ee612f289a22c43f606cf1e78401ccc2 Mon Sep 17 00:00:00 2001 From: woogerboy21 Date: Tue, 1 Jul 2014 01:10:02 -0400 Subject: [PATCH] Server Startup Verify Implement check during server startup to validate it wont start with no db connection yet require registered users. --- servatrice/src/servatrice.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/servatrice/src/servatrice.cpp b/servatrice/src/servatrice.cpp index ee5133390..a313a9b5c 100644 --- a/servatrice/src/servatrice.cpp +++ b/servatrice/src/servatrice.cpp @@ -132,12 +132,18 @@ bool Servatrice::initServer() { serverName = settings->value("server/name").toString(); serverId = settings->value("server/id", 0).toInt(); - + regServerOnly = settings->value("server/regonly", 0).toBool(); + const QString authenticationMethodStr = settings->value("authentication/method").toString(); - if (authenticationMethodStr == "sql") + if (authenticationMethodStr == "sql") { authenticationMethod = AuthenticationSql; - else + } else { + if (regServerOnly) { + qDebug() << "Registration only server enabled but no DB Connection : Error."; + return false; + } authenticationMethod = AuthenticationNone; + } QString dbTypeStr = settings->value("database/type").toString(); if (dbTypeStr == "mysql")