* @return bool success
*/
function doEdit( $text, $summary, $flags = 0 ) {
- global $wgUser, $wgDBtransactions;
+ global $wgUser, $wgDBtransactions, $wgRequest;
wfProfileIn( __METHOD__ );
$good = true;
# Silently ignore EDIT_MINOR if not allowed
$isminor = ( $flags & EDIT_MINOR ) && $wgUser->isAllowed('minoredit');
- $bot = $wgUser->isAllowed( 'bot' ) || ( $flags & EDIT_FORCE_BOT );
+ $bot = ( $wgUser->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot' , true ) : 0 ) || ( $flags & EDIT_FORCE_BOT );
$oldtext = $this->getContent();
$oldsize = strlen( $oldtext );
* @return self::SUCCESS on succes, self::* on failure
*/
public function doRollback( $fromP, $summary, $token, $bot, &$resultDetails ) {
- global $wgUser, $wgUseRCPatrol;
+ global $wgUser, $wgUseRCPatrol, $wgRequest;
$resultDetails = null;
# Just in case it's being called from elsewhere
if ($wgUser->isAllowed('minoredit'))
$flags |= EDIT_MINOR;
- if( $bot )
+ if( $bot && $wgRequest->getBool( 'bot' , true ) )
$flags |= EDIT_FORCE_BOT;
$this->doEdit( $target->getText(), $summary, $flags );
$newId = 0)
{
+ global $wgRequest;
+
if ( $bot === 'default' ) {
$bot = $user->isAllowed( 'bot' );
+ if ( $bot ) {
+ $bot = $wgRequest->getBool( 'bot' , true );
+ }
}
if ( !$ip ) {
public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = 'default',
$ip='', $size = 0, $newId = 0 )
{
+ global $wgRequest;
+
if ( !$ip ) {
$ip = wfGetIP();
if ( !$ip ) {
}
if ( $bot === 'default' ) {
$bot = $user->isAllowed( 'bot' );
+ if ( $bot ) {
+ $bot = $wgRequest->getBool( 'bot' , true );
+ }
}
$rc = new RecentChange;
# Makes an entry in the database corresponding to a rename
public static function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false )
{
+ global $wgRequest;
+
if ( !$ip ) {
$ip = wfGetIP();
if ( !$ip ) {
'rc_comment' => $comment,
'rc_this_oldid' => 0,
'rc_last_oldid' => 0,
- 'rc_bot' => $user->isAllowed( 'bot' ) ? 1 : 0,
+ 'rc_bot' => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot' , true ) : 0,
'rc_moved_to_ns' => $newTitle->getNamespace(),
'rc_moved_to_title' => $newTitle->getDBkey(),
'rc_ip' => $ip,
public static function notifyLog( $timestamp, &$title, &$user, $comment, $ip='',
$type, $action, $target, $logComment, $params )
{
+ global $wgRequest;
+
if ( !$ip ) {
$ip = wfGetIP();
if ( !$ip ) {
'rc_comment' => $comment,
'rc_this_oldid' => 0,
'rc_last_oldid' => 0,
- 'rc_bot' => $user->isAllowed( 'bot' ) ? 1 : 0,
+ 'rc_bot' => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot' , true ) : 0,
'rc_moved_to_ns' => 0,
'rc_moved_to_title' => '',
'rc_ip' => $ip,