git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Settings code cleaned up
[stg.git]
/
projects
/
stargazer
/
plugins
/
store
/
mysql
/
mysql_store.cpp
diff --git
a/projects/stargazer/plugins/store/mysql/mysql_store.cpp
b/projects/stargazer/plugins/store/mysql/mysql_store.cpp
index fefadd5cb803b4b734303fd78b9541fb705d7a80..ac5818d584223bc9524f2699dd027084692adb2a 100644
(file)
--- a/
projects/stargazer/plugins/store/mysql/mysql_store.cpp
+++ b/
projects/stargazer/plugins/store/mysql/mysql_store.cpp
@@
-8,11
+8,11
@@
#include <mysql.h>
#include <errmsg.h>
#include <mysql.h>
#include <errmsg.h>
-#include "user_ips.h"
-#include "user_conf.h"
-#include "user_stat.h"
+#include "stg/user_ips.h"
+#include "stg/user_conf.h"
+#include "stg/user_stat.h"
+#include "stg/blowfish.h"
#include "mysql_store.h"
#include "mysql_store.h"
-#include "blowfish.h"
#define adm_enc_passwd "cjeifY8m3"
char qbuf[4096];
#define adm_enc_passwd "cjeifY8m3"
char qbuf[4096];
@@
-118,7
+118,7
@@
public:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-
BASE_
STORE * GetStore()
+STORE * GetStore()
{
return msc.GetStore();
}
{
return msc.GetStore();
}
@@
-711,6
+711,13
@@
if (!(res=mysql_store_result(sock)))
return -1;
}
return -1;
}
+if (mysql_num_rows(res) != 1)
+{
+ errorStr = "User not found";
+ mysql_close(sock);
+ return -1;
+}
+
row = mysql_fetch_row(res);
string param;
row = mysql_fetch_row(res);
string param;
@@
-797,7
+804,7
@@
try
{
i = StrToIPS(ipStr);
}
{
i = StrToIPS(ipStr);
}
-catch (
string
s)
+catch (
const string &
s)
{
mysql_free_result(res);
errorStr = "User \'" + login + "\' data not read. Parameter IP address. " + s;
{
mysql_free_result(res);
errorStr = "User \'" + login + "\' data not read. Parameter IP address. " + s;