mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
Fix servatrice's regonly mode
This commit is contained in:
parent
faa66e4d7f
commit
15555c16fd
5 changed files with 12 additions and 5 deletions
|
|
@ -136,7 +136,7 @@ bool Servatrice::initServer()
|
|||
{
|
||||
serverName = settingsCache->value("server/name", "My Cockatrice server").toString();
|
||||
serverId = settingsCache->value("server/id", 0).toInt();
|
||||
bool regServerOnly = settingsCache->value("server/regonly", 0).toBool();
|
||||
bool regServerOnly = settingsCache->value("authentication/regonly", 0).toBool();
|
||||
|
||||
const QString authenticationMethodStr = settingsCache->value("authentication/method").toString();
|
||||
if (authenticationMethodStr == "sql") {
|
||||
|
|
|
|||
|
|
@ -89,6 +89,11 @@ bool Servatrice_DatabaseInterface::usernameIsValid(const QString &user)
|
|||
return (result.size() > 0);
|
||||
}
|
||||
|
||||
bool Servatrice_DatabaseInterface::getRequireRegistration()
|
||||
{
|
||||
return settingsCache->value("authentication/regonly", 0).toBool();
|
||||
}
|
||||
|
||||
AuthenticationResult Servatrice_DatabaseInterface::checkUserPassword(Server_ProtocolHandler *handler, const QString &user, const QString &password, QString &reasonStr, int &banSecondsLeft)
|
||||
{
|
||||
switch (server->getAuthenticationMethod()) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ public:
|
|||
void lockSessionTables();
|
||||
void unlockSessionTables();
|
||||
bool userSessionExists(const QString &userName);
|
||||
|
||||
|
||||
bool getRequireRegistration();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue