--- trunk/tntnet/dynamic/adm_customer_list.ecpp 2007/11/28 17:03:27 83
+++ trunk/tntnet/dynamic/adm_customer_list.ecpp 2007/12/02 20:26:43 126
@@ -13,20 +13,23 @@
std::string userName;
%session>
+<{
+if (userName.size() == 0)
+{
+ reply.setHeader("Location", "index");
+ return HTTP_MOVED_TEMPORARILY;
+}
+}>
+
<&header title="Customer administration">
&header>
Customers administration
Create new customer
-<{
-
-if (userName.size() == 0)
- reply.setHeader("Refresh", "0; url=login");
-tntdb::Connection conn;
-
-conn = tntdb::connect(dburl); //letting exceptions flow up and to tntnet and let it display an error message
+<{
+tntdb::Connection conn = tntdb::connect(dburl);
std::string query = "SELECT id, name FROM customer ORDER BY name ASC";
@@ -35,17 +38,18 @@
std::ostream& out = reply.out();
if (res.size() > 0)
{
- out << "";
+ out << "";
}
else
{