From 775c2a2e173c8e71745ced32e3df30cef148d694 Mon Sep 17 00:00:00 2001 From: HanzZ Date: Mon, 9 Apr 2012 09:33:14 +0200 Subject: [PATCH] fixed allowed_servers --- src/config.cpp | 2 +- src/userregistration.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index b3b263ff..263a2507 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -70,7 +70,7 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description ("service.protocol", value()->default_value(""), "Protocol") ("service.pidfile", value()->default_value("/var/run/spectrum2/$jid.pid"), "Full path to pid file") ("service.working_dir", value()->default_value("/var/lib/spectrum2/$jid"), "Working dir") - ("service.allowed_servers", value()->default_value(""), "Only users from these servers can connect") + ("service.allowed_servers", value >()->multitoken(), "Only users from these servers can connect") ("service.server_mode", value()->default_value(false), "True if Spectrum should behave as server") ("service.users_per_backend", value()->default_value(100), "Number of users per one legacy network backend") ("service.backend_host", value()->default_value("localhost"), "Host to bind backend server to") diff --git a/src/userregistration.cpp b/src/userregistration.cpp index 0e23217f..2be05fb2 100644 --- a/src/userregistration.cpp +++ b/src/userregistration.cpp @@ -168,7 +168,7 @@ bool UserRegistration::handleGetRequest(const Swift::JID& from, const Swift::JID std::string barejid = from.toBare().toString(); if (!CONFIG_BOOL(m_config,"registration.enable_public_registration")) { - std::list const &x = CONFIG_LIST(m_config,"service.allowed_servers"); + std::vector const &x = CONFIG_VECTOR(m_config,"service.allowed_servers"); if (std::find(x.begin(), x.end(), from.getDomain()) == x.end()) { LOG4CXX_INFO(logger, barejid << ": This user has no permissions to register an account") sendError(from, id, ErrorPayload::BadRequest, ErrorPayload::Modify); @@ -275,7 +275,7 @@ bool UserRegistration::handleSetRequest(const Swift::JID& from, const Swift::JID std::string barejid = from.toBare().toString(); if (!CONFIG_BOOL(m_config,"registration.enable_public_registration")) { - std::list const &x = CONFIG_LIST(m_config,"service.allowed_servers"); + std::vector const &x = CONFIG_VECTOR(m_config,"service.allowed_servers"); if (std::find(x.begin(), x.end(), from.getDomain()) == x.end()) { LOG4CXX_INFO(logger, barejid << ": This user has no permissions to register an account") sendError(from, id, ErrorPayload::BadRequest, ErrorPayload::Modify);