Dashboard list

master
Sven Slootweg 12 years ago
parent 307ef00bc7
commit bf9a467535

@ -0,0 +1,19 @@
<?php
/*
* ReDonate is more free software. It is licensed under the WTFPL, which
* allows you to do pretty much anything with it, without having to
* ask permission. Commercial use is allowed, and no attribution is
* required. We do politely request that you share your modifications
* to benefit other developers, but you are under no enforced
* obligation to do so :)
*
* Please read the accompanying LICENSE document for the full WTFPL
* licensing text.
*/
if(!isset($_APP)) { die("Unauthorized."); }
if(!empty($_SESSION['user_id']))
{
$sRouterAuthenticated = true;
}

@ -13,5 +13,23 @@
if(!isset($_APP)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$sCampaigns = array();
try
{
foreach(Campaign::CreateFromQuery("SELECT * FROM campaigns WHERE `OwnerId` = :UserId", array(":UserId" => $sCurrentUser->sId)) as $sCampaign)
{
$sCampaigns[] = array(
"name" => $sCampaign->sName
);
}
}
catch (NotFoundException $e)
{
/* pass */
}
$sPageTitle = "Dashboard"; $sPageTitle = "Dashboard";
$sPageContents = NewTemplater::Render("dashboard", $locale->strings, array()); $sPageContents = NewTemplater::Render("dashboard", $locale->strings, array(
"campaigns" => $sCampaigns
));

@ -0,0 +1,16 @@
<?php
/*
* ReDonate is more free software. It is licensed under the WTFPL, which
* allows you to do pretty much anything with it, without having to
* ask permission. Commercial use is allowed, and no attribution is
* required. We do politely request that you share your modifications
* to benefit other developers, but you are under no enforced
* obligation to do so :)
*
* Please read the accompanying LICENSE document for the full WTFPL
* licensing text.
*/
if(!isset($_APP)) { die("Unauthorized."); }
redirect("/login");

@ -32,6 +32,7 @@ if(!empty($_POST['submit']))
if($sUser->VerifyPassword($_POST['password'])) if($sUser->VerifyPassword($_POST['password']))
{ {
$sUser->Authenticate(); $sUser->Authenticate();
flash_notice("Welcome back, {$sUser->sDisplayName}!");
redirect("/dashboard"); redirect("/dashboard");
} }
else else

@ -32,7 +32,11 @@ $router->routes = array(
"^/login$" => "modules/login.php", "^/login$" => "modules/login.php",
"^/logout/([a-zA-Z0-9]+)$" => "modules/logout.php", "^/logout/([a-zA-Z0-9]+)$" => "modules/logout.php",
"^/confirm/(.+)/([a-zA-Z0-9]+)$" => "modules/confirm.php", "^/confirm/(.+)/([a-zA-Z0-9]+)$" => "modules/confirm.php",
"^/dashboard$" => "modules/dashboard.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-]+)$" => "modules/landing.php",
"^/campaign/([a-zA-Z0-9-]+)/subscribe$" => "modules/subscribe.php" "^/campaign/([a-zA-Z0-9-]+)/subscribe$" => "modules/subscribe.php"
) )

@ -6,4 +6,17 @@
{%/foreach} {%/foreach}
{%/if} {%/if}
Lorem ipsum indeed. <table>
<tr>
<th>Name</th>
<th>Campaign type</th>
<th>Payment methods</th>
</tr>
{%foreach campaign in campaigns}
<tr>
<td>{%?campaign[name]}</td>
<td></td>
<td></td>
</tr>
{%/foreach}
</table>

Loading…
Cancel
Save