AddParser(propertyParsers, "cash", info.cash);
AddParser(propertyParsers, "credit", info.credit);
AddParser(propertyParsers, "creditExpire", info.creditExpire);
- AddParser(propertyParsers, "lastCash", info.lastCash);
- AddParser(propertyParsers, "lastTimeCash", info.lastCash);
+ AddParser(propertyParsers, "lastCash", info.lastCashAdd);
+ AddParser(propertyParsers, "lastTimeCash", info.lastCashAddTime);
AddParser(propertyParsers, "freeMb", info.prepaidTraff);
AddParser(propertyParsers, "down", info.disabled);
AddParser(propertyParsers, "passive", info.passive);
if (depth == 2 && parsingAnswer)
ParseUserParams(el, attr);
+if (depth == 3 && parsingAnswer)
+ ParseAuthBy(el, attr);
+
return 0;
}
//-----------------------------------------------------------------------------
else
error = "User not found.";
}
- else
- parsingAnswer = true;
+ else if (strcasecmp(attr[0], "login") == 0 && attr[1])
+ info.login = attr[1];
}
- else
- parsingAnswer = true;
+ parsingAnswer = true;
}
}
//-----------------------------------------------------------------------------
void GET_USER::PARSER::ParseUserParams(const char * el, const char ** attr)
{
-if (!TryParse(propertyParsers, ToLower(el), attr))
+if (strcasecmp(el, "AuthorizedBy") != 0 &&
+ !TryParse(propertyParsers, ToLower(el), attr))
error = "Invalid parameter.";
}
+//-----------------------------------------------------------------------------
+void GET_USER::PARSER::ParseAuthBy(const char * el, const char ** attr)
+{
+if (strcasecmp(el, "Auth") == 0 &&
+ attr && attr[0] && attr[1] &&
+ strcasecmp(attr[0], "name") == 0)
+ info.authBy.push_back(attr[1]);
+else
+ error = "Invalid auth description.";
+}