From 45284d7e924b1ac340ba527301e90e1199af3011 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 7 Oct 2013 23:25:47 +0300 Subject: [PATCH] Fixed compilation issues. --- include/stg/tariff_conf.h | 40 +++--- include/stg/user_conf.h | 37 +++-- include/stg/user_stat.h | 19 ++- projects/sgconf/common_sg.cpp | 28 ++-- projects/sgconf/main.cpp | 126 +++++++++--------- .../plugins/configuration/sgconfig/parser.cpp | 54 ++++---- .../configuration/sgconfig/parser_admin.cpp | 8 +- stglibs/srvconf.lib/include/stg/servconf.h | 7 +- 8 files changed, 161 insertions(+), 158 deletions(-) diff --git a/include/stg/tariff_conf.h b/include/stg/tariff_conf.h index 5b2eebb9..b554e14a 100644 --- a/include/stg/tariff_conf.h +++ b/include/stg/tariff_conf.h @@ -102,21 +102,21 @@ struct DIRPRICE_DATA_RES return *this; } - DIRPRICE_DATA GetData() + DIRPRICE_DATA GetData() const { DIRPRICE_DATA dd; - dd.hDay = hDay; - dd.hNight = hNight; - dd.mDay = mDay; - dd.mNight = mNight; - dd.noDiscount = noDiscount; - dd.priceDayA = priceDayA; - dd.priceDayB = priceDayB; - - dd.priceNightA = priceNightA; - dd.priceNightB = priceNightB; - dd.singlePrice = singlePrice; - dd.threshold = threshold; + dd.hDay = hDay.data(); + dd.hNight = hNight.data(); + dd.mDay = mDay.data(); + dd.mNight = mNight.data(); + dd.noDiscount = noDiscount.data(); + dd.priceDayA = priceDayA.data(); + dd.priceDayB = priceDayB.data(); + + dd.priceNightA = priceNightA.data(); + dd.priceNightB = priceNightB.data(); + dd.singlePrice = singlePrice.data(); + dd.threshold = threshold.data(); return dd; } @@ -178,14 +178,14 @@ struct TARIFF_CONF_RES return *this; } - TARIFF_CONF GetData() + TARIFF_CONF GetData() const { TARIFF_CONF tc; - tc.fee = fee; - tc.free = free; - tc.name = name; - tc.passiveCost = passiveCost; - tc.traffType = traffType; + tc.fee = fee.data(); + tc.free = free.data(); + tc.name = name.data(); + tc.passiveCost = passiveCost.data(); + tc.traffType = traffType.data(); return tc; } @@ -234,7 +234,7 @@ struct TARIFF_DATA_RES dirPrice(DIR_NUM) {} - TARIFF_DATA GetData() + TARIFF_DATA GetData() const { TARIFF_DATA td; td.tariffConf = tariffConf.GetData(); diff --git a/include/stg/user_conf.h b/include/stg/user_conf.h index 59933658..dcc19afa 100644 --- a/include/stg/user_conf.h +++ b/include/stg/user_conf.h @@ -108,29 +108,29 @@ struct USER_CONF_RES ips = uc.ips; return *this; } - operator USER_CONF() const + USER_CONF GetData() const { USER_CONF uc; - uc.password = password; - uc.passive = passive; - uc.disabled = disabled; - uc.disabledDetailStat = disabledDetailStat; - uc.alwaysOnline = alwaysOnline; - uc.tariffName = tariffName; - uc.address = address; - uc.phone = phone; - uc.email = email; - uc.note = note; - uc.realName = realName; - uc.group = group; - uc.credit = credit; - uc.nextTariff = nextTariff; + uc.password = password.data(); + uc.passive = passive.data(); + uc.disabled = disabled.data(); + uc.disabledDetailStat = disabledDetailStat.data(); + uc.alwaysOnline = alwaysOnline.data(); + uc.tariffName = tariffName.data(); + uc.address = address.data(); + uc.phone = phone.data(); + uc.email = email.data(); + uc.note = note.data(); + uc.realName = realName.data(); + uc.group = group.data(); + uc.credit = credit.data(); + uc.nextTariff = nextTariff.data(); for (int i = 0; i < USERDATA_NUM; i++) { - uc.userdata[i] = userdata[i]; + uc.userdata[i] = userdata[i].data(); } - uc.creditExpire = creditExpire; - uc.ips = ips; + uc.creditExpire = creditExpire.data(); + uc.ips = ips.data(); return uc; } //------------------------------------------------------------------------- @@ -155,4 +155,3 @@ struct USER_CONF_RES }; //----------------------------------------------------------------------------- #endif - diff --git a/include/stg/user_stat.h b/include/stg/user_stat.h index 54f11dec..7775c3b5 100644 --- a/include/stg/user_stat.h +++ b/include/stg/user_stat.h @@ -113,7 +113,6 @@ struct STAT_NODE //----------------------------------------------------------------------------- struct USER_STAT { - //USER_STAT & operator= (const USER_STAT_RES & usr); USER_STAT() : up(), down(), @@ -162,17 +161,17 @@ struct USER_STAT_RES down = us.down; return * this; } - operator USER_STAT() const + USER_STAT GetData() const { USER_STAT us; - us.cash = cash; - us.freeMb = freeMb; - us.lastCashAdd = lastCashAdd; - us.lastCashAddTime = lastCashAddTime; - us.passiveTime = passiveTime; - us.lastActivityTime = lastActivityTime; - us.up = up; - us.down = down; + us.cash = cash.data(); + us.freeMb = freeMb.data(); + us.lastCashAdd = lastCashAdd.data(); + us.lastCashAddTime = lastCashAddTime.data(); + us.passiveTime = passiveTime.data(); + us.lastActivityTime = lastActivityTime.data(); + us.up = up.data(); + us.down = down.data(); return us; } diff --git a/projects/sgconf/common_sg.cpp b/projects/sgconf/common_sg.cpp index 6ccd4fe5..cf0469a3 100644 --- a/projects/sgconf/common_sg.cpp +++ b/projects/sgconf/common_sg.cpp @@ -342,13 +342,13 @@ if (info.login == "") return; } -if (!data->request.cash.res_empty()) +if (!data->request.cash.empty()) cout << "cash = " << info.cash << endl; -if (!data->request.credit.res_empty()) +if (!data->request.credit.empty()) cout << "credit = " << info.credit << endl; -if (!data->request.creditExpire.res_empty()) +if (!data->request.creditExpire.empty()) { char buf[32]; struct tm brokenTime; @@ -368,40 +368,40 @@ if (!data->request.creditExpire.res_empty()) cout << "creditExpire = " << buf << endl; } -if (!data->request.down.res_empty()) +if (!data->request.down.empty()) cout << "down = " << info.down << endl; -if (!data->request.passive.res_empty()) +if (!data->request.passive.empty()) cout << "passive = " << info.passive << endl; -if (!data->request.disableDetailStat.res_empty()) +if (!data->request.disableDetailStat.empty()) cout << "disableDetailStat = " << info.disableDetailStat << endl; -if (!data->request.alwaysOnline.res_empty()) +if (!data->request.alwaysOnline.empty()) cout << "alwaysOnline = " << info.alwaysOnline << endl; -if (!data->request.prepaidTraff.res_empty()) +if (!data->request.prepaidTraff.empty()) cout << "prepaidTraff = " << info.prepaidTraff << endl; for (int i = 0; i < DIR_NUM; i++) { - if (!data->request.sessionUpload[i].res_empty()) + if (!data->request.sessionUpload[i].empty()) cout << "session upload for dir " << i << " = " << info.stat.su[i] << endl; - if (!data->request.sessionDownload[i].res_empty()) + if (!data->request.sessionDownload[i].empty()) cout << "session download for dir " << i << "=" << info.stat.sd[i] << endl; } for (int i = 0; i < DIR_NUM; i++) { - if (!data->request.monthUpload[i].res_empty()) + if (!data->request.monthUpload[i].empty()) cout << "month upload for dir " << i << " = " << info.stat.mu[i] << endl; - if (!data->request.monthDownload[i].res_empty()) + if (!data->request.monthDownload[i].empty()) cout << "month download for dir " << i << " = " << info.stat.md[i] << endl; } for (int i = 0; i < USERDATA_NUM; i++) { - if (!data->request.userData[i].res_empty()) + if (!data->request.userData[i].empty()) { std::string str; ConvertFromKOI8(info.userData[i], &str); @@ -423,7 +423,7 @@ StringReqParams strReqParams[] = }; for (unsigned i = 0; i < sizeof(strReqParams) / sizeof(StringReqParams); i++) { - if (!strReqParams[i].reqParam.res_empty()) + if (!strReqParams[i].reqParam.empty()) { string str; ConvertFromKOI8(*strReqParams[i].value, &str); diff --git a/projects/sgconf/main.cpp b/projects/sgconf/main.cpp index 2c2a8a7b..74097a08 100644 --- a/projects/sgconf/main.cpp +++ b/projects/sgconf/main.cpp @@ -144,7 +144,7 @@ struct option long_options_set[] = { {"email", 1, 0, 'L'}, //emaiL {"phone", 1, 0, 'P'}, //phone {"group", 1, 0, 'G'}, //Group -{"ip", 0, 0, 'I'}, //IP-address of user +{"ip", 0, 0, 'I'}, //IP-address of user {0, 0, 0, 0}}; @@ -374,10 +374,10 @@ memset(str, 0, strLen); r[0] = 0; -if (!req->usrMsg.res_empty()) +if (!req->usrMsg.empty()) { string msg; - Encode12str(msg, req->usrMsg); + Encode12str(msg, req->usrMsg.data()); sprintf(str, "", req->login.const_data().c_str(), msg.c_str()); //sprintf(str, "\n", req->login, msg); strcat(r, str); @@ -403,25 +403,25 @@ if (req->createUser) strcat(r, "\n"); sprintf(str, "\n", req->login.const_data().c_str()); strcat(r, str); -if (!req->credit.res_empty()) +if (!req->credit.empty()) { sprintf(str, "\n", req->credit.const_data()); strcat(r, str); } -if (!req->creditExpire.res_empty()) +if (!req->creditExpire.empty()) { sprintf(str, "\n", req->creditExpire.const_data()); strcat(r, str); } -if (!req->prepaidTraff.res_empty()) +if (!req->prepaidTraff.empty()) { sprintf(str, "\n", req->prepaidTraff.const_data()); strcat(r, str); } -if (!req->cash.res_empty()) +if (!req->cash.empty()) { string msg; Encode12str(msg, req->message); @@ -429,7 +429,7 @@ if (!req->cash.res_empty()) strcat(r, str); } -if (!req->setCash.res_empty()) +if (!req->setCash.empty()) { string msg; Encode12str(msg, req->message); @@ -437,38 +437,38 @@ if (!req->setCash.res_empty()) strcat(r, str); } -if (!req->usrPasswd.res_empty()) +if (!req->usrPasswd.empty()) { sprintf(str, "\n", req->usrPasswd.const_data().c_str()); strcat(r, str); } -if (!req->down.res_empty()) +if (!req->down.empty()) { sprintf(str, "\n", req->down.const_data()); strcat(r, str); } -if (!req->passive.res_empty()) +if (!req->passive.empty()) { sprintf(str, "\n", req->passive.const_data()); strcat(r, str); } -if (!req->disableDetailStat.res_empty()) +if (!req->disableDetailStat.empty()) { sprintf(str, "\n", req->disableDetailStat.const_data()); strcat(r, str); } -if (!req->alwaysOnline.res_empty()) +if (!req->alwaysOnline.empty()) { sprintf(str, "\n", req->alwaysOnline.const_data()); strcat(r, str); } // IP-address of user -if (!req->ips.res_empty()) +if (!req->ips.empty()) { sprintf(str, "\n", req->ips.const_data().c_str()); strcat(r, str); @@ -478,7 +478,7 @@ int uPresent = false; int dPresent = false; for (int i = 0; i < DIR_NUM; i++) { - if (!req->monthUpload[i].res_empty()) + if (!req->monthUpload[i].empty()) { if (!uPresent && !dPresent) { @@ -493,7 +493,7 @@ for (int i = 0; i < DIR_NUM; i++) sprintf(str, "MU%d=\"%s\" ", i, ss.str().c_str()); strcat(r, str); } - if (!req->monthDownload[i].res_empty()) + if (!req->monthDownload[i].empty()) { if (!uPresent && !dPresent) { @@ -507,7 +507,7 @@ for (int i = 0; i < DIR_NUM; i++) sprintf(str, "MD%d=\"%s\" ", i, ss.str().c_str()); strcat(r, str); } - if (!req->sessionUpload[i].res_empty()) + if (!req->sessionUpload[i].empty()) { if (!uPresent && !dPresent) { @@ -522,7 +522,7 @@ for (int i = 0; i < DIR_NUM; i++) sprintf(str, "MU%d=\"%s\" ", i, ss.str().c_str()); strcat(r, str); } - if (!req->sessionDownload[i].res_empty()) + if (!req->sessionDownload[i].empty()) { if (!uPresent && !dPresent) { @@ -544,7 +544,7 @@ if (uPresent || dPresent) //printf("%s\n", r); -if (!req->tariff.res_empty()) +if (!req->tariff.empty()) { switch (req->chgTariff) { @@ -564,60 +564,60 @@ if (!req->tariff.res_empty()) } -if (!req->note.res_empty()) +if (!req->note.empty()) { string note; - Encode12str(note, req->note); + Encode12str(note, req->note.data()); sprintf(str, "", note.c_str()); strcat(r, str); } -if (!req->name.res_empty()) +if (!req->name.empty()) { string name; - Encode12str(name, req->name); + Encode12str(name, req->name.data()); sprintf(str, "", name.c_str()); strcat(r, str); } -if (!req->address.res_empty()) +if (!req->address.empty()) { string address; - Encode12str(address, req->address); + Encode12str(address, req->address.data()); sprintf(str, "
", address.c_str()); strcat(r, str); } -if (!req->email.res_empty()) +if (!req->email.empty()) { string email; - Encode12str(email, req->email); + Encode12str(email, req->email.data()); sprintf(str, "", email.c_str()); strcat(r, str); } -if (!req->phone.res_empty()) +if (!req->phone.empty()) { string phone; - Encode12str(phone, req->phone); + Encode12str(phone, req->phone.data()); sprintf(str, "", phone.c_str()); strcat(r, str); } -if (!req->group.res_empty()) +if (!req->group.empty()) { string group; - Encode12str(group, req->group); + Encode12str(group, req->group.data()); sprintf(str, "", group.c_str()); strcat(r, str); } for (int i = 0; i < USERDATA_NUM; i++) { - if (!req->userData[i].res_empty()) + if (!req->userData[i].empty()) { string ud; - Encode12str(ud, req->userData[i]); + Encode12str(ud, req->userData[i].data()); sprintf(str, "", i, ud.c_str()); strcat(r, str); } @@ -633,27 +633,27 @@ bool sd = false; bool mu = false; bool md = false; bool ud = false; -bool a = !req->admLogin.res_empty() - && !req->admPasswd.res_empty() - && !req->server.res_empty() - && !req->port.res_empty() - && !req->login.res_empty(); - -bool b = !req->cash.res_empty() - || !req->setCash.res_empty() - || !req->credit.res_empty() - || !req->prepaidTraff.res_empty() - || !req->tariff.res_empty() - || !req->usrMsg.res_empty() - || !req->usrPasswd.res_empty() - - || !req->note.res_empty() - || !req->name.res_empty() - || !req->address.res_empty() - || !req->email.res_empty() - || !req->phone.res_empty() - || !req->group.res_empty() - || !req->ips.res_empty() // IP-address of user +bool a = !req->admLogin.empty() + && !req->admPasswd.empty() + && !req->server.empty() + && !req->port.empty() + && !req->login.empty(); + +bool b = !req->cash.empty() + || !req->setCash.empty() + || !req->credit.empty() + || !req->prepaidTraff.empty() + || !req->tariff.empty() + || !req->usrMsg.empty() + || !req->usrPasswd.empty() + + || !req->note.empty() + || !req->name.empty() + || !req->address.empty() + || !req->email.empty() + || !req->phone.empty() + || !req->group.empty() + || !req->ips.empty() // IP-address of user || !req->createUser || !req->deleteUser; @@ -661,7 +661,7 @@ bool b = !req->cash.res_empty() for (int i = 0; i < DIR_NUM; i++) { - if (req->sessionUpload[i].res_empty()) + if (req->sessionUpload[i].empty()) { su = true; break; @@ -670,7 +670,7 @@ for (int i = 0; i < DIR_NUM; i++) for (int i = 0; i < DIR_NUM; i++) { - if (req->sessionDownload[i].res_empty()) + if (req->sessionDownload[i].empty()) { sd = true; break; @@ -679,7 +679,7 @@ for (int i = 0; i < DIR_NUM; i++) for (int i = 0; i < DIR_NUM; i++) { - if (req->monthUpload[i].res_empty()) + if (req->monthUpload[i].empty()) { mu = true; break; @@ -688,7 +688,7 @@ for (int i = 0; i < DIR_NUM; i++) for (int i = 0; i < DIR_NUM; i++) { - if (req->monthDownload[i].res_empty()) + if (req->monthDownload[i].empty()) { md = true; break; @@ -697,7 +697,7 @@ for (int i = 0; i < DIR_NUM; i++) for (int i = 0; i < DIR_NUM; i++) { - if (req->userData[i].res_empty()) + if (req->userData[i].empty()) { ud = true; break; @@ -880,9 +880,9 @@ if (missedOptionArg || !CheckParametersGet(&req)) } if (req.authBy) - return ProcessAuthBy(req.server, req.port, req.admLogin, req.admPasswd, req.login); + return ProcessAuthBy(req.server.data(), req.port.data(), req.admLogin.data(), req.admPasswd.data(), req.login.data()); else - return ProcessGetUser(req.server, req.port, req.admLogin, req.admPasswd, req.login, req); + return ProcessGetUser(req.server.data(), req.port.data(), req.admLogin.data(), req.admPasswd.data(), req.login.data(), req); } //----------------------------------------------------------------------------- bool mainSet(int argc, char **argv) @@ -1083,9 +1083,9 @@ memset(rstr, 0, rLen); CreateRequestSet(&req, rstr); if (isMessage) - return ProcessSendMessage(req.server, req.port, req.admLogin, req.admPasswd, rstr); + return ProcessSendMessage(req.server.data(), req.port.data(), req.admLogin.data(), req.admPasswd.data(), rstr); -return ProcessSetUser(req.server, req.port, req.admLogin, req.admPasswd, rstr); +return ProcessSetUser(req.server.data(), req.port.data(), req.admLogin.data(), req.admPasswd.data(), rstr); } //----------------------------------------------------------------------------- int main(int argc, char **argv) diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser.cpp index 7deab3d0..329aaf2f 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser.cpp @@ -1015,13 +1015,13 @@ if (users->FindByName(login, &u)) bool check = false; bool alwaysOnline = u->GetProperty().alwaysOnline; -if (!ucr->alwaysOnline.res_empty()) +if (!ucr->alwaysOnline.empty()) { check = true; alwaysOnline = ucr->alwaysOnline.const_data(); } bool onlyOneIP = u->GetProperty().ips.ConstData().OnlyOneIP(); -if (!ucr->ips.res_empty()) +if (!ucr->ips.empty()) { check = true; onlyOneIP = ucr->ips.const_data().OnlyOneIP(); @@ -1048,49 +1048,49 @@ for (size_t i = 0; i < ucr->ips.const_data().Count(); ++i) } } -if (!ucr->ips.res_empty()) +if (!ucr->ips.empty()) if (!u->GetProperty().ips.Set(ucr->ips.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->alwaysOnline.res_empty()) +if (!ucr->alwaysOnline.empty()) if (!u->GetProperty().alwaysOnline.Set(ucr->alwaysOnline.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->address.res_empty()) +if (!ucr->address.empty()) if (!u->GetProperty().address.Set(ucr->address.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->creditExpire.res_empty()) +if (!ucr->creditExpire.empty()) if (!u->GetProperty().creditExpire.Set(ucr->creditExpire.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->credit.res_empty()) +if (!ucr->credit.empty()) if (!u->GetProperty().credit.Set(ucr->credit.const_data(), currAdmin, login, store)) res = -1; -if (!usr->freeMb.res_empty()) +if (!usr->freeMb.empty()) if (!u->GetProperty().freeMb.Set(usr->freeMb.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->disabled.res_empty()) +if (!ucr->disabled.empty()) if (!u->GetProperty().disabled.Set(ucr->disabled.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->disabledDetailStat.res_empty()) +if (!ucr->disabledDetailStat.empty()) if (!u->GetProperty().disabledDetailStat.Set(ucr->disabledDetailStat.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->email.res_empty()) +if (!ucr->email.empty()) if (!u->GetProperty().email.Set(ucr->email.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->group.res_empty()) +if (!ucr->group.empty()) if (!u->GetProperty().group.Set(ucr->group.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->note.res_empty()) +if (!ucr->note.empty()) if (!u->GetProperty().note.Set(ucr->note.const_data(), currAdmin, login, store)) res = -1; @@ -1108,31 +1108,31 @@ userdata.push_back(u->GetProperty().userdata9.GetPointer()); for (int i = 0; i < (int)userdata.size(); i++) { - if (!ucr->userdata[i].res_empty()) + if (!ucr->userdata[i].empty()) { if(!userdata[i]->Set(ucr->userdata[i].const_data(), currAdmin, login, store)) res = -1; } } -if (!ucr->passive.res_empty()) +if (!ucr->passive.empty()) if (!u->GetProperty().passive.Set(ucr->passive.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->password.res_empty()) +if (!ucr->password.empty()) if (!u->GetProperty().password.Set(ucr->password.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->phone.res_empty()) +if (!ucr->phone.empty()) if (!u->GetProperty().phone.Set(ucr->phone.const_data(), currAdmin, login, store)) res = -1; -if (!ucr->realName.res_empty()) +if (!ucr->realName.empty()) if (!u->GetProperty().realName.Set(ucr->realName.const_data(), currAdmin, login, store)) res = -1; -if (!usr->cash.res_empty()) +if (!usr->cash.empty()) { //if (*currAdmin->GetPriv()->userCash) { @@ -1154,7 +1154,7 @@ if (!usr->cash.res_empty()) } -if (!ucr->tariffName.res_empty()) +if (!ucr->tariffName.empty()) { if (tariffs->FindByName(ucr->tariffName.const_data())) { @@ -1169,7 +1169,7 @@ if (!ucr->tariffName.res_empty()) } } -if (!ucr->nextTariff.res_empty()) +if (!ucr->nextTariff.empty()) { if (tariffs->FindByName(ucr->nextTariff.const_data())) { @@ -1189,14 +1189,14 @@ int upCount = 0; int downCount = 0; for (int i = 0; i < DIR_NUM; i++) { - if (!upr[i].res_empty()) + if (!upr[i].empty()) { - up[i] = upr[i]; + up[i] = upr[i].data(); upCount++; } - if (!downr[i].res_empty()) + if (!downr[i].empty()) { - down[i] = downr[i]; + down[i] = downr[i].data(); downCount++; } } @@ -1209,11 +1209,11 @@ if (downCount) if (!u->GetProperty().down.Set(down, currAdmin, login, store)) res = -1; -/*if (!usr->down.res_empty()) +/*if (!usr->down.empty()) { u->GetProperty().down.Set(usr->down.const_data(), currAdmin, login, store); } -if (!usr->up.res_empty()) +if (!usr->up.empty()) { u->GetProperty().up.Set(usr->up.const_data(), currAdmin, login, store); }*/ diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_admin.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_admin.cpp index 9d87f300..b1285a77 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_admin.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_admin.cpp @@ -213,11 +213,11 @@ void PARSER_CHG_ADMIN::CreateAnswer() answerList->erase(answerList->begin(), answerList->end()); -if (!login.res_empty()) +if (!login.empty()) { ADMIN * origAdmin = NULL; - if (admins->Find(login, &origAdmin)) + if (admins->Find(login.data(), &origAdmin)) { answerList->push_back(std::string(""); return; @@ -225,10 +225,10 @@ if (!login.res_empty()) ADMIN_CONF conf(origAdmin->GetConf()); - if (!password.res_empty()) + if (!password.empty()) conf.password = password.data(); - if (!privAsString.res_empty()) + if (!privAsString.empty()) { int p = 0; if (str2x(privAsString.data().c_str(), p) < 0) diff --git a/stglibs/srvconf.lib/include/stg/servconf.h b/stglibs/srvconf.lib/include/stg/servconf.h index f709528f..e1bb9fb1 100644 --- a/stglibs/srvconf.lib/include/stg/servconf.h +++ b/stglibs/srvconf.lib/include/stg/servconf.h @@ -43,12 +43,17 @@ public: const std::string & login, const std::string & password); ~SERVCONF(); + int ServerInfo(SERVER_INFO::CALLBACK f, void * data); + + /*int GetAdmins(GET_ADMINS::CALLBACK f, void * data); + int GetAdmin(const std::string & login, GET_ADMIN::CALLBACK f, void * data); + int ChgAdmin(const std::string & request, CHG_ADMIN::CALLBACK f, void * data);*/ + int GetUsers(GET_USERS::CALLBACK f, void * data); int GetUser(const std::string & login, GET_USER::CALLBACK f, void * data); int ChgUser(const std::string & request, CHG_USER::CALLBACK f, void * data); int AuthBy(const std::string & login, AUTH_BY::CALLBACK f, void * data); int SendMessage(const std::string & request, SEND_MESSAGE::CALLBACK f, void * data); - int ServerInfo(SERVER_INFO::CALLBACK f, void * data); int CheckUser(const std::string & login, const std::string & password, CHECK_USER::CALLBACK f, void * data); const std::string & GetStrError() const; -- 2.43.2