Append a user name to 'user' module requests loaded by JavaScript.
authorSzymon Świerkosz <beau@adres.pl>
Thu, 10 May 2012 20:56:55 +0000 (22:56 +0200)
committerSzymon Świerkosz <beau@adres.pl>
Thu, 10 May 2012 20:56:55 +0000 (22:56 +0200)
Change-Id: Id1b3256cc5b325b94531d0722aaa159ea20042f4

resources/mediawiki/mediawiki.js

index 4f345ab..11c54c3 100644 (file)
@@ -990,6 +990,10 @@ var mw = ( function ( $, undefined ) {
                                                        }
 
                                                        currReqBase = $.extend( { 'version': formatVersionNumber( maxVersion ) }, reqBase );
+                                                       // For user modules append a user name to the request.
+                                                       if ( group === "user" && mw.config.get( 'wgUserName' ) !== null ) {
+                                                               currReqBase.user = mw.config.get( 'wgUserName' );
+                                                       }
                                                        currReqBaseLength = $.param( currReqBase ).length;
                                                        async = true;
                                                        // We may need to split up the request to honor the query string length limit,