Post merge Log.Out converts and header/linker fixes

This commit is contained in:
Akkadius
2015-02-03 00:10:49 -06:00
parent dd6d1d5511
commit 3448dd1a9e
14 changed files with 67 additions and 40 deletions
+24
View File
@@ -2051,3 +2051,27 @@ void SharedDatabase::SetBotInspectMessage(uint32 botid, const InspectMessage_Str
std::string query = StringFormat("UPDATE bots SET BotInspectMessage = '%s' WHERE BotID = %i", msg.c_str(), botid);
QueryDatabase(query);
}
bool SharedDatabase::VerifyToken(std::string token, int& status) {
status = 0;
if (token.length() > 64) {
token = token.substr(0, 64);
}
token = EscapeString(token);
std::string query = StringFormat("SELECT status FROM tokens WHERE token='%s'", token.c_str());
auto results = QueryDatabase(query);
if (!results.Success())
{
std::cerr << "Error in SharedDatabase::VerifyToken query '" << query << "' " << results.ErrorMessage() << std::endl;
return false;
}
if (results.RowCount() != 1) {
return false;
}
auto row = results.begin();
status = atoi(row[0]);
return true;
}
+1 -1
View File
@@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/global_define.h"
#include "web_interface_utils.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
+1 -1
View File
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef COMMON_WEBINTUTIL_H
#define COMMON_WEBINTUTIL_H
#include "../common/debug.h"
#include "../common/global_define.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
#include <iostream>