From ef5fa0787eabd20beef3110c2fe55955d472ddc9 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Thu, 29 May 2014 17:49:48 +0300 Subject: [PATCH] Implemented check-user. --- projects/sgconf/users.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/projects/sgconf/users.cpp b/projects/sgconf/users.cpp index 9c6c30b5..680625c2 100644 --- a/projects/sgconf/users.cpp +++ b/projects/sgconf/users.cpp @@ -205,9 +205,14 @@ bool CheckUserFunction(const SGCONF::CONFIG & config, const std::string & arg, const std::map & options) { -// TODO -std::cerr << "Unimplemented.\n"; -return false; +std::map::const_iterator it(options.find("password")); +if (it == options.end()) + throw SGCONF::ACTION::ERROR("Password is not specified."); +STG::SERVCONF proto(config.server.data(), + config.port.data(), + config.userName.data(), + config.userPass.data()); +return proto.CheckUser(arg, it->second, SimpleCallback, NULL) == STG::st_ok; } bool SendMessageFunction(const SGCONF::CONFIG & config, -- 2.44.2