if( $wgUseEnotif ) {
# this would be better as an extension hook
global $wgUser;
- include_once( "UserMailer.php" );
- $enotif = new EmailNotification();
+ $enotif = new EmailNotification;
$title = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
$enotif->notifyOnPageChange( $wgUser, $title,
$this->mAttribs['rc_timestamp'],
'rc_patrolled' => 1
),
array(
- 'rc_id' => $change
+ 'rc_id' => $rcid
),
__METHOD__
);
}
# Makes an entry in the database corresponding to an edit
- /*static*/ function notifyEdit( $timestamp, &$title, $minor, &$user, $comment,
- $oldId, $lastTimestamp, $bot = "default", $ip = '', $oldSize = 0, $newSize = 0,
+ public static function notifyEdit( $timestamp, &$title, $minor, &$user, $comment,
+ $oldId, $lastTimestamp, $bot, $ip = '', $oldSize = 0, $newSize = 0,
$newId = 0)
{
-
- if ( $bot === 'default' ) {
- $bot = $user->isAllowed( 'bot' );
- }
-
if ( !$ip ) {
$ip = wfGetIP();
if ( !$ip ) {
* Note: the title object must be loaded with the new id using resetArticleID()
* @todo Document parameters and return
*/
- public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = 'default',
+ public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot,
$ip='', $size = 0, $newId = 0 )
{
if ( !$ip ) {
$ip = '';
}
}
- if ( $bot === 'default' ) {
- $bot = $user->isAllowed( 'bot' );
- }
$rc = new RecentChange;
$rc->mAttribs = array(
}
# Makes an entry in the database corresponding to a rename
- /*static*/ function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false )
+ 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,
$rc->save();
}
- /* static */ function notifyMoveToNew( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
+ public static function notifyMoveToNew( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, false );
}
- /* static */ function notifyMoveOverRedirect( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
+ public static function notifyMoveOverRedirect( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, true );
}
# A log entry is different to an edit in that previous revisions are
# not kept
- /*static*/ function notifyLog( $timestamp, &$title, &$user, $comment, $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,
}
}
+