*/
protected static function getInProcessCache() {
if ( !self::$inProcessCache ) {
- self::$inProcessCache = new HashBagOStuff( ['maxKeys' => 10] );
+ self::$inProcessCache = new HashBagOStuff( [ 'maxKeys' => 10 ] );
}
return self::$inProcessCache;
}
throw new PasswordError( wfMessage( 'externaldberror' )->text() );
}
- $this->setToken();
$this->setOption( 'watchlisttoken', false );
$this->setPasswordInternal( $str );
+ SessionManager::singleton()->invalidateSessionsForUser( $this );
return true;
}
global $wgAuth;
if ( $wgAuth->allowSetLocalPassword() ) {
- $this->setToken();
$this->setOption( 'watchlisttoken', false );
$this->setPasswordInternal( $str );
+ SessionManager::singleton()->invalidateSessionsForUser( $this );
}
}
return !$this->isLoggedIn();
}
+ /**
+ * @return bool Whether this user is flagged as being a bot role account
+ * @since 1.28
+ */
+ public function isBot() {
+ $isBot = false;
+ if ( !Hooks::run( "UserIsBot", [ $this, &$isBot ] ) ) {
+ return $isBot;
+ }
+
+ return ( $isBot || in_array( 'bot', $this->getGroups() ) );
+ }
+
/**
* Check if user is allowed to access a feature / make an action
*