function trackerUptorrent($user) { \core\Mysqli::$default = "gazelle"; $u = Utilisateur::getUtilisteur($user); if ($u) { \config\Conf::$torrentpass = $u->torrentpass; if (isset($_FILES["torrent"])) { if ($_FILES["torrent"]["error"] > 0) { } else { $torrent = new Torrent(file_get_contents($_FILES["torrent"]["tmp_name"])); if (!$torrent->errors()) { $torrent->is_private(true); $torrent->announce(""); $hash = pack("H*", $torrent->hash_info()); $a = \model\mysql\Torrents::insertTorrent($hash, $torrent->__toString()); if (!is_bool($a)) { $az = \model\ocelot\Requete::addTorrent($a, $hash, "0"); } } } } } else { throw new \Exception("Pas d'utilisateur"); } }