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. +
Name | +Campaign type | +Payment methods | +
---|---|---|
{%?campaign[name]} | ++ | + |