From: <jon...@us...> - 2013-02-28 14:12:47
|
Revision: 45004 http://sourceforge.net/p/tikiwiki/code/45004 Author: jonnybradley Date: 2013-02-28 14:12:44 +0000 (Thu, 28 Feb 2013) Log Message: ----------- [bp/r44966][FIX] menupage module: Add perms check on the wiki page (thanks marclaporte) [bp/r44975][FIX] menupage module: Add error message if no tiki_p_view on page Revision Links: -------------- http://sourceforge.net/p/tikiwiki/code/44966 http://sourceforge.net/p/tikiwiki/code/44975 Modified Paths: -------------- branches/10.x/modules/mod-func-menupage.php Modified: branches/10.x/modules/mod-func-menupage.php =================================================================== --- branches/10.x/modules/mod-func-menupage.php 2013-02-28 13:29:47 UTC (rev 45003) +++ branches/10.x/modules/mod-func-menupage.php 2013-02-28 14:12:44 UTC (rev 45004) @@ -65,8 +65,14 @@ $pagemenu = $wikilib->include_default_namespace($pagemenu); } - $content = $wikilib->get_parse($pagemenu, $dummy, true); + $perms = Perms::get(array('object' => $pagemenu, 'type' => 'wiki page')); + if ($perms->view) { + $content = $wikilib->get_parse($pagemenu, $dummy, true); + } else { + $content = '<label class="error">' . tra("You are not logged in") . '</label>'; + } + if (! empty($content) && ! empty($module_params['menu_type']) && in_array($module_params['menu_type'], array('horiz', 'vert'))) { $class = 'cssmenu_' . $module_params['menu_type']; $content = preg_replace_callback('/<(ul|ol|li)([^>]*)>/Umi', function ($matches) use ($class) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |