more fixes
This commit is contained in:
parent
10f94e5e82
commit
996a48005b
2 changed files with 11 additions and 14 deletions
|
@ -310,7 +310,7 @@ static void ask_local_servers(ManagerConfig *config, Swift::BoostNetworkFactorie
|
|||
std::cerr << "Can't load config file " << itr->path().string() << ". Skipping...\n";
|
||||
}
|
||||
|
||||
if (CONFIG_STRING(&cfg, "service.admin_jid").empty() || CONFIG_STRING(&cfg, "service.admin_password").empty()) {
|
||||
if (CONFIG_VECTOR(&cfg, "service.admin_jid").empty() || CONFIG_STRING(&cfg, "service.admin_password").empty()) {
|
||||
std::cerr << itr->path().string() << ": service.admin_jid or service.admin_password empty. This server can't be queried over XMPP.\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -38,19 +38,16 @@ UserRegistry::UserRegistry(Config *cfg, Swift::NetworkFactories *factories) {
|
|||
UserRegistry::~UserRegistry() { m_removeTimer->stop(); }
|
||||
|
||||
void UserRegistry::isValidUserPassword(const Swift::JID& user, Swift::ServerFromClientSession *session, const Swift::SafeByteArray& password) {
|
||||
|
||||
// if (!CONFIG_STRING(config, "service.admin_jid").empty() ) {
|
||||
std::vector<std::string> const &x = CONFIG_VECTOR(config,"service.admin_jid");
|
||||
if (std::find(x.begin(), x.end(), user.toBare().toString()) != x.end()) {
|
||||
if (Swift::safeByteArrayToString(password) == CONFIG_STRING(config, "service.admin_password")) {
|
||||
session->handlePasswordValid();
|
||||
}
|
||||
else {
|
||||
session->handlePasswordInvalid();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// }
|
||||
std::vector<std::string> const &x = CONFIG_VECTOR(config,"service.admin_jid");
|
||||
if (std::find(x.begin(), x.end(), user.toBare().toString()) != x.end()) {
|
||||
if (Swift::safeByteArrayToString(password) == CONFIG_STRING(config, "service.admin_password")) {
|
||||
session->handlePasswordValid();
|
||||
}
|
||||
else {
|
||||
session->handlePasswordInvalid();
|
||||
}
|
||||
return;
|
||||
}
|
||||
std::string key = user.toBare().toString();
|
||||
|
||||
// Users try to connect twice
|
||||
|
|
Loading…
Add table
Reference in a new issue