* \type{\int} Serialized record version.
* @ingroup Constants
*/
-define( 'MW_USER_VERSION', 6 );
+define( 'MW_USER_VERSION', 7 );
/**
* \type{\string} Some punctuation to prevent editing from broken text-mangling proxies.
// Restrictions-related block
public function loadRestrictions() {
- if( !$this->mRestrictions )
+ if( is_null( $this->mRestrictions ) )
$this->mRestrictions = UserRestriction::fetchForUser( $this->isLoggedIn() ?
intval( $this->getId() ) : $this->getName() );
}
if ( $error )
$wgOut->wrapWikiMsg( '<strong class="error">$1</strong>', $error );
if ( $success )
- $wgOut->wrapWikiMsg( '<strong class="success">$1/strong>', $success );
+ $wgOut->wrapWikiMsg( '<strong class="success">$1</strong>', $success );
}
public static function doPageRestriction( $uid, $user ) {
$l = new LogPage( 'restrict' );
$l->addEntry( 'restrict', Title::makeTitle( NS_USER, $user ), $r->getReason(),
array( $r->getType(), $r->getPage()->getFullText(), $logExpiry) );
+ self::invalidateCache( $user );
}
public static function namespaceRestrictionForm( $uid, $user, $oldRestrictions ) {
$wgUser->matchEditToken( $wgRequest->getVal( 'edittoken' ) ) ) {
$ns = $wgRequest->getVal( 'namespace' );
if( $wgContLang->getNsText( $ns ) === false )
- $error = wfMsgExt( 'restrictuser-badnamespace', 'parseinline' );
+ $error = array( 'restrictuser-badnamespace' );
elseif( UserRestriction::convertExpiry( $wgRequest->getVal( 'expiry' ) ) === false )
- $error = wfMsgExt( 'restrictuser-badexpiry', 'parseinline', $wgRequest->getVal( 'expiry' ) );
+ $error = array( 'restrictuser-badexpiry', $wgRequest->getVal( 'expiry' ) );
else
foreach( $oldRestrictions as $r )
if( $r->isNamespace() && $r->getNamespace() == $ns )
- $error = wfMsgExt( 'restrictuser-dupnamespace', 'parse' );
+ $error = array( 'restrictuser-dupnamespace' );
if( !$error ) {
self::doNamespaceRestriction( $uid, $user );
$success = array('restrictuser-success', $user);
$l = new LogPage( 'restrict' );
$l->addEntry( 'restrict', Title::makeTitle( NS_USER, $user ), $r->getReason(),
array( $r->getType(), $r->getNamespace(), $logExpiry ) );
+ self::invalidateCache( $user );
+ }
+
+ private static function invalidateCache( $user ) {
+ $userObj = User::newFromName( $user, false );
+ $userObj->invalidateCache();
}
}