From: Chad Horohoe Date: Sat, 7 Mar 2009 18:33:23 +0000 (+0000) Subject: (bug 17844) Redirect users to a specific page when they log in. Based on patch by... X-Git-Tag: 1.31.0-rc.0~42576 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=c430b8f3fdd7e1ae1b59affc288460b92a8816aa;p=lhc%2Fweb%2Fwiklou.git (bug 17844) Redirect users to a specific page when they log in. Based on patch by Simon Walker --- diff --git a/CREDITS b/CREDITS index bc245226bb..d36c2ffeba 100644 --- a/CREDITS +++ b/CREDITS @@ -86,6 +86,7 @@ following names for their contribution to the product. * RememberTheDot * René Kijewski * ST47 +* Simon Walker * Stefano * Str4nd diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1aec44bf5f..1c7fb95760 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -27,6 +27,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN from rel="nofollow" on external links * (bug 12970) Added $wgForceClientThumbnails to force client rendering of thumbs, instead of falling back to GD. +* Added $wgRedirectOnLogin to allow specifying a specifc page to redirect users + to upon logging in (ex: "Main Page") === New features in 1.15 === @@ -127,6 +129,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN of $wgSpamRegex for edit summary checks. Text checks still use $wgSpamRegex. * New function to convert content text to specified language (only applies on wiki with LanguageConverter class) +* (bug 17844) Redirect users to a specific page when they log in, see + $wgRedirectOnLogin === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c72617e496..925402949f 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3759,3 +3759,9 @@ $wgPreprocessorCacheThreshold = 1000; * Has no effect if no tags are defined in valid_tag. */ $wgUseTagFilter = true; + +/** + * Allow redirection to another page when a user logs in. + * To enable, set to a string like 'Main Page' + */ +$wgRedirectOnLogin = null; diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 4bb2bf950f..e663cf4cb4 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -45,7 +45,7 @@ class LoginForm { */ function LoginForm( &$request, $par = '' ) { global $wgLang, $wgAllowRealName, $wgEnableEmail; - global $wgAuth; + global $wgAuth, $wgRedirectOnLogin; $this->mType = ( $par == 'signup' ) ? $par : $request->getText( 'type' ); # Check for [[Special:Userlogin/signup]] $this->mName = $request->getText( 'wpName' ); @@ -66,6 +66,10 @@ class LoginForm { $this->mLanguage = $request->getText( 'uselang' ); $this->mSkipCookieCheck = $request->getCheck( 'wpSkipCookieCheck' ); + if ( $wgRedirectOnLogin ) { + $this->mReturnTo = $wgRedirectOnLogin; + } + if( $wgEnableEmail ) { $this->mEmail = $request->getText( 'wpEmail' ); } else {