X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Uplink%2FP10_User.class.php;fp=Uplink%2FP10_User.class.php;h=4da7c43f29dbaa6d592aaf19d8155244048d5493;hp=752e8be6f856cc1ca0680447c5d948cb3b7b3d63;hb=7f51193ddac01b0540000c756c50167ff015e02a;hpb=811bc0c7a1f583fb624a0f8c3601146e063c5a25 diff --git a/Uplink/P10_User.class.php b/Uplink/P10_User.class.php index 752e8be..4da7c43 100644 --- a/Uplink/P10_User.class.php +++ b/Uplink/P10_User.class.php @@ -6,7 +6,7 @@ * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 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 * @@ -16,7 +16,7 @@ * along with this program. If not, see . * * * ************************************************************************ - * + * * Uplink/P10_User.class.php * * This class represents a IRC User @@ -25,14 +25,14 @@ class P10_User { private static $static_users = array(); - + public static function getUserByNum($numeric) { if(array_key_exists($numeric, self::$static_users)) { return self::$static_users[$numeric]; } return NULL; } - + public static function getUserByNick($nick) { $nick = strtolower($nick); foreach(self::$static_users as $user) { @@ -42,12 +42,12 @@ class P10_User { } return NULL; } - + public static function getAllUsers() { return self::$static_users; } - - + + private $numeric; private $server; private $nick; @@ -59,7 +59,7 @@ class P10_User { private $realname; private $channels = array(); private $away = null; - + public function __construct($nick, $numeric, $server, $connect_time, $ident, $host, $ip, $realname, $modes) { $this->nick = $nick; $this->numeric = $numeric; @@ -73,63 +73,63 @@ class P10_User { $server->addUser($this); self::$static_users[$numeric] = $this; } - + public function getNumeric() { return $this->numeric; } - + public function getServer() { return $this->server; } - + public function setNick($nick) { $this->nick = $nick; } - + public function getNick() { return $this->nick; } - + public function setIdent($ident) { $this->ident = $ident; } - + public function getIdent() { return $this->ident; } - + public function getHost() { return $this->host; } - + public function getIP() { return $this->ip; } - + public function getConnectTime() { return $this->connect_time; } - + public function getModes() { return $this->modes; } - + public function getRealname() { return $this->realname; } - + public function setAway($away) { $this->away = $away; } - + public function getAway() { return $this->away; } - + public function isAway() { return ($this->away != null); } - + public function quit($reason) { $this->server->delUser($this); unset(self::$static_users[$this->numeric]); @@ -137,11 +137,11 @@ class P10_User { $channel->quitUser($this); } } - + public function addChannel($channel) { $this->channels[strtolower($channel->getName())] = $channel; } - + public function delChannel($channel) { if(array_key_exists(strtolower($channel->getName()), $this->channels)) { unset($this->channels[strtolower($channel->getName())]); @@ -149,15 +149,15 @@ class P10_User { trigger_error("Tried to remove a Channel, that does NOT exist.", E_USER_WARNING); } } - + public function getChannels() { return $this->channels; } - + public function getChannelCount() { return count($this->channels); } - + public function isOnChannel($channel) { return array_key_exists(strtolower($channel->getName()),$this->channels); }