Index: trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NMSendMailAsync.php |
— | — | @@ -26,19 +26,6 @@ |
27 | 27 | die( -1 ); |
28 | 28 | } |
29 | 29 | |
30 | | -// copy from user class |
31 | | -function getUserNMOption( $str ) { |
32 | | - $options = array(); |
33 | | - $a = explode( "\n", $str ); |
34 | | - foreach ( $a as $s ) { |
35 | | - $m = array(); |
36 | | - if ( preg_match( "/^(.[^=]*)=(.*)$/", $s, $m ) ) { |
37 | | - $options[$m[1]] = $m[2]; |
38 | | - } |
39 | | - } |
40 | | - return $options['enotifyme']; |
41 | | -} |
42 | | - |
43 | 30 | // include commandLine script which provides some basic |
44 | 31 | // methodes for maintenance scripts |
45 | 32 | $mediaWikiLocation = dirname( __FILE__ ) . '/../../../..'; |
— | — | @@ -50,9 +37,12 @@ |
51 | 38 | $msgs = $sStore->getUnmailedNMMessages(); |
52 | 39 | foreach ( $msgs as $msg ) { |
53 | 40 | // send notifications by mail |
54 | | - if ( $msg['user_id'] == null ) continue; |
| 41 | + if ( $msg['user_id'] == null ) { |
| 42 | + continue; |
| 43 | + } |
55 | 44 | $user_info = $sStore->getUserInfo( $msg['user_id'] ); |
56 | | - if ( ( $user_info->user_email != '' ) && getUserNMOption( $user_info->user_options ) ) { |
| 45 | + $user = User::newFromRow( $user_info ); |
| 46 | + if ( ( $user_info->user_email != '' ) && $user->getOption( 'enotifyme' ) ) { |
57 | 47 | $name = ( ( $user_info->user_real_name == '' ) ? $user_info->user_name:$user_info->user_real_name ); |
58 | 48 | |
59 | 49 | UserMailer::send( |
Index: trunk/extensions/SemanticNotifyMe/includes/SMW_NotifyProcessor.smw15.php |
— | — | @@ -1632,7 +1632,8 @@ |
1633 | 1633 | if ( $wgEnotifyMeJob ) { |
1634 | 1634 | // send notifications by mail |
1635 | 1635 | $user_info = $sStore->getUserInfo( $user_id ); |
1636 | | - if ( ( $user_info->user_email != '' ) && $this->getUserNMOption( $user_info->user_options ) ) { |
| 1636 | + $user = User::newFromRow( $user_info ); |
| 1637 | + if ( ( $user_info->user_email != '' ) && $user->getOption( 'enotifyme' ) ) { |
1637 | 1638 | $name = ( ( $user_info->user_real_name == '' ) ? $user_info->user_name:$user_info->user_real_name ); |
1638 | 1639 | |
1639 | 1640 | $params = array( 'to' => new MailAddress( $user_info->user_email, $name ), |
Index: trunk/extensions/SemanticNotifyMe/includes/SMW_NotifyProcessor.php |
— | — | @@ -1629,7 +1629,8 @@ |
1630 | 1630 | if ( $wgEnotifyMeJob ) { |
1631 | 1631 | // send notifications by mail |
1632 | 1632 | $user_info = $sStore->getUserInfo( $user_id ); |
1633 | | - if ( ( $user_info->user_email != '' ) && $this->getUserNMOption( $user_info->user_options ) ) { |
| 1633 | + $user = User::newFromRow( $user_info ); |
| 1634 | + if ( ( $user_info->user_email != '' ) && $user->getOption( 'enotifyme' ) ) { |
1634 | 1635 | $name = ( ( $user_info->user_real_name == '' ) ? $user_info->user_name:$user_info->user_real_name ); |
1635 | 1636 | |
1636 | 1637 | $params = array( 'to' => new MailAddress( $user_info->user_email, $name ), |
— | — | @@ -1682,16 +1683,4 @@ |
1683 | 1684 | } |
1684 | 1685 | } |
1685 | 1686 | } |
1686 | | - // copy from user class |
1687 | | - function getUserNMOption( $str ) { |
1688 | | - $options = array(); |
1689 | | - $a = explode( "\n", $str ); |
1690 | | - foreach ( $a as $s ) { |
1691 | | - $m = array(); |
1692 | | - if ( preg_match( "/^(.[^=]*)=(.*)$/", $s, $m ) ) { |
1693 | | - $options[$m[1]] = $m[2]; |
1694 | | - } |
1695 | | - } |
1696 | | - return $options['enotifyme']; |
1697 | | - } |
1698 | 1687 | } |
Index: trunk/extensions/SemanticNotifyMe/includes/storage/SMW_NMStorageSQL.php |
— | — | @@ -600,7 +600,7 @@ |
601 | 601 | wfProfileIn( $fname ); |
602 | 602 | |
603 | 603 | $db = wfGetDB( DB_SLAVE ); |
604 | | - $result = $db->selectRow( 'user', array( 'user_name', 'user_real_name', 'user_email', 'user_options' ), array( 'user_id' => $user_id ), $fname ); |
| 604 | + $result = $db->selectRow( 'user', array( 'user_name', 'user_real_name', 'user_email' ), array( 'user_id' => $user_id ), $fname ); |
605 | 605 | |
606 | 606 | wfProfileOut( $fname ); |
607 | 607 | return $result; |