From: Lee Daniel Crocker Date: Thu, 1 May 2003 00:19:49 +0000 (+0000) Subject: One more password bug fix, DisableCounters flag. X-Git-Tag: 1.1.0~572 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=ccf64c4f3de0c6d81186038c15496681906b3aac;p=lhc%2Fweb%2Fwiklou.git One more password bug fix, DisableCounters flag. --- diff --git a/LocalSettings.sample b/LocalSettings.sample index e48f50df0a..d1696d52fc 100644 --- a/LocalSettings.sample +++ b/LocalSettings.sample @@ -51,4 +51,11 @@ $wgLocalInterwiki = "w"; $wgInputEncoding = "ISO-8859-1"; $wgOutputEncoding = "ISO-8859-1"; +# Extremely high-traffic wikis may want to disable +# some database-intensive features here: +# +# $wgDisableTextSearch = true; +# $wgDisableCounters = true; +# $wgMiserMode = true; + ?> diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6b9746ca17..1ab6d190fc 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1,6 +1,10 @@ mViews < 0 ) { $m = "-1"; } diff --git a/includes/Skin.php b/includes/Skin.php index 303ad176fc..5f219bdec3 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -533,11 +533,14 @@ function toggleVisibility( _levelId, _otherId, _linkId) { if ( isset( $oldid ) || isset( $diff ) ) { return ""; } if ( 0 == $wgArticle->getID() ) { return ""; } - $count = $wgArticle->getCount(); - $s = str_replace( "$1", $count, wfMsg( "viewcount" ) ); - + if ( $wgDisableCounts ) { + $s = ""; + } else { + $count = $wgArticle->getCount(); + $s = str_replace( "$1", $count, wfMsg( "viewcount" ) ); + } $s .= $this->lastModified(); - $s .= " ".wfMsg( "gnunote" ) ; + $s .= " " . wfMsg( "gnunote" ); return "{$s}"; } diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index fb0dfac11c..082ea94933 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -40,7 +40,7 @@ function wfSpecialPreferences() mainPrefsForm( wfMsg( "badretype" ) ); return; } - $ep = User::encryptPassword( $wpOldpass ); + $ep = $wgUser->encryptPassword( $wpOldpass ); if ( $ep != $wgUser->getPassword() ) { if ( $ep != $wgUser->getNewpassword() ) { mainPrefsForm( wfMsg( "wrongpassword" ) ); diff --git a/includes/ViewCountUpdate.php b/includes/ViewCountUpdate.php index 676ce808f8..954c59107d 100644 --- a/includes/ViewCountUpdate.php +++ b/includes/ViewCountUpdate.php @@ -12,6 +12,9 @@ class ViewCountUpdate { function doUpdate() { + global $wgDisableCounters; + if ( $wgDisableCounters ) { return; } + $sql = "UPDATE LOW_PRIORITY cur SET cur_counter=(1+cur_counter)," . "cur_timestamp=cur_timestamp WHERE cur_id={$this->mPageID}"; $res = wfQuery( $sql, "ViewCountUpdate::doUpdate" );