Ejemplo n.º 1
0
 static function getAllRtorrentUtilisateur($login)
 {
     $query = "select nomrtorrent ";
     $query .= "from rtorrents ";
     $query .= "where ";
     $query .= "login =" . \core\Mysqli::real_escape_string_html($login);
     \core\Mysqli::query($query);
     return \core\Mysqli::getObjectAndClose(true);
 }
Ejemplo n.º 2
0
 public static function isRtorrentServeur()
 {
     $query = "select count(*) as nb from rtorrent";
     $query .= " where hostname=" . \core\Mysqli::real_escape_string_html(HOST);
     \core\Mysqli::query($query);
     $objet = \core\Mysqli::getObjectAndClose();
     return $objet->nb == 1;
     //die();
 }
Ejemplo n.º 3
0
 public static function traiteTicket($id)
 {
     $query = "select id, donnee, UNIX_TIMESTAMP(expire) as expire from ticket ";
     $query .= " where id=" . \core\Mysqli::real_escape_string_html($id);
     \core\Mysqli::query($query);
     $ticket = \core\Mysqli::getObjectAndClose(false, __CLASS__);
     if ($ticket != null) {
         if ($ticket->expire <= time()) {
             $ticket->delete();
             $ticket = null;
         }
     }
     return $ticket;
 }
Ejemplo n.º 4
0
 public static function getAllGenre()
 {
     $query = "select distinct g.label as label ";
     $query .= "from torrentfilm tf, film f, genrefilm g ";
     $query .= "where ( ";
     $query .= "tf.idfilm = f.id ";
     $query .= "and g.id = f.id ";
     $query .= "and tf.login = "******"user"]->login);
     //$query .= " and rs.nomrtorrent = r.nom ";
     $query .= " ) or ( ";
     //$query .= "tf.fini = true ";
     $query .= "tf.partageamis = true ";
     $query .= "and tf.idfilm = f.id ";
     $query .= "and g.id = f.id ";
     //$query .= "and rs.nomrtorrent = r.nom ";
     $query .= "and tf.login in (select login from amis a1 where a1.demandeur = " . \core\Mysqli::real_escape_string_html(\config\Conf::$user["user"]->login) . " and a1.ok = true union select demandeur from amis a2 where a2.login = "******"user"]->login) . " and a2.ok = true)";
     $query .= ") ORDER BY label ASC";
     \core\Mysqli::query($query);
     return \core\Mysqli::getObjectAndClose(true);
 }
Ejemplo n.º 5
0
 public static function estFini($id)
 {
     $query = "select count(*) as nb from cronroot ";
     $query .= " where fini=" . \core\Mysqli::real_escape_string_html(true) . " and encour=" . \core\Mysqli::real_escape_string_html(true) . " and id=" . \core\Mysqli::real_escape_string_html($id);
     \core\Mysqli::query($query);
     $res = \core\Mysqli::getObjectAndClose();
     if (!is_bool($res)) {
         return $res->nb == 1;
     }
     return false;
 }
Ejemplo n.º 6
0
 public static function supprimeUtilisateur($login)
 {
     $query = "delete from utilisateur ";
     $query .= " where login=" . \core\Mysqli::real_escape_string_html($login);
     \core\Mysqli::query($query);
     $res = \core\Mysqli::nombreDeLigneAffecte() == 1;
     \core\Mysqli::close();
     return $res;
 }
Ejemplo n.º 7
0
 public static function getUtilisteur($login)
 {
     $query = "select * from utilisateur";
     $query .= " where login=" . \core\Mysqli::real_escape_string_html($login);
     \core\Mysqli::query($query);
     return \core\Mysqli::getObjectAndClose(false, __CLASS__);
 }
Ejemplo n.º 8
0
 static function getAllFilmUserTitreAsc($genre)
 {
     $query = "select distinct * from ( select f.titre as titre, f.id as id, f.urlposter as poster, f.urlbackdrop as backdrop , f.infos as infos ";
     $query .= "from torrentfilm tf, film f , genrefilm g ";
     $query .= "where ( ";
     $query .= "tf.idfilm = f.id ";
     $query .= "and f.id = g.id ";
     if (!is_null($genre)) {
         $query .= "and g.label = " . \core\Mysqli::real_escape_string_html($genre);
     }
     //$query .= "and r.nom = tf.nomrtorrent ";
     $query .= " and tf.login = "******"user"]->login);
     //$query .= " and rs.nomrtorrent = r.nom ";
     $query .= " ) or ( ";
     //$query .= "tf.fini = true ";
     $query .= "tf.partageamis = true ";
     $query .= "and tf.idfilm = f.id ";
     $query .= "and f.id = g.id ";
     if (!is_null($genre)) {
         $query .= "and g.label = " . \core\Mysqli::real_escape_string_html($genre);
     }
     //$query .= "and r.nom = tf.nomrtorrent ";
     //$query .= "and rs.nomrtorrent = r.nom ";
     $query .= " and tf.login in (select login from amis a1 where a1.demandeur = " . \core\Mysqli::real_escape_string_html(\config\Conf::$user["user"]->login) . " and a1.ok = true union select demandeur from amis a2 where a2.login = "******"user"]->login) . " and a2.ok = true)";
     $query .= ") ) t ORDER BY titre ASC";
     \core\Mysqli::query($query);
     return \core\Mysqli::getObjectAndClose(true);
 }
Ejemplo n.º 9
0
 public function updateMediainfo($mediainfo)
 {
     $this->mediainfo = json_encode($mediainfo);
     $query = "update torrentserie set ";
     $query .= "mediainfo=" . \core\Mysqli::real_escape_string_html($this->mediainfo);
     $query .= " where id=" . \core\Mysqli::real_escape_string_html($this->id);
     \core\Mysqli::query($query);
     //echo $query;
     $res = \core\Mysqli::nombreDeLigneAffecte() == 1;
     \core\Mysqli::close();
     return $res;
 }
Ejemplo n.º 10
0
 function mysql($v)
 {
     var_dump(\core\Mysqli::real_escape_string_html($v));
 }