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) |
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 |
{ |
{ |
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"> |
81 |
</table> |
</table> |
82 |
</form> |
</form> |
83 |
|
|
|
<{ |
|
|
} // end if (showForm) |
|
|
}> |
|
84 |
|
|
85 |
<&footer> |
<&footer> |
86 |
</&footer> |
</&footer> |