* Make enotif job use user ID rather than name for users. Fallback to name for anons...
[lhc/web/wiklou.git] / includes / EnotifNotifyJob.php
1 <?php
2
3 /**
4 * Job for email notification mails
5 */
6 class EnotifNotifyJob extends Job {
7
8 function __construct( $title, $params, $id = 0 ) {
9 parent::__construct( 'enotifNotify', $title, $params, $id );
10 }
11
12 function run() {
13 $enotif = new EmailNotification();
14 // Get the user from ID (rename safe). Anons are 0, so defer to name.
15 if( isset($this->params['editorID']) && $this->params['editorID'] ) {
16 $editor = User::newFromId( $this->params['editorID'] );
17 // B/C, only the name might be given.
18 } else {
19 $editor = User::newFromName( $this->params['editor'], false );
20 }
21 $enotif->actuallyNotifyOnPageChange(
22 $editor,
23 $this->title,
24 $this->params['timestamp'],
25 $this->params['summary'],
26 $this->params['minorEdit'],
27 $this->params['oldid']
28 );
29 return true;
30 }
31
32 }