function apachesolr_nodeaccess_apachesolr_modify_query in Apache Solr Search 5.2
Same name and namespace in other branches
- 5 contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module \apachesolr_nodeaccess_apachesolr_modify_query()
- 6 contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module \apachesolr_nodeaccess_apachesolr_modify_query()
- 6.2 contrib/apachesolr_nodeaccess/apachesolr_nodeaccess.module \apachesolr_nodeaccess_apachesolr_modify_query()
Implementation of hook_apachesolr_modify_query().
File
- contrib/
apachesolr_nodeaccess/ apachesolr_nodeaccess.module, line 80
Code
function apachesolr_nodeaccess_apachesolr_modify_query(&$query, &$params) {
global $user;
try {
$subquery = _apachesolr_nodeaccess_build_subquery($user);
} catch (Exception $e) {
$query = NULL;
watchdog("apachesolr_nodeaccess", t('User %name (UID:!uid) cannot search: @message', array(
'%name' => $user->name,
'!uid' => $user->uid,
'@message' => $e
->getMessage(),
)));
return;
}
if (!empty($subquery)) {
$query
->add_subquery($subquery, 'OR');
}
}