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()
{
{
$res = XDB::query('SELECT a.uid, a.password
FROM accounts AS a
- INNER JOIN aliases AS l ON (l.id = a.uid AND l.type != \'homonyme\')
+ INNER JOIN aliases AS l ON (l.uid = a.uid AND l.type != \'homonyme\')
WHERE l.' . $login_type . ' = {?} AND a.state = \'active\'',
$login);
if (list($uid, $password) = $res->fetchOneRow()) {
}
}
- $uid = $this->checkPassword($uname, $login, Post::v('response'), (!$redirect && is_numeric($uname)) ? 'id' : 'alias');
+ $uid = $this->checkPassword($uname, $login, Post::v('response'), (!$redirect && is_numeric($uname)) ? 'uid' : 'alias');
if (!is_null($uid) && S::suid()) {
if (S::suid('uid') == $uid) {
$uid = S::i('uid');
$res = XDB::query("SELECT a.uid, a.hruid, a.display_name, a.full_name,
a.sex = 'female' AS femme, a.email_format,
a.token, FIND_IN_SET('watch', a.flags) AS watch_account,
- UNIX_TIMESTAMP(fp.last_seen) AS banana_last, UNIX_TIMESTAMP(w.last) AS watch_last,
+ UNIX_TIMESTAMP(fp.last_seen) AS banana_last,
a.last_version, g.g_account_name IS NOT NULL AS googleapps,
UNIX_TIMESTAMP(s.start) AS lastlogin, s.host,
a.is_admin, at.perms
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.id = a.uid AND a.state = \'active\')
+ INNER JOIN accounts AS a ON (l.uid = a.uid AND a.state = \'active\')
WHERE a.token = {?} AND l.alias = {?} AND l.type != \'homonyme\'',
$token, $login);
if ($res->numRows() == 1) {