#include "stg/user_conf.h"
#include "stg/user_stat.h"
#include "stg/blowfish.h"
+#include "stg/plugin_creator.h"
#include "mysql_store.h"
#define adm_enc_passwd "cjeifY8m3"
return 0;
}
-class MYSQL_STORE_CREATOR
-{
-private:
- MYSQL_STORE * ms;
-
-public:
- MYSQL_STORE_CREATOR()
- : ms(new MYSQL_STORE())
- {
- };
- ~MYSQL_STORE_CREATOR()
- {
- delete ms;
- };
-
- MYSQL_STORE * GetStore()
- {
- return ms;
- };
-} msc;
+PLUGIN_CREATOR<MYSQL_STORE> msc;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
STORE * GetStore()
{
-return msc.GetStore();
+return msc.GetPlugin();
}
//-----------------------------------------------------------------------------
MYSQL_STORE_SETTINGS::MYSQL_STORE_SETTINGS()
char passwordE[2*ADM_PASSWD_LEN + 2];
BLOWFISH_CTX ctx;
+memset(pass, 0, sizeof(pass));
+memset(password, 0, sizeof(password));
+memset(passwordE, 0, sizeof(passwordE));
+
string p;
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL_ROW row;
MYSQL * sock;
-sprintf(qbuf,"SELECT * FROM messages WHERE login='%s' AND id=%lld LIMIT 1",
- login.c_str(), id);
+sprintf(qbuf,"SELECT * FROM messages WHERE login='%s' AND id=%llu LIMIT 1",
+ login.c_str(), static_cast<unsigned long long>(id));
if(MysqlGetQuery(qbuf,sock))
{