Exemplo n.º 1
0
 public function go()
 {
     if (in_array($this->type, $this->commands)) {
         $func = $this->type;
         $content = $this->{$func}();
     } else {
         $content = "Cannot interpret that command";
     }
     // Passer ce publish parametre dans une list particuliere
     SMOBTemplate::header($this->publish, $this->reply_of, $this->type == 'map');
     print $content;
     SMOBTemplate::footer();
 }
Exemplo n.º 2
0
     die;
 }
 $remote_user = SMOBTools::remote_user($u);
 if (!$remote_user) {
     SMOBTemplate::header('');
     print "<a href='{$u}'>{$u}</a> is not a valid Hub, user cannot be added";
     SMOBTemplate::footer();
 } else {
     // @TODO: check that the user were not already a following?
     // Store the new relationship in local repository
     $local_user = SMOBTools::user_uri();
     $follow = "<{$local_user}> sioc:follows <{$remote_user}> . ";
     $local = "INSERT INTO <" . SMOB_ROOT . "data/followings> { {$follow} }";
     SMOBStore::query($local);
     error_log("DEBUG: Added following {$remote_user} with the query: {$local}", 0);
     SMOBTemplate::header('');
     // Subscribe to the hub
     // Get the Publisher (following) Hub
     $remote_user_feed = $remote_user . FEED_URL_PATH;
     $xml = simplexml_load_file($remote_user_feed);
     if (count($xml) == 0) {
         return;
     }
     $link_attributes = $xml->channel->link->attributes();
     if ($link_attributes['rel'] == 'hub') {
         $hub_url = $link_attributes['href'];
     }
     $callback_url = urlencode(SMOB_ROOT . "callback");
     $feed = urlencode($remote_user_feed);
     // Not using subscriber library as it does not allow async verify
     // Reusing do_curl function
Exemplo n.º 3
0
 public function go()
 {
     SMOBTemplate::header('');
     print $this->core();
     SMOBTemplate::footer();
 }