-bool SGCONF::ChgAdminFunction(const SGCONF::CONFIG & config,
- const std::string & arg,
- const std::map<std::string, std::string> & options)
+bool ChgAdminFunction(const SGCONF::CONFIG & config,
+ const std::string & arg,
+ const std::map<std::string, std::string> & options)
+{
+STG::AdminConfOpt 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.localAddress.data(),
+ config.localPort.data(),
+ config.userName.data(),
+ config.userPass.data());
+return proto.ChgAdmin(conf, SimpleCallback, NULL) == STG::st_ok;
+}
+
+} // namespace anonymous
+
+void SGCONF::AppendAdminsOptionBlock(COMMANDS & commands, OPTION_BLOCKS & blocks)