From: Maxim Mamontov Date: Thu, 29 May 2014 08:31:11 +0000 (+0300) Subject: Implemeted chg-admin. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/62eea3f0caac1da5cef3328538d1d7fcbcc3463a Implemeted chg-admin. --- diff --git a/projects/sgconf/admins.cpp b/projects/sgconf/admins.cpp index 739a8aef..7161e1ef 100644 --- a/projects/sgconf/admins.cpp +++ b/projects/sgconf/admins.cpp @@ -154,7 +154,6 @@ bool AddAdminFunction(const SGCONF::CONFIG & config, const std::string & arg, const std::map & options) { -// TODO ADMIN_CONF_RES conf; conf.login = arg; SGCONF::MaybeSet(options, "priv", conf.priv, ConvPriv); @@ -170,9 +169,15 @@ bool ChgAdminFunction(const SGCONF::CONFIG & config, const std::string & arg, const std::map & options) { -// TODO -std::cerr << "Unimplemented.\n"; -return false; +ADMIN_CONF_RES conf; +conf.login = arg; +SGCONF::MaybeSet(options, "priv", conf.priv, ConvPriv); +SGCONF::MaybeSet(options, "password", conf.password); +STG::SERVCONF proto(config.server.data(), + config.port.data(), + config.userName.data(), + config.userPass.data()); +return proto.ChgAdmin(conf, SimpleCallback, NULL) == STG::st_ok; } } // namespace anonymous