X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/0eb93798fdb7b37b7d43b92b5166e0ca4dac98b9..ef5fa0787eabd20beef3110c2fe55955d472ddc9:/projects/sgconf/users.cpp 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,