DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:login_instead_of_forbidden

Login instead of forbidden

It is quite annoying, that you have to click the Login button to access the login form when you visit a restricted page (not being already logged in, of course). This small patch automatically displays the login form in such a case.

Please mail remarks, suggestions etc. to bihler [at] iai [dot] uni [dash] bonn [dot] de.

Available as a Plugin

This functionality is available in a Plugin: showlogin
Christian Marg 2008/12/15 13:12

Instructions for version 2007-06-26b

In inc/template.php, replace line 119 by this code:

      if ($_SERVER['REMOTE_USER'])
          print p_locale_xhtml('denied');
      else
          html_login();

Based on dokuwiki-2009-02-14b as line 119 is a break. Instead find the 'case'denied':' then use the if statement.

   case 'denied':
 /*     print p_locale_xhtml('denied'); */
       if ($_SERVER['REMOTE_USER'])
          print p_locale_xhtml('denied');
      else
          html_login();
	break;

In addition, you might want to adapt the text in inc/lang/<yourlang>/denied.txt by removing the maybe not logged in text.

tips/login_instead_of_forbidden.txt · Last modified: 2009-06-04 13:28 by 81.146.72.114

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki