示例#1
0
 /**
  * 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();
 }
示例#2
0
文件: User.php 项目: jlodom/planworld
 /**
  * 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;
 }
示例#3
0
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;
}