X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fuserfilter.php;h=058def4f5580fc3e3a277d410c84fb6d60f7fcd5;hb=28c20b86be8b40cecba0d83080879f81c49e07ad;hp=18bdadd4c3949fcf06ade9f5583c83bb81e42ce1;hpb=488765e38cf20b81b5e6056f30d5ec2ddf0a032c;p=platal.git diff --git a/classes/userfilter.php b/classes/userfilter.php index 18bdadd..058def4 100644 --- a/classes/userfilter.php +++ b/classes/userfilter.php @@ -156,7 +156,8 @@ class UFC_Promo implements UserFilterCondition UserFilter::assertGrade($this->grade); } if ($this->grade == UserFilter::DISPLAY && $this->comparison != '=') { - Platal::page()->killError('Comparison ' . $this->comparison . ' not allowed on displaid promo'); + // XXX: we might try to guess the grade from the first char of the promo and forbid only '<= 2004', but allow '<= X2004' + Platal::page()->killError("Il n'est pas possible d'appliquer la comparaison '" . $this->comparison . "' aux promotions sans spécifier de formation (X/M/D)"); } } @@ -1048,7 +1049,7 @@ class UFC_Networking implements UserFilterCondition $conds = array(); $conds[] = $sub . '.address ' . XDB::formatWildcards(XDB::WILDCARD_CONTAINS, $this->value); if ($this->type != -1) { - $conds[] = $sub . '.network_type = ' . XDB::format('{?}', $this->type); + $conds[] = $sub . '.nwid = ' . XDB::format('{?}', $this->type); } return implode(' AND ', $conds); } @@ -1674,7 +1675,7 @@ class UserFilter extends PlFilter $this->buildQuery(); $lim = $limit->getSql(); $cond = ''; - if (!is_null($uids)) { + if (!empty($uids)) { $cond = XDB::format(' AND a.uid IN {?}', $uids); } $fetched = XDB::fetchColumn('SELECT SQL_CALC_FOUND_ROWS a.uid @@ -2286,7 +2287,7 @@ class UserFilter extends PlFilter $key = array($key); } $joins['e' . $sub] = PlSqlJoin::left('emails', '$ME.uid = $UID AND $ME.flags != \'filter\' - AND $ME.email IN {?}' . $key); + AND $ME.email IN {?}', $key); } } foreach ($this->al as $sub=>$key) {