DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:login_instead_of_forbidden

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tips:login_instead_of_forbidden [2008-12-15 13:18] – Changed layout einhirntips:login_instead_of_forbidden [2009-06-04 13:28] (current) 81.146.72.114
Line 1: Line 1:
 +====== 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@iai.uni-bonn.de>.
 +
 +===== Available as a Plugin =====
 +This functionality is available in a Plugin: [[plugin:showlogin]] \\  --- //[[marg@rz.tu-clausthal.de|Christian Marg]] 2008/12/15 13:12//
 +
 +
 +===== Instructions for version 2007-06-26b =====
 +
 +
 +In ''inc/template.php'', replace line 119 by this code:
 +
 +<code php>
 +      if ($_SERVER['REMOTE_USER'])
 +          print p_locale_xhtml('denied');
 +      else
 +          html_login();
 +</code>
 +
 +Based on dokuwiki-2009-02-14b as line 119 is a break. Instead find the 'case'denied':' then use the if statement.
 +<code php>
 +   case 'denied':
 + /    print p_locale_xhtml('denied'); */
 +       if ($_SERVER['REMOTE_USER'])
 +          print p_locale_xhtml('denied');
 +      else
 +          html_login();
 + break;
 +</code> 
 +
 +In addition, you might want to adapt the text in ''inc/lang/''//<yourlang>//''/denied.txt'' by removing the //maybe not logged in// text.

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