Musta been working on something O_o
This commit is contained in:
parent
fa5ef9d858
commit
ff77cedbdf
2 changed files with 21 additions and 5 deletions
|
@ -27,7 +27,7 @@ class api_v1_leaderboard extends APIv1
|
||||||
|
|
||||||
if ($this->uid != $leaderboard['uid'])
|
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
|
// Sets up our key suffixes
|
||||||
|
|
|
@ -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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue