From eb1449b8572cd9b2e0af7e721b65d82d85b1d988 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 15 Feb 2009 18:10:57 +0100 Subject: [PATCH] There are users without profile. Signed-off-by: Florent Bruneau --- classes/userfilter.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/classes/userfilter.php b/classes/userfilter.php index 30a7029..0b172dd 100644 --- a/classes/userfilter.php +++ b/classes/userfilter.php @@ -161,6 +161,14 @@ class UFC_Or extends UFC_NChildren } } +class UFC_Profile implements UserFilterCondition +{ + public function buildCondition(UserFilter &$uf) + { + return '$PID IS NOT NULL'; + } +} + class UFC_Promo implements UserFilterCondition { @@ -674,8 +682,8 @@ class UserFilter $where = $this->root->buildCondition($this); $joins = $this->buildJoins(); $this->query = 'FROM accounts AS a - INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET(\'owner\', ap.perms)) - INNER JOIN profiles AS p ON (p.pid = ap.pid) + LEFT JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET(\'owner\', ap.perms)) + LEFT JOIN profiles AS p ON (p.pid = ap.pid) ' . $joins . ' WHERE (' . $where . ')'; } -- 2.1.4