Fixes the SUID session start for disabled users.
authorVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 16 May 2009 21:30:17 +0000 (23:30 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 16 May 2009 21:30:17 +0000 (23:30 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
classes/xorgsession.php

index c9ac0b7..cf2413f 100644 (file)
@@ -214,6 +214,10 @@ class XorgSession extends PlSession
                          LEFT JOIN  logger.last_sessions AS ls ON (ls.uid = u.user_id)
                          LEFT JOIN  logger.sessions AS s  ON(s.id = ls.id)
                              WHERE  u.user_id = {?} AND u.perms IN('admin', 'user')", $uid);
+        if ($res->numRows() != 1) {
+            return false;
+        }
+
         $sess = $res->fetchOneAssoc();
         $perms = $sess['perms'];
         unset($sess['perms']);