From 62eea3f0caac1da5cef3328538d1d7fcbcc3463a Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Thu, 29 May 2014 11:31:11 +0300 Subject: [PATCH] Implemeted chg-admin. --- projects/sgconf/admins.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 -- 2.44.2