]> saetta.ns0.it Git - bcity/fe/commitdiff
Added user logout.
authorAndrea Zagli <azagli@libero.it>
Sat, 6 Feb 2016 10:01:04 +0000 (11:01 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 6 Feb 2016 10:01:04 +0000 (11:01 +0100)
data/bcity_fe/ctpl/index_category.ctpl
data/bcity_fe/ctpl/index_index.ctpl
data/bcity_fe/ctpl/index_save.ctpl
src/login.c
src/login.h
src/main.c

index 05986e0cce4675c054e30642b8c004deedc51dbd..599e1277205f87d475282b5951197063c7bdb262 100644 (file)
@@ -1,5 +1,7 @@
 <h1>B-City</h1>
 
+<div style="text-align: right;"><a href="/bcity/bcity_fe/login/logout">esci</a></div>
+
 <h2>Selezionare la categoria della segnalazione</h2>
 
 {categorie}
index 6a7fbf7f6ce6ab47a76521dc1892cd614ab6a479..5fc6528b40d7ba15f530f804721f90dddf4bdbda 100644 (file)
@@ -1,5 +1,7 @@
 <h1>B-City</h1>
 
+<div style="text-align: right;"><a href="/bcity/bcity_fe/login/logout">esci</a></div>
+
 <div id="map" style="width: 100%; height: 600px;"></div>
 
 <form action="/bcity/bcity_fe/index/category" method="post">
index 0b0655bdbf8b4af90793c7441e7f6633da705f7a..4fbbc5b0d4319da1f9bf8c826d7653f304f918b2 100644 (file)
@@ -1,7 +1,9 @@
 <h1>B-City</h1>
 
+<div style="text-align: right;"><a href="/bcity/bcity_fe/login/logout">esci</a></div>
+
 <h2>La segnalazione inserita รจ stata salvata correttamente e inviata all'ufficio competente</h2>
 
 <form action="/bcity/bcity_fe/index/index" method="post">
-       <button name="submit" id="submit" class="btn btn-lg btn-primary btn-block" type="submit">Conferma</button>
+       <button name="submit" id="submit" class="btn btn-lg btn-primary btn-block" type="submit">Nuova segnalazione</button>
 </form>
\ No newline at end of file
index f392fa8fed5bc06de9bad999a17f6414aa280190..758e3357bab5132f9dbb14191cf5ebd831c00144 100644 (file)
@@ -140,3 +140,12 @@ login_index (GMatchInfo *minfo, gpointer user_data)
 
        g_free (content);
 }
+
+void
+login_logout (GMatchInfo *minfo, gpointer user_data)
+{
+       Commons *commons = (Commons *)user_data;
+
+       zak_cgi_session_close (commons->zcgi_session);
+       zak_cgi_main_redirect (commons->zcgi_main, "/bcity/bcity_fe/index/index");
+}
index ae987b75a18525a8aa7cdb94c624813d963c1197..ab680aef4de1c8fb2c778800f6b957e383e022c7 100644 (file)
@@ -28,6 +28,7 @@
 
 
 void login_index (GMatchInfo *minfo, gpointer user_data);
+void login_logout (GMatchInfo *minfo, gpointer user_data);
 
 
 #endif /* __INDEX_H__ */
index 84a16d42aecd75e59bd3ad870842168117ef3e60..cbf9888e931ddcb4b8554445a7407b1feca326d0 100644 (file)
@@ -138,6 +138,7 @@ main (int argc, char *argv[])
 
        zak_cgi_url_connect (zcgi_url, "/login[/]?", (ZakCgiUrlConnectedFunction)login_index, commons);
        zak_cgi_url_connect (zcgi_url, "/login/index", (ZakCgiUrlConnectedFunction)login_index, commons);
+       zak_cgi_url_connect (zcgi_url, "/login/logout", (ZakCgiUrlConnectedFunction)login_logout, commons);
 
        zak_cgi_url_dispatch (zcgi_url);