From 1d250c6cacd99b91833e671e440f4aa4932de8bc Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 25 Feb 2013 09:51:50 +0100 Subject: [PATCH] Add 'already logged in' notice on the frontpage when the user is logged in already --- public_html/includes/base.php | 1 + public_html/modules/index.php | 5 +++++ public_html/templates/dashboard.tpl | 4 +--- public_html/templates/index.tpl | 9 +++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/public_html/includes/base.php b/public_html/includes/base.php index a515fff..9354163 100644 --- a/public_html/includes/base.php +++ b/public_html/includes/base.php @@ -39,6 +39,7 @@ NewTemplater::SetGlobalVariable("logged-in", !empty($_SESSION['user_id'])); if(!empty($_SESSION['user_id'])) { + /* TODO: Handle being logged in to a non-existent user */ $sCurrentUser = new User($_SESSION['user_id']); $sCurrentUser->SetGlobalVariables(); diff --git a/public_html/modules/index.php b/public_html/modules/index.php index 793520d..c06a6e9 100644 --- a/public_html/modules/index.php +++ b/public_html/modules/index.php @@ -13,4 +13,9 @@ if(!isset($_APP)) { die("Unauthorized."); } +if(!empty($_SESSION['user_id'])) +{ + flash_notice('Hi! It seems you are already logged in. Did you want to go to your Dashboard?'); +} + $sPageContents = NewTemplater::Render("index", $locale->strings, array()); diff --git a/public_html/templates/dashboard.tpl b/public_html/templates/dashboard.tpl index c30688f..6b3310f 100644 --- a/public_html/templates/dashboard.tpl +++ b/public_html/templates/dashboard.tpl @@ -55,8 +55,6 @@ {%?total-rate}% {%?total-total} {%?total-projection} - - - + diff --git a/public_html/templates/index.tpl b/public_html/templates/index.tpl index 46241a7..fdc7652 100644 --- a/public_html/templates/index.tpl +++ b/public_html/templates/index.tpl @@ -1,10 +1,19 @@

ReDonate is recurring contributions, done right.

+
+ {%if isempty|notices == false} + {%foreach notice in notices} +
+ {%?notice} +
+ {%/foreach} + {%/if} +

Why use ReDonate?