X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=blobdiff_plain;f=includes%2Fuser%2FUser.php;h=b1c270fd294dd9f072d05181e3d95b4f7638369b;hb=279dd4156c6195be16fe497980d73cd2e5c95884;hp=ee617a2caf9bc31c3ad2fe50f9f8c0aaba18db4f;hpb=d9074551a52466194c02de799dec21b45bbc5732;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/User.php b/includes/user/User.php index ee617a2caf..b1c270fd29 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -127,6 +127,7 @@ class User implements IDBAccessObject { 'createpage', 'createtalk', 'delete', + 'deletechangetags', 'deletedhistory', 'deletedtext', 'deletelogentry', @@ -2489,9 +2490,9 @@ class User implements IDBAccessObject { throw new PasswordError( wfMessage( 'externaldberror' )->text() ); } - $this->setToken(); $this->setOption( 'watchlisttoken', false ); $this->setPasswordInternal( $str ); + SessionManager::singleton()->invalidateSessionsForUser( $this ); return true; } @@ -2508,9 +2509,9 @@ class User implements IDBAccessObject { global $wgAuth; if ( $wgAuth->allowSetLocalPassword() ) { - $this->setToken(); $this->setOption( 'watchlisttoken', false ); $this->setPasswordInternal( $str ); + SessionManager::singleton()->invalidateSessionsForUser( $this ); } } @@ -3398,6 +3399,19 @@ class User implements IDBAccessObject { 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 *