Merge branch 'master' of github.com:joshtronic/leaderbin.com
This commit is contained in:
commit
79ea04618e
1 changed files with 20 additions and 4 deletions
|
@ -1,14 +1,30 @@
|
|||
<?php
|
||||
|
||||
class leaderboard_edit extends leaderboard_new
|
||||
class leaderboard_edit extends leaderboards
|
||||
{
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue