DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:loginredirect

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:loginredirect [2013-11-02 02:15] Klap-inplugin:loginredirect [2023-10-31 00:02] (current) Klap-in
Line 1: Line 1:
-====== login redirector plugin ======+====== login redirector Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 6: Line 6:
 email      : chris@jalakai.co.uk email      : chris@jalakai.co.uk
 type       : action type       : action
-lastupdate : 2013-02-14 +lastupdate : 2016-02-02 
-compatible : lemminganteaterrincewindanguaadora belle+compatible : LemmingAnteaterRincewindAnguaAdora Belle
 depends    : depends    :
 conflicts  : conflicts  :
Line 18: Line 18:
 ---- ----
  
-This [[plugin]] redirects the DokuWiki login button to another URL.  It is most useful when combined with an external authentication method and it can direct the user to the common login page used by that method.+This plugin redirects the DokuWiki login button to another URL.  It is most useful when combined with an external authentication method and it can direct the user to the common login page used by that method.
  
 ===== Notes ===== ===== Notes =====
Line 36: Line 36:
 ===== Installation ===== ===== Installation =====
  
-To install the plugin manually, download the source to your plugin folder, ''lib/plugins'' and extract its contentsThat will create a new plugin folder, ''lib/plugins/loginredirect'', and install the plugin.+Search and install the plugin using the [[plugin:extension|Extension Manager]]Refer to [[:Plugins]] on how to install plugins manually.
  
-The folder will contain: 
-  action.php                             the plugin script 
-  conf/default.php                       default configuration settings 
-  conf/metadata.php                      information for DokuWiki's configuration page 
- 
-The plugin is now installed. 
- 
-===== Details ===== 
- 
-The plugin consists of one main files, the plugin script [[#action.php]] and two other files to define the configuration setting for DokuWiki's Admin / Configuration page. 
- 
-==== action.php ==== 
- 
-This is the code for the release version of DokuWiki.  Users of the development version of DokuWiki should get the source from the darcs repository, either through darcs or through the web browser interface. 
- 
-<code php> 
-<?php 
-/** 
- * Action Plugin:   Redirect login, for use with external auth methods 
-  
- * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html) 
- * @author     Christopher Smith <chris@jalakai.co.uk>   
- */ 
- 
-// must be run within DokuWiki 
-if(!defined('DOKU_INC')) die(); 
- 
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 
-require_once(DOKU_PLUGIN.'action.php'); 
- 
-/** 
- * All DokuWiki action plugins need to inherit from this class 
- */ 
-class action_plugin_loginredirect extends DokuWiki_Action_Plugin { 
- 
-    /** 
-     * return some info 
-     */ 
-    function getInfo(){ 
-      return array( 
-        'author' => 'Christopher Smith', 
-        'email'  => 'chris@jalakai.co.uk', 
-        'date'   => '2006-10-14', 
-        'name'   => 'Login Redirector', 
-        'desc'   => 'Redirect a login request to another url, for use with external authentication methods.', 
-        'url'    => 'http://www.dokuwiki.org/plugin:login_redirector', 
-      ); 
-    } 
-     
-    /* 
-     * plugin should use this method to register its handlers with the DokuWiki's event controller 
-     */ 
-    function register(Doku_Event_Handler $controller) { 
-      $controller->register_hook('ACTION_ACT_PREPROCESS','BEFORE', $this, 'handle_loginredirect'); 
-    } 
-     
-    function handle_loginredirect(&$event, $param) { 
-      if ($event->data == 'login') { 
-        $url = $this->getConf('url'); 
-        if (empty($url)) return; 
- 
-        header("Location: $url"); 
-        exit(); 
-      } 
-    } 
-     
-     
-} 
- 
-//Setup VIM: ex: et ts=4 enc=utf-8 : 
-</code> 
  
 ===== Revision History ===== ===== Revision History =====
Line 120: Line 49:
  
 ===== Bugs ===== ===== Bugs =====
 +See the [[https://github.com/Chris--S/dokuwiki-plugin-loginredirect/issues|issue tracker]]
  
  
Line 126: Line 55:
 ===== Discussion ===== ===== Discussion =====
  
-I've had no luck at getting this plug-in to work. I have installed the files within the plugin directory, specified the URL in default.php. I am missing something big here, and I can't figure out what. The login still goes to the default login page. I am running the released version of DokuWiki and am using your zipped version of the plug-in, which I installed manually. I wish that I could give you more information about its behavior, but it's not doing anything to describe. I think I'm not putting the appropriate data in the metadata.php file. Could you describe, in further detail, what is required for metadata.php or give me some other pointers? --Pete 
- 
-> Do you have a link?  When you say "the released version of DokuWiki" do you mean one of the recent release candidates or the current release (2006-03-09e)?  As mentioned at the very top of the page, the plugin requires rc2006-09-28 or later.  Action plugins are not supported in 2006-03-09e (and earlier). --- //[[chris@jalakai.co.uk|Christopher Smith]] 2006-10-21 20:51// 
- 
-My Doku installation wasn't as current as I thought. I have it working now. Thanks for you response! Could this concept also be applied to the registering process? It would be great if you could be redirected to a page to register and then brought back whence you came. --Pete 
  
 ---- ----
plugin/loginredirect.1383354952.txt.gz · Last modified: 2013-11-02 02:15 by Klap-in

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