reference search fix

This commit is contained in:
SJ 2014-08-04 22:19:03 +02:00
parent 50b78e712f
commit eb334317ca

View File

@ -285,8 +285,10 @@ class ModelSearchSearch extends Model {
$query = $this->db->query("SELECT id FROM " . TABLE_META . " WHERE message_id=? OR reference=? ORDER BY id DESC", array($reference, $reference)); $query = $this->db->query("SELECT id FROM " . TABLE_META . " WHERE message_id=? OR reference=? ORDER BY id DESC", array($reference, $reference));
foreach($query->rows as $q) { foreach($query->rows as $q) {
if($this->check_your_permission_by_id($q['id'])) {
array_push($ids, $q['id']); array_push($ids, $q['id']);
} }
}
if(ENABLE_FOLDER_RESTRICTIONS == 1) { if(ENABLE_FOLDER_RESTRICTIONS == 1) {
$query = $this->sphx->query("SELECT id, folder FROM " . SPHINX_MAIN_INDEX . " WHERE id IN (" . implode(",", $ids) . ")"); $query = $this->sphx->query("SELECT id, folder FROM " . SPHINX_MAIN_INDEX . " WHERE id IN (" . implode(",", $ids) . ")");