1<?php 2/** 3 * DokuWiki Plugin show specific page instead of denied message 4 * 5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 6 * @author Benjamin Renard <brenard@easter-eggs.com> 7 */ 8 9if (!defined('DOKU_INC')) die(); 10 11if (!defined('DOKU_LF')) define('DOKU_LF', "\n"); 12if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t"); 13if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 14 15require_once DOKU_PLUGIN.'action.php'; 16 17class action_plugin_deniedpage extends DokuWiki_Action_Plugin { 18 19 /** 20 * Register its handlers with the dokuwiki's event controller 21 */ 22 public function register(Doku_Event_Handler $controller) { 23 $controller->register_hook('ACTION_HEADERS_SEND', 'BEFORE', $this, 'handle_action_headers_send'); 24 } 25 26 /** 27 * Handle the event 28 */ 29 public function handle_action_headers_send(Doku_Event $event, $param) { 30 global $ACT; 31 32 if ($ACT == 'denied') { 33 $event->preventDefault(); // prevent "Access denied" page from showing 34 send_redirect(wl($this->getConf('deniedpage'),'',true)); 35 } 36 } 37 38} 39// vim:ts=4:sw=4:et: 40