|
@@ -412,8 +412,17 @@ function msa_solrquery_breves($typed, $language, $user, $offset, $limit){
|
|
|
function materio_search_api_actuality(){
|
|
|
global $user;
|
|
|
|
|
|
- if(isset($user->roles[1])){
|
|
|
- $date_limit = strtotime('-6 month');
|
|
|
+ $useraccess = !isset($user->roles[10]) // student
|
|
|
+ && !isset($user->roles[11]) // alphatesteur
|
|
|
+ && !isset($user->roles[6]) // adherent
|
|
|
+ && !isset($user->roles[8]) // premium
|
|
|
+ && !isset($user->roles[12]) // translator
|
|
|
+ && !isset($user->roles[13]) // admin showroom
|
|
|
+ && !isset($user->roles[3]) // admin
|
|
|
+ && !isset($user->roles[4]); // root
|
|
|
+
|
|
|
+ if($useraccess){
|
|
|
+ $date_limit = strtotime('-4 month');
|
|
|
// dsm(date('d m y', $date_limit));
|
|
|
}
|
|
|
|
|
@@ -436,7 +445,7 @@ function materio_search_api_actuality(){
|
|
|
->propertyOrderBy('created', 'DESC')
|
|
|
->range($offset,$limit);
|
|
|
|
|
|
- if(isset($user->roles[1])){
|
|
|
+ if($useraccess){
|
|
|
$query->propertyCondition('created', $date_limit, '>');
|
|
|
}
|
|
|
|
|
@@ -449,7 +458,7 @@ function materio_search_api_actuality(){
|
|
|
->propertyCondition('status', 1)
|
|
|
->entityCondition('bundle', array('breve'));
|
|
|
// dsm($count, 'count');
|
|
|
- if(isset($user->roles[1])){
|
|
|
+ if($useraccess){
|
|
|
$count_query->propertyCondition('created', $date_limit, '>');
|
|
|
}
|
|
|
$count = $count_query->count()->execute();
|