Reverting r40323, as per comments on wikitech-l. Deprecated doesn't mean removed...
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 3 Sep 2008 02:28:41 +0000 (02:28 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 3 Sep 2008 02:28:41 +0000 (02:28 +0000)
RELEASE-NOTES
config/index.php
includes/DefaultSettings.php
includes/ProxyTools.php
includes/Setup.php
includes/User.php
includes/specials/SpecialBlockme.php

index bff5251..6c27e8a 100644 (file)
@@ -46,9 +46,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * $wgAllowExternalImagesFrom may now be an array of multiple strings.
 * Introduced $wgEnableImageWhitelist to toggle the on-wiki external image
   whitelist on or off.
-* $wgProxyKey has been fully deprecated (marked as such since 1.4, never
-  seems to have been completed). $wgSecretKey is the official documented
-  setting now.
   
 === New features in 1.14 ===
 
index 785ec21..a0d7f4f 100644 (file)
@@ -1706,7 +1706,7 @@ if ( \$wgCommandLineMode ) {
 
 \$wgLanguageCode = \"{$slconf['LanguageCode']}\";
 
-\$wgSecretKey = \"$secretKey\";
+\$wgProxyKey = \"$secretKey\";
 
 ## Default skin: you can change the default skin. Use the internal symbolic
 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
index 64a0cab..ef02aae 100644 (file)
@@ -1357,6 +1357,8 @@ $wgProxyMemcExpiry = 86400;
 $wgSecretKey = false;
 /** big list of banned IP addresses, in the keys not the values */
 $wgProxyList = array();
+/** deprecated */
+$wgProxyKey = false;
 
 /** Number of accounts each IP address may create, 0 to disable.
  * Requires memcached */
index a89283c..759857d 100644 (file)
@@ -138,7 +138,7 @@ function wfIsTrustedProxy( $ip ) {
 function wfProxyCheck() {
        global $wgBlockOpenProxies, $wgProxyPorts, $wgProxyScriptPath;
        global $wgMemc, $wgProxyMemcExpiry;
-       global $wgSecretKey;
+       global $wgProxyKey;
 
        if ( !$wgBlockOpenProxies ) {
                return;
@@ -154,7 +154,7 @@ function wfProxyCheck() {
        # Fork the processes
        if ( !$skip ) {
                $title = SpecialPage::getTitleFor( 'Blockme' );
-               $iphash = md5( $ip . $wgSecretKey );
+               $iphash = md5( $ip . $wgProxyKey );
                $url = $title->getFullURL( 'ip='.$iphash );
 
                foreach ( $wgProxyPorts as $port ) {
index 148af48..ecc6def 100644 (file)
@@ -150,10 +150,6 @@ require_once( "$IP/includes/StubObject.php" );
 wfProfileOut( $fname.'-includes' );
 wfProfileIn( $fname.'-misc1' );
 
-# Override SecretKey with ProxyKey if a site is using the old setting
-if ( isset( $wgProxyKey ) ) {
-       $wgSecretKey = $wgProxyKey;
-}
 
 $wgIP = false; # Load on demand
 # Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
index 25791e4..5fa2ff5 100644 (file)
@@ -1650,11 +1650,13 @@ class User {
         * @private
         */
        function setToken( $token = false ) {
-               global $wgSecretKey;
+               global $wgSecretKey, $wgProxyKey;
                $this->load();
                if ( !$token ) {
                        if ( $wgSecretKey ) {
                                $key = $wgSecretKey;
+                       } elseif ( $wgProxyKey ) {
+                               $key = $wgProxyKey;
                        } else {
                                $key = microtime();
                        }
index 81d3684..f222e3c 100644 (file)
@@ -8,11 +8,11 @@
  *
  */
 function wfSpecialBlockme() {
-       global $wgRequest, $wgBlockOpenProxies, $wgOut, $wgSecretKey;
+       global $wgRequest, $wgBlockOpenProxies, $wgOut, $wgProxyKey;
 
        $ip = wfGetIP();
 
-       if( !$wgBlockOpenProxies || $wgRequest->getText( 'ip' ) != md5( $ip . $wgSecretKey ) ) {
+       if( !$wgBlockOpenProxies || $wgRequest->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) {
                $wgOut->addWikiMsg( 'proxyblocker-disabled' );
                return;
        }