Global group and other extensions can hook into the hook
to flag global bots and the like.
Change-Id: I1290932fccb62508d2a8b7f94f056badadf6fdfc
user's language. If such access is attempted, an exception will be thrown.
=== New features in 1.28 ===
+* User::isBot() method for checking if an account is a bot role account.
+* Added a new hook, 'UserIsBot', to aid in determining if a user is a bot.
=== External library changes in 1.28 ===
representing the problem with the file, where the first element is the message
key and the remaining elements are used as parameters to the message.
+'UserIsBot': when determining whether a user is a bot account
+$user: the user
+&$isBot: whether this is user a bot or not (boolean)
+
'User::mailPasswordInternal': before creation and mailing of a user's new
temporary password
&$user: the user who sent the message out
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
*