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

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

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

revision 90 by torben, Wed Nov 28 23:19:28 2007 UTC revision 126 by torben, Sun Dec 2 20:26:43 2007 UTC
# Line 12  dburl; Line 12  dburl;
12    
13  <%session scope="global">  <%session scope="global">
14  std::string userName;  std::string userName;
 bool isAdmin;  
15  </%session>  </%session>
16    
17    
# Line 23  int id; Line 22  int id;
22  <{  <{
23    
24  if (userName.size() == 0)  if (userName.size() == 0)
     reply.setHeader("Refresh", "0; url=login");  
 else  
25  {  {
26          tntdb::Connection conn = tntdb::connect(dburl);          reply.setHeader("Location", "index");
27            return HTTP_MOVED_TEMPORARILY;
28    }
29            
30    tntdb::Connection conn = tntdb::connect(dburl);
31    
32          std::stringstream query;  std::stringstream query;
33          query << "DELETE FROM customer WHERE id = " << id;  query << "DELETE FROM customer WHERE id = " << id;
34          conn.execute(query.str());  
35    conn.execute(query.str());
36    reply.setHeader("Location", "adm_customer_list");
37    return HTTP_MOVED_TEMPORARILY;
38    
         reply.setHeader("Refresh", "0; url=adm_customer_list");  
 }  
39    
40  }>  }>
41    

Legend:
Removed from v.90  
changed lines
  Added in v.126

  ViewVC Help
Powered by ViewVC 1.1.20