From 88a71175e3de9e3ad8b20ca9eb710aaf773cb788 Mon Sep 17 00:00:00 2001 From: Kate Arzamastseva Date: Thu, 23 Jun 2011 14:16:15 +0300 Subject: media manager auth fix --- inc/lang/en/lang.php | 2 ++ inc/media.php | 27 +++++++++++++++++++++++---- inc/template.php | 3 ++- lib/exe/mediamanager.php | 4 ++-- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 6fb387a89..a55981983 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -338,5 +338,7 @@ $lang['media_view'] = 'View'; $lang['media_edit'] = 'Edit'; $lang['media_history'] = 'These are the older revisions of the file.'; $lang['media_meta_edited']= 'metadata edited'; +$lang['media_perm_read'] = 'Sorry, you don\'t have enough rights to read files.'; +$lang['media_perm_upload']= 'Sorry, you don\'t have enough rights to upload files.'; //Setup VIM: ex: et ts=2 : diff --git a/inc/media.php b/inc/media.php index 461a13665..fc7f72941 100644 --- a/inc/media.php +++ b/inc/media.php @@ -89,9 +89,13 @@ function media_metasave($id,$auth,$data){ * @author Kate Arzamastseva */ function media_metaform($id,$auth,$fullscreen = false){ - if($auth < AUTH_UPLOAD) return false; global $lang, $config_cascade; + if($auth < AUTH_UPLOAD) { + echo '
'.$lang['media_perm_upload'].'
'.NL; + return false; + } + // load the field descriptions static $fields = null; if(is_null($fields)){ @@ -637,7 +641,7 @@ function media_tab_files($ns,$auth=null,$jump='') { $view = $_REQUEST['view']; if($auth < AUTH_READ){ - echo '
'.$lang['nothingfound'].'
'.NL; + echo '
'.$lang['media_perm_read'].'
'.NL; }else{ if ($view == 'list') { echo '