Extension:RedirectAfterLogout
<translate> This extension stores its source code on a wiki page.</translate> <translate> Please be aware that this code may be unreviewed or maliciously altered.</translate> <translate> They may contain security holes, outdated interfaces that are no longer compatible etc.</translate> <translate> Note:</translate> <translate> No [[<tvar name=localisation>Special:MyLanguage/Localisation#Translation resources</tvar>|localisation]] updates are provided for this extension by <tvar name=twn>translatewiki.net </tvar>.</translate> |
<translate> This extension is currently not actively maintained!</translate> <translate> Although it may still work, any bug reports or feature requests will more than likely be ignored.</translate> |
RedirectAfterLogout Release status: unmaintained |
|
---|---|
Implementation | User activity |
Description | Allows wiki administrators to redirect to a specific page after a user has logged out |
Author(s) | Marcel Minke (Maziminketalk) |
Latest version | 1.0 (2008-12-01) |
MediaWiki | 1.14+ |
Database changes | No |
License | Public domain |
Download | See section code |
$wgPageToRedirectAfterLogout |
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
The RedirectAfterLogout extension is an adaption of the former RedirectOnLogin extension which allows you to redirect a user to a certain wiki page after having logged out.
Compatibility
The extension was created for MW 1.14a. Nevertheless this extension should work fine on all MediaWiki versions which support UserLogout hook and $wgOut->redirect()
.
Please update this page when you have tested the extension on other versions.
- Tested on
- 1.11.0
- 1.13
- 1.14
- 1.17
- 1.21.1
- 1.25.2
- ... (please add other tested versions)
Installation
- Create a page at "extensions/redirectAfterLogout.php" containing the code
- Add the following lines to your Localsettings.php file and adapt them:
//absolute path from web root
require_once("extensions/redirectAfterLogout.php");
//wiki page to redirect to (adjust path and page title)
$wgPageToRedirectAfterLogout = "/path_to_mediawiki/index.php?title=yourpage";
Code
<?php
//not called from the software -> show warning
if( ! defined( 'MEDIAWIKI' ) ) {
echo( "This file is an extension to the MediaWiki software, and cannot be used standalone.\n" );
die( 1 );
}
$wgExtensionCredits['other'][] = array(
'name'=>'RedirectAfterLogout',
'version'=> '1.0',
'author'=>'Marcel Minke',
'url'=>'https://www.mediawiki.org/wiki/Extension:RedirectAfterLogout',
'description' => 'Redirect to a certain page after logout'
);
//wiki page to redirect to (adjust path and page title)
$wgPageToRedirectAfterLogout = "/path_to_mediawiki/index.php?title=yourpage";
$wgHooks['UserLogout'][] = 'redirectAfterLogout';
function redirectAfterLogout(&$user) {
global $wgOut, $wgPageToRedirectAfterLogout;
$wgOut->redirect( $wgPageToRedirectAfterLogout );
return true;
}
- Pages with script errors
- Pages with broken file links
- Extensions which host their code in-wiki
- Unmaintained extensions
- Extensions without an image
- User activity extensions
- Extensions without a compatibility policy
- Extensions with manual MediaWiki version
- Public domain licensed extensions
- UserLogout extensions
- All extensions
- Extensions not in ExtensionJson
- Redirect extensions