ondeniedlogin plugin

Compatible with DokuWiki

No compatibility info given!

plugin redirects unknown users to a login form on denied requests

Last updated on
2009-04-21
Provides
Action

Similar to showlogin, showlogin2

Tagged with authentication, redirect

Download and Installation

Download and install the plugin using the Plugin Manager using the following URL.

Or copy paste this code into your lib/plugins/ondeniedlogin/action.php .

action.php
<?php
  if(!defined('DOKU_INC')) die();
  if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
  require_once(DOKU_PLUGIN.'action.php');
 
  class action_plugin_ondeniedlogin extends DokuWiki_Action_Plugin {
 
    function getInfo(){
      return array(
        'author' => 'Samuel Fischer',
        'email'  => 'sf@notomorrow.de',
        'date'   => '2009-04-21',
        'name'   => 'ondeniedlogin',
        'desc'   => 'redirects unknown users to a login form on denied requests',
        'url'    => 'http://www.dokuwiki.org/plugin:ondeniedlogin',
      );
    }
 
  function register(&$controller) {
      $controller->register_hook('TPL_ACT_RENDER', 'BEFORE',  $this, 'ondeniedlogin');
    }
 
    function ondeniedlogin(&$event, $param) {
        global $ACT, $INFO;
 
        if($ACT!='denied') return;
          if(!is_array($INFO['userinfo']))
                $ACT = 'login';
    }
 
  }

Patches

This adds the following functionality to this plugin: When your ACLs allow someone to see some pages but maybe not the start page, this helps him because he gets some search hits instead of “Permission denied”…

ondenied-search.patch
--- ondeniedlogin/action.php    2011-08-26 16:47:00.000000000 +0200
+++ ondeniedlogin/action.php    2011-08-26 16:54:23.000000000 +0200
@@ -26,6 +26,8 @@
       if($ACT!='denied') return;
         if(!is_array($INFO['userinfo']))
        $ACT = 'login';
+        else
+       $ACT = 'search';
     }
 
   }
plugin/ondeniedlogin.txt · Last modified: 2011/08/26 17:01 by einhirn
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate