JSON reading fixed. I don't know why this wasn't noticed before. :-)

This commit is contained in:
Thulinma 2012-05-01 14:28:31 +02:00
parent 45ecfdfe6b
commit 89186a05cc
3 changed files with 20 additions and 20 deletions

View file

@ -109,16 +109,7 @@ void Authorize( JSON::Value & Request, JSON::Value & Response, ConnectedUser & c
if( Request.isMember( "authorize" ) ) {
std::string UserID = Request["authorize"]["username"];
if (Storage["account"].isMember(UserID)){
if( md5( (std::string)Storage["account"][UserID]["password"] + Challenge ) == (std::string)Request["authorize"]["password"] ) {
Response["authorize"]["status"] = "OK";
conn.Username = UserID;
conn.Authorized = true;
return;
}
}
if (Storage["authorize"].isMember("key")){
UserID = "gearbox";
if (keychecker.PubKey_Check(Challenge, Storage["authorize"]["key"])){
if( md5( (std::string)(Storage["account"][UserID]["password"]) + Challenge ) == (std::string)Request["authorize"]["password"] ) {
Response["authorize"]["status"] = "OK";
conn.Username = UserID;
conn.Authorized = true;