/[H9]/trunk/tntnet/dynamic/login.ecpp
ViewVC logotype

Diff of /trunk/tntnet/dynamic/login.ecpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 94 by torben, Thu Nov 29 08:04:13 2007 UTC revision 195 by torben, Sat Dec 8 16:47:03 2007 UTC
# Line 31  function encryptText() { Line 31  function encryptText() {
31  </script>  </script>
32    
33  <{  <{
34  tntdb::Connection conn = tntdb::connect(dburl);  tntdb::Connection conn = tntdb::connectCached(dburl);
35    
36    
37  std::string post_username = qparam.param("username");  std::string post_username = qparam.param("username");
# Line 41  std::string post_password = qparam.param Line 41  std::string post_password = qparam.param
41  if (post_username.size() > 0 || post_password.size() > 0)  if (post_username.size() > 0 || post_password.size() > 0)
42  {  {
43    
44          std::stringstream sql;          std::string sql;
45          sql << "SELECT realname,useradmin FROM users WHERE username = '" << post_username << "' AND ";          sql += "SELECT realname,useradmin FROM users WHERE username = :username AND ";
46          sql << "password = '" << post_password << "' AND enabled=true";          sql += "password = :password AND enabled=true";
47    
48            tntdb::Statement st = conn.prepare(sql);
49            st.setString("username", post_username).setString("password", post_password);
50    
51            tntdb::Result res = st.select();
52    
         tntdb::Result res = conn.select(sql.str());  
53          if (res.size() >0)          if (res.size() >0)
54          {          {
55                  tntdb::Row row = res[0];                  tntdb::Row row = res[0];

Legend:
Removed from v.94  
changed lines
  Added in v.195

  ViewVC Help
Powered by ViewVC 1.1.20