Musta been working on something O_o

This commit is contained in:
Josh Sherman 2014-06-30 08:29:14 -04:00
parent fa5ef9d858
commit ff77cedbdf
2 changed files with 21 additions and 5 deletions

View file

@ -27,7 +27,7 @@ class api_v1_leaderboard extends APIv1
if ($this->uid != $leaderboard['uid'])
{
throw new Exception('Leaderboard UID does not belong to you.');
throw new Exception('Leaderboard does not belong to you.');
}
// Sets up our key suffixes

View file

@ -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());
}
}
}