From d6e81adf9841989ca33f331637563cc8de8906e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCckner?= Date: Thu, 26 Apr 2007 18:13:40 +0000 Subject: - added login protection to the following pages: edit_searchtimer.ecpp edit_timer.ecpp login.ecpp recordings.ecpp remote.ecpp schedule.ecpp searchresults.ecpp searchtimers.ecpp timers.ecpp whats_on.ecpp - replaced DOCTYPE at login.ecpp and whats_on.ecpp with page element "<& pageelems.doc_type &>" --- pages/edit_searchtimer.ecpp | 7 +++++++ pages/edit_timer.ecpp | 7 +++++++ pages/login.ecpp | 2 +- pages/recordings.ecpp | 7 +++++++ pages/remote.ecpp | 6 ++++++ pages/schedule.ecpp | 6 ++++++ pages/searchresults.ecpp | 7 +++++++ pages/searchtimers.ecpp | 7 +++++++ pages/timers.ecpp | 7 +++++++ pages/whats_on.ecpp | 2 +- 10 files changed, 56 insertions(+), 2 deletions(-) diff --git a/pages/edit_searchtimer.ecpp b/pages/edit_searchtimer.ecpp index 84a4fde..1085be5 100644 --- a/pages/edit_searchtimer.ecpp +++ b/pages/edit_searchtimer.ecpp @@ -8,6 +8,7 @@ #include "exception.h" #include "tools.h" #include "epgsearch.h" +#include "setup.h" using namespace std; using namespace vdrlive; @@ -73,6 +74,9 @@ using namespace vdrlive; bool usevps = false; string blacklistids_internal; +<%session scope="global"> +bool logged_in(false); + <%request scope="page"> SearchTimer* searchtimer; ExtEPGInfos extEPGInfos; @@ -81,6 +85,9 @@ Blacklists blacklists; <%include>page_init.eh +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> #define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp index 9d6fd9f..734a531 100644 --- a/pages/edit_timer.ecpp +++ b/pages/edit_timer.ecpp @@ -7,6 +7,7 @@ #include "exception.h" #include "tools.h" #include "timers.h" +#include "setup.h" using namespace std; using namespace vdrlive; @@ -38,10 +39,16 @@ using namespace vdrlive; int lifetime = 0; string aux = ""; +<%session scope="global"> +bool logged_in(false); + <%request scope="page"> cTimer* timer; <%include>page_init.eh +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> cMutexLock timersLock( &LiveTimerManager() ); SortedTimers& timers = LiveTimerManager().GetTimers(); diff --git a/pages/login.ecpp b/pages/login.ecpp index 90c1bff..afa7a15 100644 --- a/pages/login.ecpp +++ b/pages/login.ecpp @@ -31,7 +31,7 @@ if (action == "login") { if (logged_in || !LiveSetup().UseAuth()) return reply.redirect("whats_on.html"); }> - +<& pageelems.doc_type &> VDR-Live - Login diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index 96562f7..d9c620d 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -7,6 +7,7 @@ #include "epg_events.h" #include "recordings.h" +#include "setup.h" using namespace vdrlive; using namespace std; @@ -14,11 +15,17 @@ using namespace std; <%args> +<%session scope="global"> +bool logged_in(false); + <%request scope="page"> RecordingsTree recordingsTree(LiveRecordingsManager()); EpgEvents epgEvents; <%include>page_init.eh +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> pageTitle = tr("Recordings"); diff --git a/pages/remote.ecpp b/pages/remote.ecpp index 2a5fcbe..9b405a6 100644 --- a/pages/remote.ecpp +++ b/pages/remote.ecpp @@ -5,7 +5,13 @@ using namespace vdrlive; +<%session scope="global"> +bool logged_in(false); + <%include>page_init.eh +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> pageTitle = tr("Remote Control"); diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index 2ee7ed0..db775d3 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -14,10 +14,16 @@ using namespace vdrlive; <%args> int channel = -1; +<%session scope="global"> +bool logged_in(false); + <%request scope="page"> cChannel* Channel; <%include>page_init.eh +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> pageTitle = tr("Schedule"); diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp index 15ce030..37de16a 100644 --- a/pages/searchresults.ecpp +++ b/pages/searchresults.ecpp @@ -4,6 +4,7 @@ #include #include "epgsearch.h" #include "tools.h" +#include "setup.h" using namespace vdrlive; using namespace std; @@ -13,7 +14,13 @@ using namespace std; // input parameters int searchtimerid; +<%session scope="global"> +bool logged_in(false); + <%include>page_init.eh +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> pageTitle = tr("Search results"); diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp index 82cace5..c81f30f 100644 --- a/pages/searchtimers.ecpp +++ b/pages/searchtimers.ecpp @@ -3,6 +3,7 @@ #include #include "epgsearch.h" #include "tools.h" +#include "setup.h" using namespace vdrlive; using namespace std; @@ -13,7 +14,13 @@ using namespace std; string searchtimerid; string action; +<%session scope="global"> +bool logged_in(false); + <%include>page_init.eh +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> pageTitle = tr("Searchtimers"); SearchTimers timers; diff --git a/pages/timers.ecpp b/pages/timers.ecpp index 415b8df..021778f 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -2,6 +2,7 @@ #include #include "timers.h" #include "tools.h" +#include "setup.h" using namespace std; using namespace vdrlive; @@ -12,10 +13,16 @@ using namespace vdrlive; string timerid; string action; +<%session scope="global"> +bool logged_in(false); + <%request scope="page"> cTimer* timer; <%include>page_init.eh +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> pageTitle = tr("Timers"); diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index daf09d4..68ad112 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -35,7 +35,7 @@ if (type == "now") { } }> - +<& pageelems.doc_type &> VDR-Live - <$ head $> -- cgit v1.2.3