From f6b6931ff40253fb2ab6899cc1a159b888cd017e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 8 Aug 2003 03:10:55 +0000 Subject: [PATCH] add wgPasswordSalt option, set to false for compatibility with old passwords in user table --- includes/DefaultSettings.php | 2 ++ includes/User.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index f5dc756f2b..98fcbde194 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -121,6 +121,8 @@ $wgProfiling = false; # Enable for more detailed by-function times in debug log # Requires zlib support enabled in PHP. $wgUseGzip = false; +$wgPasswordSalt = true; # For compatibility with old installations set to false + # Which namespaces should support subpages? # See Language.php for a list of namespaces. # diff --git a/includes/User.php b/includes/User.php index 4e38f7de9e..8306392a71 100644 --- a/includes/User.php +++ b/includes/User.php @@ -282,7 +282,11 @@ class User { function addSalt( $p ) { - return md5( "{$this->mId}-{$p}" ); + global $wgPasswordSalt; + if($wgPasswordSalt) + return md5( "{$this->mId}-{$p}" ); + else + return $p; } function encryptPassword( $p ) -- 2.20.1