mail[Wesnoth-commits] r28629 - /trunk/src/server/forum_auth.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by thomas . baumhauer on August 16, 2008 - 12:34:
Author: baufo
Date: Sat Aug 16 12:34:50 2008
New Revision: 28629

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28629&view=rev
Log:
small fixes in forum_auth

Modified:
    trunk/src/server/forum_auth.cpp

Modified: trunk/src/server/forum_auth.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/forum_auth.cpp?rev=28629&r1=28628&r2=28629&view=diff
==============================================================================
--- trunk/src/server/forum_auth.cpp (original)
+++ trunk/src/server/forum_auth.cpp Sat Aug 16 12:34:50 2008
@@ -1,8 +1,8 @@
 #include <string>
 #include <iostream>
-#include "md5.hpp"
+#include "forum_auth/md5.hpp"
 #include <string.h>
-#include <mysql++.h>
+#include <mysql++/mysql++.h>
 
 namespace forum_auth {
 
@@ -60,9 +60,9 @@
        db_access_file >> db_password;
 // Connect to the database
        mysqlpp::Connection db_interface(false);
-       if (!db_interface.connect(db_name, db_host, db_user, db_password))
+       if (!db_interface.connect(db_name.c_str(), db_host.c_str(), 
db_user.c_str(), db_password.c_str()))
        {
-               std::string error("Forum auth : Connection to the databese 
failed\n");
+               std::string error("Forum auth : Connection to the database 
failed\n");
                throw error;
        }
 // Retrive users' password as hash
@@ -70,7 +70,8 @@
        sql.append(user_name);
        sql.append("'");
        mysqlpp::Query query = db_interface.query(sql);
-       if(!(mysqlpp::StoreQueryReult sql_res = query.store()))
+       mysqlpp::StoreQueryResult sql_res = query.store();
+       if(sql_res.num_rows() == 0)
        {
                std::string error("Forum auth : User not found");
                throw error;




Related Messages


Powered by MHonArc, Updated Sat Aug 16 13:20:42 2008