/[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 93 by torben, Wed Nov 28 14:27:51 2007 UTC revision 94 by torben, Thu Nov 29 08:04:13 2007 UTC
# Line 31  function encryptText() { Line 31  function encryptText() {
31  </script>  </script>
32    
33  <{  <{
34  tntdb::Connection conn;  tntdb::Connection conn = tntdb::connect(dburl);
   
 conn = tntdb::connect(dburl); //letting exceptions flow up and to tntnet and let it display an error message  
35    
36    
37  std::string post_username = qparam.param("username");  std::string post_username = qparam.param("username");
38  std::string post_password = qparam.param("password");  std::string post_password = qparam.param("password");
 bool showForm = true;  
39    
40    
41  if (post_username.size() > 0 || post_password.size() > 0)  if (post_username.size() > 0 || post_password.size() > 0)
# Line 54  if (post_username.size() > 0 || post_pas Line 51  if (post_username.size() > 0 || post_pas
51                  tntdb::Row row = res[0];                  tntdb::Row row = res[0];
52                  userName = post_username;                  userName = post_username;
53                  isAdmin = row.getBool(1);                  isAdmin = row.getBool(1);
54                  reply.setHeader("Refresh", "0; url=/dynamic/index");  
55                    reply.setHeader("Location", "index");
56                    return HTTP_MOVED_TEMPORARILY; //code 302
57          }          }
58          else          else
59          {          {
# Line 65  if (post_username.size() > 0 || post_pas Line 64  if (post_username.size() > 0 || post_pas
64    
65    
66    
 <{  
 if (showForm) {  
 }>  
67    
68  <form method="post" action="login" name="loginform" onsubmit="encryptText()">  <form method="post" action="login" name="loginform" onsubmit="encryptText()">
69  <table border="0">  <table border="0">
# Line 85  if (showForm) { Line 81  if (showForm) {
81  </table>  </table>
82  </form>  </form>
83    
 <{  
 } // end if (showForm)  
 }>  
84    
85  <&footer>  <&footer>
86  </&footer>  </&footer>

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

  ViewVC Help
Powered by ViewVC 1.1.20