/** * Constructor. * @param uid User to initialize. * @public * @returns bool */ function RemoteUser($uid, $nodeinfo = null) { /* establish a database connection */ $this->dbh =& Planworld::_connect(); $this->type = 'planworld'; $this->username = $uid; list($this->localname, $this->host) = split('@', $this->username); if (isset($nodeinfo)) { $this->nodeinfo = $nodeinfo; } else { $this->nodeinfo = Planworld::getNodeInfo($host); } /* check if this user exists */ if (!$this->isUser()) { $this->valid = true; $this->userID = Planworld::addUser($this->username); } $this->load(); }
/** * Create this user */ function create() { /* create the user */ if (isset($this->username)) { $this->userID = Planworld::addUser($this->username); } /* set the valid flag */ $this->valid = true; }
function xmlrpc_addSnoopReference($method_name, $params) { $uid =& $params[0]; $sbid =& $params[1]; if (!($uid = Planworld::nameToID($uid))) { return false; } if (!($sbid_id = Planworld::nameToID($sbid))) { $sbid_id = Planworld::addUser($sbid); } Snoop::addReference($sbid_id, $uid); return true; }