/**
  * Add a local account record for the given wiki to the central database.
  * @param $wikiID String
  * @param $method String
  *
  * Prerequisites:
  * - completed migration state
  */
 public function attach($wikiID, $method = 'new')
 {
     $dbw = self::getCentralDB();
     $dbw->insert('localuser', array('lu_wiki' => $wikiID, 'lu_name' => $this->mName, 'lu_attached_timestamp' => $dbw->timestamp(), 'lu_attached_method' => $method), __METHOD__, array('IGNORE'));
     if ($dbw->affectedRows() == 0) {
         wfDebugLog('CentralAuth', "Race condition? Already attached {$this->mName}@{$wikiID}, just tried by '{$method}'");
         return;
     }
     wfDebugLog('CentralAuth', "Attaching local user {$this->mName}@{$wikiID} by '{$method}'");
     if ($wikiID == wfWikiID()) {
         $this->resetState();
     }
     $this->invalidateCache();
     global $wgCentralAuthUDPAddress, $wgCentralAuthNew2UDPPrefix;
     if ($wgCentralAuthUDPAddress) {
         $userpage = Title::makeTitleSafe(NS_USER, $this->mName);
         RecentChange::sendToUDP(self::getIRCLine($userpage, $wikiID), $wgCentralAuthUDPAddress, $wgCentralAuthNew2UDPPrefix);
     }
 }
Exemplo n.º 2
0
 static function sendToUDP($data)
 {
     global $wgAbuseFilterUDPPrefix, $wgAbuseFilterUDPAddress, $wgAbuseFilterUDPPort;
     RecentChange::sendToUDP($data, $wgAbuseFilterUDPAddress, $wgAbuseFilterUDPPrefix, $wgAbuseFilterUDPPort);
 }
Exemplo n.º 3
0
 /**
  * @param $status string
  * @param $oldStatus string
  */
 protected function sendStatusToUDP($status, $oldStatus)
 {
     global $wgCodeReviewUDPAddress, $wgCodeReviewUDPPort, $wgCodeReviewUDPPrefix, $wgUser;
     if ($wgCodeReviewUDPAddress) {
         $url = $this->getCanonicalUrl();
         $line = wfMsg('code-rev-status') . " 14(" . $this->repo->getName() . ")03 " . RecentChange::cleanupForIRC($wgUser->getName()) . " " . str_replace("'''", '', wfMsg('code-change-status', "7" . $this->getIdString() . "")) . ": 15" . wfMsg('code-status-' . $oldStatus) . " -> 10" . wfMsg('code-status-' . $status) . " " . $url;
         RecentChange::sendToUDP($line, $wgCodeReviewUDPAddress, $wgCodeReviewUDPPrefix, $wgCodeReviewUDPPort);
     }
 }