return true;
}
- /** Check the cookie and set the associated user_id in the auth_by_cookie session variable.
+ /** Check the cookie and set the associated uid in the auth_by_cookie session variable.
*/
private function tryCookie()
{
public function tokenAuth($login, $token)
{
- $res = XDB::query('SELECT a.uid AS user_id, a.hruid
+ $res = XDB::query('SELECT a.uid, a.hruid
FROM aliases AS l
INNER JOIN accounts AS a ON (l.uid = a.uid AND a.state = \'active\')
WHERE a.token = {?} AND l.alias = {?} AND l.type != \'homonyme\'',
{
require_once 'notifs.inc.php';
$user = S::user();
- $n = Watch::getCount($user);
+ $date = null;
+ if (S::has('watch_last')) {
+ $date = S::i('watch_last');
+ }
+ $n = Watch::getCount($user, $date);
S::set('notifs', $n);
}