예제 #1
0
 public function run()
 {
     if ($this->eventType == ReceivedLineTypes::SERVERREPLYTHREEONEONE) {
         $workingLine = explode(" ", $this->runMessage, 8);
         $nick = $workingLine[3];
         $ident = $workingLine[4];
         $host = $workingLine[5];
         $realName = str_replace(":", "", $workingLine[7]);
         $realName = trim($realName);
         $user = new User();
         $user->nickname = $nick;
         $user->ident = $ident;
         $user->host = $host;
         $user->realName = $realName;
         UserManager::store($nick, $user);
     } else {
         if ($this->eventType == ReceivedLineTypes::SERVERREPLYTHREETHREEZERO || $this->eventType == ReceivedLineTypes::SERVERREPLYTHREEZEROSEVEN) {
             $workingLine = explode(" ", $this->runMessage);
             $nick = $workingLine[3];
             $user = UserManager::get($nick);
             $user->isIdentified = true;
             UserManager::store($nick, $user);
             if (Config::$users[$nick]) {
                 $permissionLevel = Config::$users[$nick];
             } else {
                 $permissionLevel = 0;
             }
             $server = Server::getInstance();
             $server->notify($nick, "You have been successfully authorized via NickServ with the permission level " . $permissionLevel);
         }
     }
 }
예제 #2
0
 public function run()
 {
     $line = new ReceivedLine($this->runMessage);
     $line->parse();
     $user = UserManager::get($this->senderNick);
     $user->nickname = $line->senderNick;
     $user->ident = $line->senderIdent;
     $user->host = $line->senderHost;
     UserManager::store($this->senderNick, $user);
 }
예제 #3
0
파일: JoinParser.php 프로젝트: numb95/pmg
 public function run()
 {
     $channel = ChannelManager::get($this->channel);
     $channel->addConnectedNick($this->senderNick);
     ChannelManager::store($this->channel, $channel);
     $line = new ReceivedLine($this->runMessage);
     $line->parse();
     $user = UserManager::get($this->senderNick);
     $user->nickname = $line->senderNick;
     $user->ident = $line->senderIdent;
     $user->host = $line->senderHost;
     UserManager::store($this->senderNick, $user);
 }
예제 #4
0
 public function run()
 {
     // Channel
     $workingLine = explode(" ", $this->runMessage);
     $channel = $workingLine[4];
     // Names
     $workingLine = explode(" :", $this->runMessage);
     $names = trim($workingLine[1]);
     $names = explode(" ", $names);
     // Fetch the channel object
     $channelObject = ChannelManager::get($channel);
     // Loop through the names adding them to the channel and UserManager
     foreach ($names as $name) {
         $privileges = false;
         if (strpos($name, "~") === 0) {
             $privileges = "~";
         }
         if (strpos($name, "&") === 0) {
             $privileges = "&";
         }
         if (strpos($name, "@") === 0) {
             $privileges = "@";
         }
         if (strpos($name, "%") === 0) {
             $privileges = "%";
         }
         if (strpos($name, "+") === 0) {
             $privileges = "+";
         }
         $nick = str_replace(array("~", "@", "&", "%", "+"), "", $name);
         $channelObject->addConnectedNick($nick, $privileges);
         $user = UserManager::get($nick);
         $user->nickname = $nick;
         UserManager::store($nick, $user);
     }
     // Store away the channel object
     ChannelManager::store($channel, $channelObject);
 }
 public function run()
 {
     $workingLine = explode(" ", $this->runMessage, 4);
     $message = $workingLine[3];
     // Chan, ident, host, server, nick
     $workingLine = explode(" ", $message);
     //$channel = $workingLine[0];
     $ident = $workingLine[1];
     $host = $workingLine[2];
     //$server = $workingLine[3];
     $nickname = $workingLine[4];
     // Real name
     $workingLine = explode(":", $message);
     $hopsAndRealName = trim($workingLine[1]);
     $workingHopsAndRealName = explode(" ", $hopsAndRealName, 2);
     $realName = $workingHopsAndRealName[1];
     // Fetch and update the user object
     $u = UserManager::get($nickname);
     $u->nickname = $nickname;
     $u->ident = $ident;
     $u->host = $host;
     $u->realName = $realName;
     UserManager::store($nickname, $u);
 }