Пример #1
0
 /**
  * Clear this user's plan.
  * @returns void
  */
 function clearPlan()
 {
     $refs = Snoop::_getReferences($this->getPlan($this));
     /* delete one's plan */
     $this->dbh->query("DELETE FROM plans WHERE uid=" . $this->userID);
     /* update the last update time */
     $this->dbh->query("UPDATE users SET last_update=" . mktime() . " WHERE id=" . $this->userID);
     /* clear snoop references */
     Snoop::clearReferences($this->userID);
     $hosts = array();
     foreach ($refs[1] as $r) {
         if (!strstr($r, '@')) {
             continue;
         }
         list($user, $host) = split('@', $r);
         if (!in_array($host, $hosts)) {
             $hosts[] = $host;
             Snoop::clearRemoteReferences(Planworld::getNodeInfo($host), $this->username);
         }
     }
 }
Пример #2
0
function xmlrpc_clearSnoop($method_name, $params)
{
    $uid =& $params[0];
    echo $uid;
    Snoop::clearReferences(Planworld::nameToID($uid));
    return true;
}