Merge branch 'master' of github.com:joshtronic/leaderbin.com

This commit is contained in:
Josh Sherman 2014-07-12 18:05:28 -04:00
commit 79ea04618e

View file

@ -1,14 +1,30 @@
<?php <?php
class leaderboard_edit extends leaderboard_new class leaderboard_edit extends leaderboards
{ {
public function __default() public function __default()
{ {
// Looks up the leaderboard by UID try
{
$return = parent::__default();
$leaderboards = $return['leaderboards'];
// Checks that the leaderboard is owned by this user if (!isset($_GET['uid']))
{
throw new Exception('Missing UID.');
}
// Returns the leaderboard if (!isset($leaderboards[$_GET['uid']]))
{
throw new Exception('Leaderboard does not belong to you.');
}
return array('leaderboard' => $leaderboards[$_GET['uid']]);
}
catch (Exception $e)
{
exit($e->getMessage());
}
} }
} }