X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/44f946bf4726800b7229f7c688c626fde469210b..40d6bc4eb474e1e34c769ac247e63a127181e7f5:/projects/sgconf/admins.cpp 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