[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Action/ -> Admin.php (source)

   1  <?php
   2  
   3  namespace dokuwiki\Action;
   4  
   5  use dokuwiki\Action\Exception\ActionException;
   6  
   7  /**
   8   * Class Admin
   9   *
  10   * Action to show the admin interface or admin plugins
  11   *
  12   * @package dokuwiki\Action
  13   */
  14  class Admin extends AbstractUserAction {
  15  
  16      /** @inheritdoc */
  17      public function minimumPermission() {
  18          return AUTH_READ; // let in check later
  19      }
  20  
  21      public function checkPreconditions() {
  22          parent::checkPreconditions();
  23      }
  24  
  25      public function preProcess() {
  26          global $INPUT;
  27          global $INFO;
  28  
  29          // retrieve admin plugin name from $_REQUEST['page']
  30          if(($page = $INPUT->str('page', '', true)) != '') {
  31              /** @var $plugin \dokuwiki\Extension\AdminPlugin */
  32              if($plugin = plugin_getRequestAdminPlugin()) { // FIXME this method does also permission checking
  33                  if(!$plugin->isAccessibleByCurrentUser()) {
  34                      throw new ActionException('denied');
  35                  }
  36                  $plugin->handle();
  37              }
  38          }
  39      }
  40  
  41      public function tplContent() {
  42          tpl_admin();
  43      }
  44  
  45  }