(bug 17844) Redirect users to a specific page when they log in. Based on patch by...
authorChad Horohoe <demon@users.mediawiki.org>
Sat, 7 Mar 2009 18:33:23 +0000 (18:33 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sat, 7 Mar 2009 18:33:23 +0000 (18:33 +0000)
CREDITS
RELEASE-NOTES
includes/DefaultSettings.php
includes/specials/SpecialUserlogin.php

diff --git a/CREDITS b/CREDITS
index bc24522..d36c2ff 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -86,6 +86,7 @@ following names for their contribution to the product.
 * RememberTheDot
 * RenĂ© Kijewski
 * ST47
+* Simon Walker
 * Stefano
 * Str4nd
 
index 1aec44b..1c7fb95 100644 (file)
@@ -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.
index c72617e..9254029 100644 (file)
@@ -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;
index 4bb2bf9..e663cf4 100644 (file)
@@ -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 {