From 9768f3ab067bd56dc83a14b3955f5d371707106e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCckner?= Date: Fri, 4 May 2007 19:51:30 +0000 Subject: - added login protection to various pages that i did forget --- pages/channels_widget.ecpp | 6 ++++++ pages/error.ecpp | 9 +++++++++ pages/event_widget.ecpp | 6 ++++++ pages/ibox.ecpp | 6 +++++- pages/keypress.ecpp | 7 +++++++ pages/menu.ecpp | 9 +++++++++ pages/play_recording.ecpp | 5 +++++ pages/screenshot.ecpp | 6 ++++++ 8 files changed, 53 insertions(+), 1 deletion(-) diff --git a/pages/channels_widget.ecpp b/pages/channels_widget.ecpp index df9219f..ed6d30e 100644 --- a/pages/channels_widget.ecpp +++ b/pages/channels_widget.ecpp @@ -13,6 +13,12 @@ using namespace vdrlive; onchange; bool channelid = false; +<%session scope="global"> +bool logged_in(false); + +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <%cpp> ReadLock channelsLock( Channels ); if ( !channelsLock ) diff --git a/pages/error.ecpp b/pages/error.ecpp index e7bc8c5..bb82887 100644 --- a/pages/error.ecpp +++ b/pages/error.ecpp @@ -1,5 +1,8 @@ <%pre> #include +#include "setup.h" + +using namespace vdrlive; <%args> @@ -7,6 +10,12 @@ errorTitle = tr("Page error"); errorMessage; +<%session scope="global"> +bool logged_in(false); + +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <& pageelems.doc_type &> diff --git a/pages/event_widget.ecpp b/pages/event_widget.ecpp index 2dd847e..b4a80cb 100644 --- a/pages/event_widget.ecpp +++ b/pages/event_widget.ecpp @@ -17,6 +17,12 @@ channel_name; start; end; +<%session scope="global"> +bool logged_in(false); + +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> diff --git a/pages/ibox.ecpp b/pages/ibox.ecpp index 7ca6069..e2b2fb8 100644 --- a/pages/ibox.ecpp +++ b/pages/ibox.ecpp @@ -7,6 +7,7 @@ #include #include "exception.h" +#include "setup.h" #include "tools.h" #include "epg_events.h" @@ -17,12 +18,15 @@ using namespace std; <%args> int update; +<%session scope="global"> +bool logged_in(false); + <%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); EpgEvents epgEvents; string EMPTY_STR; tChannelID prev_chan; tChannelID next_chan; - reply.setContentType( "application/xml" ); if (cReplayControl::NowReplaying()) { diff --git a/pages/keypress.ecpp b/pages/keypress.ecpp index a1f36fa..efcb1a3 100644 --- a/pages/keypress.ecpp +++ b/pages/keypress.ecpp @@ -1,11 +1,18 @@ <%pre> #include +#include "setup.h" + +using namespace vdrlive; <%args> int keycode = kNone; +<%session scope="global"> +bool logged_in(false); + <%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); reply.setContentType("application/xml"); diff --git a/pages/menu.ecpp b/pages/menu.ecpp index fb6b2f9..5acbc13 100644 --- a/pages/menu.ecpp +++ b/pages/menu.ecpp @@ -2,15 +2,24 @@ #include #include #include "setup.h" + +using namespace vdrlive; + <%args> active; component; +<%session scope="global"> +bool logged_in(false); + <%request scope="page"> std::string set_active; std::string set_component; +<{ +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +}> <{ using namespace vdrlive; diff --git a/pages/play_recording.ecpp b/pages/play_recording.ecpp index d314ace..3d95352 100644 --- a/pages/play_recording.ecpp +++ b/pages/play_recording.ecpp @@ -2,6 +2,7 @@ #include #include #include "exception.h" +#include "setup.h" #include "tasks.h" #include "tools.h" @@ -12,7 +13,11 @@ using namespace vdrlive; <%args> string param; +<%session scope="global"> +bool logged_in(false); + <%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); reply.setContentType( "application/xml" ); ReplayRecordingTask task( param ); diff --git a/pages/screenshot.ecpp b/pages/screenshot.ecpp index b8d8617..0fc1a3c 100644 --- a/pages/screenshot.ecpp +++ b/pages/screenshot.ecpp @@ -1,4 +1,6 @@ <%pre> +#include +#include "setup.h" #include "grab.h" using namespace vdrlive; @@ -9,7 +11,11 @@ int quality = 80; int width = 320; int height = 240; +<%session scope="global"> +bool logged_in(false); + <%cpp> +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); reply.setContentType("image/jpg"); GrabImageInfo image = LiveGrabImageManager().GetImage(); -- cgit v1.2.3
<$ channel_name $>