From b66fc3b181a4e3d441c50fee251156346721fbb0 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 6 Feb 2016 11:01:04 +0100 Subject: [PATCH] Added user logout. --- data/bcity_fe/ctpl/index_category.ctpl | 2 ++ data/bcity_fe/ctpl/index_index.ctpl | 2 ++ data/bcity_fe/ctpl/index_save.ctpl | 4 +++- src/login.c | 9 +++++++++ src/login.h | 1 + src/main.c | 1 + 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/data/bcity_fe/ctpl/index_category.ctpl b/data/bcity_fe/ctpl/index_category.ctpl index 05986e0..599e127 100644 --- a/data/bcity_fe/ctpl/index_category.ctpl +++ b/data/bcity_fe/ctpl/index_category.ctpl @@ -1,5 +1,7 @@

B-City

+
esci
+

Selezionare la categoria della segnalazione

{categorie} diff --git a/data/bcity_fe/ctpl/index_index.ctpl b/data/bcity_fe/ctpl/index_index.ctpl index 6a7fbf7..5fc6528 100644 --- a/data/bcity_fe/ctpl/index_index.ctpl +++ b/data/bcity_fe/ctpl/index_index.ctpl @@ -1,5 +1,7 @@

B-City

+
esci
+
diff --git a/data/bcity_fe/ctpl/index_save.ctpl b/data/bcity_fe/ctpl/index_save.ctpl index 0b0655b..4fbbc5b 100644 --- a/data/bcity_fe/ctpl/index_save.ctpl +++ b/data/bcity_fe/ctpl/index_save.ctpl @@ -1,7 +1,9 @@

B-City

+
esci
+

La segnalazione inserita è stata salvata correttamente e inviata all'ufficio competente

- +
\ No newline at end of file diff --git a/src/login.c b/src/login.c index f392fa8..758e335 100644 --- a/src/login.c +++ b/src/login.c @@ -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"); +} diff --git a/src/login.h b/src/login.h index ae987b7..ab680ae 100644 --- a/src/login.h +++ b/src/login.h @@ -28,6 +28,7 @@ void login_index (GMatchInfo *minfo, gpointer user_data); +void login_logout (GMatchInfo *minfo, gpointer user_data); #endif /* __INDEX_H__ */ diff --git a/src/main.c b/src/main.c index 84a16d4..cbf9888 100644 --- a/src/main.c +++ b/src/main.c @@ -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); -- 2.49.0