diff --git a/src/commands.cpp b/src/commands.cpp index 3f3aa4e..11688a2 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -52,7 +52,7 @@ void AOClient::cmdLogin(int argc, QStringList argv) } server->areas.value(current_area)->logger->logLogin(this, authenticated, "moderator"); } - else { + else if (auth_type == "advanced") { if (argc < 2) { sendServerMessage("You must specify a username and a password"); return; @@ -73,6 +73,10 @@ void AOClient::cmdLogin(int argc, QStringList argv) } server->areas.value(current_area)->logger->logLogin(this, authenticated, username); } + else { + qWarning() << "config.ini has an unrecognized auth_type!"; + sendServerMessage("Config.ini contains an invalid auth_type, please check your config."); + } } void AOClient::cmdGetAreas(int argc, QStringList argv) diff --git a/src/config_manager.cpp b/src/config_manager.cpp index 69de3cf..d6893a8 100644 --- a/src/config_manager.cpp +++ b/src/config_manager.cpp @@ -84,6 +84,14 @@ bool ConfigManager::initConfig() // This means the config is invalid return false; } + config.beginGroup("Options"); + QString auth_type = config.value("auth", "simple").toString(); + config.endGroup(); + if (!(auth_type == "simple" || auth_type == "advanced")) { + qCritical() << "config.ini is invalid!"; + return false; + } + else { // Config is valid and up to date, so let's go ahead return true;