| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function preProcess() { |
||
| 37 | global $INPUT; |
||
| 38 | global $INFO; |
||
| 39 | |||
| 40 | // retrieve admin plugin name from $_REQUEST['page'] |
||
| 41 | if(($page = $INPUT->str('page', '', true)) != '') { |
||
| 42 | /** @var $plugin \DokuWiki_Admin_Plugin */ |
||
| 43 | if($plugin = plugin_getRequestAdminPlugin()) { // FIXME this method does also permission checking |
||
| 44 | if($plugin->forAdminOnly() && !$INFO['isadmin']) { |
||
| 45 | throw new ActionException('denied'); |
||
| 46 | } |
||
| 47 | $plugin->handle(); |
||
| 48 | } |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 57 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.