Friday 03 April 2009 10:29:50 am
I've implemented temp/dirty solution: Modified /ezfind/classes/ezfezpsolrquerybuilder.php, buildSearch() function - below $queryFields added the following code
$queryFields = .......
//exclude "internal_tags" attribute from search on the front site
$currentUser = eZUser::currentUser();
$webUser = $currentUser->Login;
if ($webUser == 'anonymous') {
$key_to_be_deleted = array_search('attr_internal_tags_t', $queryFields);
$this->array_delete($queryFields,$key_to_be_deleted);
}
eZDebug::writeDebug( $currentUser, 'currentUser' );
- based on the currentUser I can remove key and value from queryFields array - added array_delete function (from php.net manual)
public function array_delete(&$ary,$key_to_be_deleted)
{
$new = array();
if($key_to_be_deleted) {
if(!array_key_exists($key_to_be_deleted,$ary)) {
return;
}
foreach($ary as $key => $value) {
if($key != $key_to_be_deleted) {
$new[$key] = $value;
}
}
$ary = $new;
}
if(is_array($key_to_be_deleted)) {
foreach($key_to_be_deleted as $del) {
array_delete(&$ary,$del);
}
}
eZDebug::writeDebug( $new, 'array_delete' );
}
Developer
http://www.duoconsulting.com
|