X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c00e81f9f50c4fe50ee32b02a689d68c9bc595b6..669bf62b01b121a3c9fc5092cd9d2ab3392fd92c:/projects/sgconf/admins.cpp?ds=sidebyside diff --git a/projects/sgconf/admins.cpp b/projects/sgconf/admins.cpp index 6a59fa28..7161e1ef 100644 --- a/projects/sgconf/admins.cpp +++ b/projects/sgconf/admins.cpp @@ -154,10 +154,10 @@ 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); +SGCONF::MaybeSet(options, "password", conf.password); STG::SERVCONF proto(config.server.data(), config.port.data(), config.userName.data(), @@ -169,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