Updater script for pagelinks table.
[lhc/web/wiklou.git] / includes / UserTalkUpdate.php
index b2ddc7f..7c61406 100644 (file)
@@ -1,42 +1,51 @@
 <?php
 /** Copyright (C) 2004 Thomas Gries <mail@tgries.de>
-# http://www.mediawiki.org/
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-# http://www.gnu.org/copyleft/gpl.html
-**/
-
-/**
- * See deferred.doc
+ * http://www.mediawiki.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ * 
+ * See deferred.txt
  *
  * @package MediaWiki
+ * @author <mail@tgries.de>
  */
 
 /**
  *
  * @package MediaWiki
  */
-
 class UserTalkUpdate {
 
-       /* private */ var $mAction, $mNamespace, $mTitle, $mSummary, $mMinorEdit, $mTimestamp;
+       /**#@+
+        * @access private
+        */
+       var $mAction, $mNamespace, $mTitle, $mSummary, $mMinorEdit, $mTimestamp;
+       /**#@-*/
 
+       /**
+        * @todo document
+        * @param string $action
+        * @param integer $ns
+        * @param $title
+        * @param $summary
+        * @param $minoredit
+        * @param $timestamp
+        */
        function UserTalkUpdate( $action, $ns, $title, $summary, $minoredit, $timestamp) {
-               global $wgUser, $wgLang, $wgMemc, $wgDBname, $wgEnotif;
-               global $wgEmailNotificationForUserTalkPages, $wgEmailNotificationSystembeep;
-               global $wgEmailAuthentication;
+               global $wgUser, $wgLang, $wgMemc, $wgDBname;
                $fname = 'UserTalkUpdate::UserTalkUpdate';
 
                $this->mAction = $action;
@@ -47,7 +56,7 @@ class UserTalkUpdate {
                $this->mTimestamp = $timestamp;
 
                # If namespace isn't User_talk:, do nothing.
-               if ( $this->mNamespace != Namespace::getTalk(Namespace::getUser() ) ) {
+               if ( $this->mNamespace != NS_USER_TALK ) {
                        return;
                }
 
@@ -62,6 +71,7 @@ class UserTalkUpdate {
                        if ( 1 == $this->mAction ) {
                                $user = new User();
                                $user->setID(User::idFromName($this->mTitle));
+
                                if ($id=$user->getID()) {
                                        $sql = true;
                                        $wgMemc->delete( "$wgDBname:user:id:$id" );
@@ -92,10 +102,10 @@ class UserTalkUpdate {
                                        $dbw =& wfGetDB( DB_MASTER );
                                        $dbw->replace( 'watchlist',
                                                array(array('wl_user','wl_namespace', 'wl_title', 'wl_notificationtimestamp')),
-                                                 array('wl_user'                       => $id,
-                                                       'wl_namespace'                  => NS_USER_TALK,
-                                                       'wl_title'                      => $this->mTitle,
-                                                       'wl_notificationtimestamp'      => 1
+                                                 array('wl_user' => $id,
+                                                       'wl_namespace' => NS_USER_TALK,
+                                                       'wl_title' => $this->mTitle,
+                                                       'wl_notificationtimestamp' => 1
                                                        ), 'UserTalkUpdate'
                                                );
                                }