Пример #1
0
 function details($hashtorrentselectionne, $keyconnexion = null)
 {
     \model\simple\Utilisateur::authentificationPourRtorrent($keyconnexion);
     if (!\config\Conf::$user["user"]) {
         throw new \Exception("Non User");
     }
     $cmds = array("f.path=", "f.completed_chunks=", "f.size_chunks=", "f.size_bytes=", "f.priority=", "f.prioritize_first=", "f.prioritize_last=");
     $cmd = new \model\xmlrpc\rXMLRPCCommand(\config\Conf::$userscgi, "f.multicall", array($hashtorrentselectionne, ""));
     foreach ($cmds as $prm) {
         $cmd->addParameter(\model\xmlrpc\rTorrentSettings::getCmd(\config\Conf::$userscgi, $prm));
     }
     $req = new \model\xmlrpc\rXMLRPCRequest(\config\Conf::$userscgi, $cmd);
     $files = null;
     $to = null;
     if (!$req->success()) {
         trigger_error("Impossible de récupéré la liste des fichiers de " . $hashtorrentselectionne);
         $files = $req->val;
     } else {
         $taille = count($req->val);
         $j = 0;
         for ($i = 0; $i < $taille; $i += 7) {
             $files[] = array($j, $req->val[$i], $req->val[$i + 1], $req->val[$i + 2], $req->val[$i + 3], $req->val[$i + 4], $req->val[$i + 5], $req->val[$i + 6]);
             $j++;
         }
         $to["files"] = $files;
     }
     $cmds = array("t.url=", "t.type=", "t.is_enabled=", "t.group=", "t.scrape_complete=", "t.scrape_incomplete=", "t.scrape_downloaded=", "t.normal_interval=", "t.scrape_time_last=");
     $cmd = new \model\xmlrpc\rXMLRPCCommand(\config\Conf::$userscgi, "t.multicall", array($hashtorrentselectionne, ""));
     foreach ($cmds as $prm) {
         $cmd->addParameter(\model\xmlrpc\rTorrentSettings::getCmd(\config\Conf::$userscgi, $prm));
     }
     $req = new \model\xmlrpc\rXMLRPCRequest(\config\Conf::$userscgi, $cmd);
     $trackers = null;
     if (!$req->success()) {
         trigger_error("Impossible de récupéré la liste des trakers de " . $hashtorrentselectionne);
         $traker = $req->val;
     } else {
         $taille = count($req->val);
         $j = 0;
         for ($i = 0; $i < $taille; $i += 9) {
             $trackers[] = array($j, $req->val[$i], $req->val[$i + 1], $req->val[$i + 2], $req->val[$i + 3], $req->val[$i + 4], $req->val[$i + 5], $req->val[$i + 6], $req->val[$i + 7], $req->val[$i + 8]);
             $j++;
         }
         $to["trackers"] = $trackers;
     }
     $this->set(array("torrentselectionnee" => $to, "host" => HOST, "hashtorrent" => $hashtorrentselectionne, "seedbox" => \model\mysql\Rtorrent::getRtorrentsDeUtilisateur(\config\Conf::$user["user"]->login)));
 }
Пример #2
0
 public function getEventCommand($cmd1, $cmd2, $args)
 {
     if ($this->iVersion < 0x804) {
         $cmd = new rXMLRPCCommand($this->user, $cmd1);
     } else {
         //		if($this->mostOfMethodsRenamed)
         //			$cmd = new rXMLRPCCommand('method.set_key','event.download.'.$cmd2);
         //		else
         $cmd = new rXMLRPCCommand($this->user, 'system.method.set_key', 'event.download.' . $cmd2);
     }
     $cmd->addParameters($args);
     return $cmd;
 }