/** * Denied page content * * @return string html */ function html_denied() { print p_locale_xhtml('denied'); if (empty($_SERVER['REMOTE_USER'])) { html_login(); } }
/** * Handle the event */ public function handle_tpl_content_display(Doku_Event &$event, $param) { global $ACT; # If user is not logged in and access to page is denied, show login form if ($ACT == 'denied' && !$_SERVER['REMOTE_USER']) { $event->preventDefault(); // prevent "Access denied" page from showing html_login(); // show login dialog instead } # .. or show regular access denied page }
/** * Handle the event */ function showlogin2(&$event, $param) { global $ACT; global $ID; # add login form to page, only on access denied # and if user is not logged in if ($ACT == 'denied' && !$_SERVER['REMOTE_USER']) { if (!$this->getConf('show_denied')) { $event->preventDefault(); } html_login(); } }
/** * Default Action of TPL_ACT_RENDER * * @return bool */ function tpl_content_core() { global $ACT; global $TEXT; global $PRE; global $SUF; global $SUM; global $IDX; global $INPUT; switch ($ACT) { case 'show': html_show(); break; /** @noinspection PhpMissingBreakStatementInspection */ /** @noinspection PhpMissingBreakStatementInspection */ case 'locked': html_locked(); case 'edit': case 'recover': html_edit(); break; case 'preview': html_edit(); html_show($TEXT); break; case 'draft': html_draft(); break; case 'search': html_search(); break; case 'revisions': html_revisions($INPUT->int('first')); break; case 'diff': html_diff(); break; case 'recent': html_recent($INPUT->extract('first')->int('first'), $INPUT->str('show_changes')); break; case 'index': html_index($IDX); #FIXME can this be pulled from globals? is it sanitized correctly? break; case 'backlink': html_backlinks(); break; case 'conflict': html_conflict(con($PRE, $TEXT, $SUF), $SUM); html_diff(con($PRE, $TEXT, $SUF), false); break; case 'login': html_login(); break; case 'register': html_register(); break; case 'resendpwd': html_resendpwd(); break; case 'denied': print p_locale_xhtml('denied'); break; case 'profile': html_updateprofile(); break; case 'admin': tpl_admin(); break; case 'subscribe': tpl_subscribe(); break; case 'media': tpl_media(); break; default: $evt = new Doku_Event('TPL_ACT_UNKNOWN', $ACT); if ($evt->advise_before()) { msg("Failed to handle command: " . hsc($ACT), -1); } $evt->advise_after(); unset($evt); return false; } return true; }
?> <ul> <?php tpl_action('login', 1, 'li'); tpl_action('profile', 1, 'li'); tpl_action('admin', 1, 'li'); _tpl_action('userpage', 1, 'li'); ?> </ul> <div class="user"><?php tpl_userinfo(); ?> </div> <?php } else { html_login(); } ?> </div> <?php } ?> <div class="clearer"></div> </div></div><!-- /aside --> <!-- ********** CONTENT ********** --> <div id="dokuwiki__content"><div class="pad"> <?php tpl_flush(); ?>
function tpl_content_core() { global $ACT; global $TEXT; global $PRE; global $SUF; global $SUM; global $IDX; switch ($ACT) { case 'show': html_show(); break; case 'locked': html_locked(); case 'edit': case 'recover': html_edit(); break; case 'preview': html_edit(); html_show($TEXT); break; case 'draft': html_draft(); break; case 'search': html_search(); break; case 'revisions': $first = isset($_REQUEST['first']) ? intval($_REQUEST['first']) : 0; html_revisions($first); break; case 'diff': html_diff(); break; case 'recent': if (is_array($_REQUEST['first'])) { $_REQUEST['first'] = array_keys($_REQUEST['first']); $_REQUEST['first'] = $_REQUEST['first'][0]; } $first = is_numeric($_REQUEST['first']) ? intval($_REQUEST['first']) : 0; html_recent($first); break; case 'index': html_index($IDX); #FIXME can this be pulled from globals? is it sanitized correctly? break; case 'backlink': html_backlinks(); break; case 'conflict': html_conflict(con($PRE, $TEXT, $SUF), $SUM); html_diff(con($PRE, $TEXT, $SUF), false); break; case 'login': html_login(); break; case 'register': html_register(); break; case 'resendpwd': html_resendpwd(); break; case 'denied': print p_locale_xhtml('denied'); break; case 'profile': html_updateprofile(); break; case 'admin': tpl_admin(); break; case 'subscribe': tpl_subscribe(); break; default: $evt = new Doku_Event('TPL_ACT_UNKNOWN', $ACT); if ($evt->advise_before()) { msg("Failed to handle command: " . hsc($ACT), -1); } $evt->advise_after(); unset($evt); return false; } return true; }