From: <ni...@us...> - 2007-08-06 19:29:52
|
Update of /cvsroot/tikiwiki/tiki/lib/mypage In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5671/lib/mypage Modified Files: mypagelib.php Log Message: [FIX] mypage: be more verbose with permission denied Index: mypagelib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/mypage/mypagelib.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- mypagelib.php 6 Aug 2007 19:25:30 -0000 1.6 +++ mypagelib.php 6 Aug 2007 19:29:49 -0000 1.7 @@ -273,18 +273,21 @@ case 'iframe': // don't do nothing here for the special iframe case break; + default: if (file_exists("components/comp-".$this->params['contenttype'].".php")) { - require_once("components/comp-".$this->params['contenttype'].".php"); - $classname="Comp_".$this->params['contenttype']; - $comp=new $classname($this->params['content']); - $compperms = $comp->get_perm_object(); - if (!isset($compperms['tiki_p_view_'.$this->params['contenttype']]) || $compperms['tiki_p_view_'.$this->params['contenttype']] != 'y') { - return ''; - } - } else { - return ''; + require_once("components/comp-".$this->params['contenttype'].".php"); + $classname="Comp_".$this->params['contenttype']; + $comp=new $classname($this->params['content']); + $compperms = $comp->get_perm_object(); + if (!isset($compperms['tiki_p_view_'.$this->params['contenttype']]) + || $compperms['tiki_p_view_'.$this->params['contenttype']] != 'y') { + + return 'alert("You don\'t have permission to view this part of content");'; } + } else { + return 'alert("Component not available: '.$this->params['contenttype'].'");'; + } break; } @@ -312,17 +315,9 @@ $js.=$v.".addEvent('onClose', function(){ xajax_mypage_win_destroy(".$this->mypage->id.", ".$this->id."); });\n"; - switch ($this->params['contenttype']) { - - case 'iframe': - // don't do nothing here for the special iframe case - break; - - default: + if ($this->params['contenttype'] != 'iframe') { $js.=$v.".setHTML(".phptojsarray($comp->getHTMLContent()).");\n"; - break; } - $js.=$v.".show();\n"; |