From bf9a4675357a6b1704cb31ce085a0cb51c08b556 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 22 Feb 2013 22:53:43 +0100 Subject: [PATCH] Dashboard list --- public_html/authenticators/user.php | 19 +++++++++++++++++++ public_html/modules/dashboard.php | 20 +++++++++++++++++++- public_html/modules/error/guest.php | 16 ++++++++++++++++ public_html/modules/login.php | 1 + public_html/rewrite.php | 8 ++++++-- public_html/templates/dashboard.tpl | 15 ++++++++++++++- 6 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 public_html/authenticators/user.php create mode 100644 public_html/modules/error/guest.php diff --git a/public_html/authenticators/user.php b/public_html/authenticators/user.php new file mode 100644 index 0000000..6ae8198 --- /dev/null +++ b/public_html/authenticators/user.php @@ -0,0 +1,19 @@ + $sCurrentUser->sId)) as $sCampaign) + { + $sCampaigns[] = array( + "name" => $sCampaign->sName + ); + } +} +catch (NotFoundException $e) +{ + /* pass */ +} + $sPageTitle = "Dashboard"; -$sPageContents = NewTemplater::Render("dashboard", $locale->strings, array()); +$sPageContents = NewTemplater::Render("dashboard", $locale->strings, array( + "campaigns" => $sCampaigns +)); diff --git a/public_html/modules/error/guest.php b/public_html/modules/error/guest.php new file mode 100644 index 0000000..fc266e3 --- /dev/null +++ b/public_html/modules/error/guest.php @@ -0,0 +1,16 @@ +VerifyPassword($_POST['password'])) { $sUser->Authenticate(); + flash_notice("Welcome back, {$sUser->sDisplayName}!"); redirect("/dashboard"); } else diff --git a/public_html/rewrite.php b/public_html/rewrite.php index 343df92..8bab55d 100644 --- a/public_html/rewrite.php +++ b/public_html/rewrite.php @@ -31,8 +31,12 @@ $router->routes = array( "^/sign-up$" => "modules/signup.php", "^/login$" => "modules/login.php", "^/logout/([a-zA-Z0-9]+)$" => "modules/logout.php", - "^/confirm/(.+)/([a-zA-Z0-9]+)$" => "modules/confirm.php", - "^/dashboard$" => "modules/dashboard.php", + "^/confirm/(.+)/([a-zA-Z0-9]+)$" => "modules/confirm.php", + "^/dashboard$" => array( + 'target' => "modules/dashboard.php", + 'authenticator' => "authenticators/user.php", + 'auth_error' => "modules/error/guest.php" + ), "^/campaign/([a-zA-Z0-9-]+)$" => "modules/landing.php", "^/campaign/([a-zA-Z0-9-]+)/subscribe$" => "modules/subscribe.php" ) diff --git a/public_html/templates/dashboard.tpl b/public_html/templates/dashboard.tpl index b8f7cfa..25506ee 100644 --- a/public_html/templates/dashboard.tpl +++ b/public_html/templates/dashboard.tpl @@ -6,4 +6,17 @@ {%/foreach} {%/if} -Lorem ipsum indeed. + + + + + + + {%foreach campaign in campaigns} + + + + + + {%/foreach} +
NameCampaign typePayment methods
{%?campaign[name]}