Got that first API call done

Had to work out the API parent class a bit. Also closing #8 as the API docs are about done. Time to knock out the rest of the API calls so I can start using this shit.
This commit is contained in:
Josh Sherman 2013-12-18 16:38:21 -05:00
parent 7b18541a61
commit 1006cbd436
5 changed files with 100 additions and 21 deletions

View file

@ -11,14 +11,17 @@ class CustomModule extends Module
$this->redis = new CustomRedis();
if (isset($_COOKIE['__auth']))
if (substr(get_class($this), 0, 3) != 'api')
{
list($uid, $auth_token) = explode('|', base64_decode($_COOKIE['__auth']));
if ($this->redis->hget('user:' . $uid, 'auth') === $auth_token)
if (isset($_COOKIE['__auth']))
{
$this->uid = $uid;
$this->return['uid'] = $uid;
list($uid, $auth_token) = explode('|', base64_decode($_COOKIE['__auth']));
if ($this->redis->hget('user:' . $uid, 'auth') === $auth_token)
{
$this->uid = $uid;
$this->return['uid'] = $uid;
}
}
}
}