From c9c4843e4399746d813a15bbce0b28aec8244bf1 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 30 Dec 2009 08:17:46 +0000 Subject: [PATCH] don't show explicit features to those who aren't allowed --- contrib/featured/main.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/featured/main.php b/contrib/featured/main.php index bceca71b..bd291bd6 100644 --- a/contrib/featured/main.php +++ b/contrib/featured/main.php @@ -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); } }