added per user / per channel stats
[PHP-P10.git] / Uplink / P10_User.class.php
index af22f9d2a334f08e0f71e4ef512280272db05926..bcc17c2d7ede8169899e411854152c41486d2005 100644 (file)
@@ -55,8 +55,13 @@ class P10_User {
                return NULL;
        }
        
+       public static function getAllUsers() {
+               return self::$static_users;
+       }
+       
        
        private $numeric;
+       private $server;
        private $nick;
        private $ident;
        private $host;
@@ -65,6 +70,7 @@ class P10_User {
        private $modes;
        private $realname;
        private $channels;
+       private $away = null;
        
        public function __construct($nick, $numeric, $server, $connect_time, $ident, $host, $ip, $realname, $modes) {
                $this->nick = $nick;
@@ -84,6 +90,10 @@ class P10_User {
                return $this->numeric;
        }
        
+       public function getServer() {
+               return $this->server;
+       }
+       
        public function setNick($nick) {
                $this->nick = $nick;
        }
@@ -120,6 +130,18 @@ class P10_User {
                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);
                foreach($this->channels as $channel) {
@@ -138,6 +160,18 @@ 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);
+       }
 }
 
 ?>
\ No newline at end of file