leaderbin/models/User.php
Josh Sherman 29987e8640 Finished user creation step
Added new modules to handle routing if the user is logged in or not. Closes #2
2013-12-16 17:19:44 -05:00

21 lines
351 B
PHP

<?php
class User extends RedisModel
{
protected $prefix = 'user';
public static function isAuthenticated()
{
if (isset($_COOKIE['__auth']))
{
list($uid, $auth_token) = explode('|', base64_decode($_COOKIE['__auth']));
$user = new self();
$user_token = $user->getAuth($uid);
return $user_token === $auth_token;
}
}
}
?>