Index: trunk/extensions/StableVersion/StableVersion.php |
— | — | @@ -30,6 +30,10 @@ |
31 | 31 | # Evil variables, needed internally |
32 | 32 | $wgStableVersionCaching = false; |
33 | 33 | |
| 34 | +# Every user can mark stable versions (default) |
| 35 | +# To change this, add this line to localsettings.php and modify |
| 36 | +$wgGroupPermissions['user']['stableversion'] = true; |
| 37 | + |
34 | 38 | $wgExtensionCredits['StableVersion'][] = array( |
35 | 39 | 'name' => 'Stable version', |
36 | 40 | 'description' => 'An extension to allow the marking of a stable version.', |
— | — | @@ -190,11 +194,11 @@ |
191 | 195 | * @return bool (always TRUE by default, for testing) |
192 | 196 | */ |
193 | 197 | function wfStableVersionCanChange() { |
194 | | - return true; # Dummy, everyone can set stable versions |
| 198 | + //return true; # Dummy, everyone can set stable versions |
195 | 199 | global $wgUser, $wgOut; |
196 | 200 | if( !$wgUser->isAllowed( 'stableversion' ) ) { |
197 | | - #$wgOut->permissionRequired( 'stableversion' ); |
198 | | - #$wgOut->setSubtitle( wfMsg('stableversion') ); |
| 201 | + $wgOut->permissionRequired( 'stableversion' ); |
| 202 | + $wgOut->setSubtitle( wfMsg('stableversion') ); |
199 | 203 | return false; |
200 | 204 | } |
201 | 205 | return true; |
— | — | @@ -212,6 +216,11 @@ |
213 | 217 | wfStableVersionAddCache(); |
214 | 218 | $st = ""; # Subtitle |
215 | 219 | |
| 220 | + # Gah...these hooks are not consistant |
| 221 | + # Load if not loaded to avoid errors - Aaron |
| 222 | + if ( !isset($article->mIsStable) ) |
| 223 | + wfStableVersionSetArticleVersionStatusAndCache( $article, $article->getRevIdFetched() ); |
| 224 | + |
216 | 225 | if( $article->mIsStable ) { |
217 | 226 | # This is the stable version |
218 | 227 | if( $article->mLatest == $article->mLastStable ) { |