don't show explicit features to those who aren't allowed

This commit is contained in:
Shish 2009-12-30 08:17:46 +00:00
parent 63277a0864
commit c9c4843e43

View file

@ -32,11 +32,16 @@ class Featured extends SimpleExtension {
}
public function onPostListBuilding($event) {
global $config, $page;
global $config, $page, $user;
$fid = $config->get_int("featured_id");
if($fid > 0) {
$image = Image::by_id($fid);
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);
}
}