MediaWiki  REL1_20
EnotifNotifyJob.php
Go to the documentation of this file.
00001 <?php
00029 class EnotifNotifyJob extends Job {
00030 
00031         function __construct( $title, $params, $id = 0 ) {
00032                 parent::__construct( 'enotifNotify', $title, $params, $id );
00033         }
00034 
00035         function run() {
00036                 $enotif = new EmailNotification();
00037                 // Get the user from ID (rename safe). Anons are 0, so defer to name.
00038                 if( isset( $this->params['editorID'] ) && $this->params['editorID'] ) {
00039                         $editor = User::newFromId( $this->params['editorID'] );
00040                 // B/C, only the name might be given.
00041                 } else {
00042                         # FIXME: newFromName could return false on a badly configured wiki.
00043                         $editor = User::newFromName( $this->params['editor'], false );
00044                 }
00045                 $enotif->actuallyNotifyOnPageChange(
00046                         $editor,
00047                         $this->title,
00048                         $this->params['timestamp'],
00049                         $this->params['summary'],
00050                         $this->params['minorEdit'],
00051                         $this->params['oldid'],
00052                         $this->params['watchers']
00053                 );
00054                 return true;
00055         }
00056 
00057 }