don't show explicit features to those who aren't allowed
This commit is contained in:
parent
63277a0864
commit
c9c4843e43
1 changed files with 6 additions and 1 deletions
|
@ -32,11 +32,16 @@ class Featured extends SimpleExtension {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onPostListBuilding($event) {
|
public function onPostListBuilding($event) {
|
||||||
global $config, $page;
|
global $config, $page, $user;
|
||||||
$fid = $config->get_int("featured_id");
|
$fid = $config->get_int("featured_id");
|
||||||
if($fid > 0) {
|
if($fid > 0) {
|
||||||
$image = Image::by_id($fid);
|
$image = Image::by_id($fid);
|
||||||
if(!is_null($image)) {
|
if(!is_null($image)) {
|
||||||
|
if(class_exists("Ratings")) {
|
||||||
|
if(strpos(Ratings::get_user_privs($user), $image->rating) === FALSE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->theme->display_featured($page, $image);
|
$this->theme->display_featured($page, $image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue