? .svn ? SolrPhpClient ? contrib/.svn ? contrib/apachesolr_commentsearch/.svn ? contrib/apachesolr_image/.svn ? contrib/apachesolr_nodeaccess/.svn ? contrib/apachesolr_nodeaccess/tests/.svn ? contrib/apachesolr_og/.svn ? drush/.svn ? tests/.svn Index: contrib/apachesolr_commentsearch/apachesolr_commentsearch.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/contrib/apachesolr_commentsearch/Attic/apachesolr_commentsearch.module,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 apachesolr_commentsearch.module --- contrib/apachesolr_commentsearch/apachesolr_commentsearch.module 2 Oct 2009 21:07:13 -0000 1.1.2.2 +++ contrib/apachesolr_commentsearch/apachesolr_commentsearch.module 3 Oct 2009 16:05:37 -0000 @@ -35,7 +35,9 @@ function apachesolr_commentsearch_node_t $document->nid = $comment->nid; $document->uid = $comment->uid; $document->title = apachesolr_clean_text($comment->subject); - $document->status = $node->status; + // We turn this around to be consistent with nodes. + $document->status = $comment->status == COMMENT_PUBLISHED ? 1 : 0; + if (!empty($node->language)) { $document->language = $node->language; } @@ -59,6 +61,18 @@ function apachesolr_commentsearch_apache $fls = array_filter(explode(',', $params['fl'])); $fls[] = 'is_cid'; $params['fl'] = implode(',', $fls); + // If the user can't access comments block them from the search. + if (!user_access('access comments')) { + $query->add_filter('type', 'comment', TRUE); + } +// If the user can't administer comments, block unpublished comments from search. +// if (!user_access('administer comments')) { +// $query->add_filter('type', 'comment', 'TRUE'); +// $subquery = apachesolr_drupal_query(); +// $subquery->add_filter('type', 'comment'); +// $subquery->add_filter('status', 0, TRUE); +// $query->add_subquery($subquery, 'AND', 'OR'); +// } } function apachesolr_commentsearch_apachesolr_process_results(&$results) {