예제 #1
0
 static function authentificationDistante($keyconnexion)
 {
     foreach (\config\Conf::$numerorole as $k => $v) {
         if (is_array($v)) {
             foreach ($v as $kk => $vv) {
                 \config\Conf::$rolenumero[$vv] = $k;
             }
         } else {
             \config\Conf::$rolenumero[$v] = $k;
         }
     }
     if (!is_null($keyconnexion)) {
         $u = \core\Memcached::value($keyconnexion, "user");
         if (is_null($u)) {
             $u = \model\mysql\Utilisateur::authentifierUtilisateurParKeyConnexion($keyconnexion);
             if ($u) {
                 \core\Memcached::value($u->keyconnexion, "user", $u, 60 * 2);
             }
         } else {
             $u = $u->keyconnexion === $keyconnexion ? $u : false;
             if (is_bool($u)) {
                 $u = \model\mysql\Utilisateur::authentifierUtilisateurParKeyConnexion($keyconnexion);
                 if ($u) {
                     \core\Memcached::value($u->keyconnexion, "user", $u, 60 * 2);
                 }
             } else {
                 \core\Memcached::value($u->keyconnexion, "user", $u, 60 * 2);
             }
         }
         \config\Conf::$user["user"] = $u;
     }
     $role = 1;
     $roletext = "Visiteur";
     if ($u && !is_null($u)) {
         $role = \config\Conf::$rolenumero[$u->role];
         $roletext = $u->role;
         \core\Memcached::value($u->keyconnexion, "user", $u, 60 * 5);
         setcookie("keyconnexion", $u->keyconnexion, strtotime('+1 days'), "/");
     }
     if (is_null(\config\Conf::$user["user"])) {
         \config\Conf::$user["user"] = $u;
     }
     \config\Conf::$user["role"] = $role;
     \config\Conf::$user["roletxt"] = $roletext;
     if ($u) {
         \core\LoaderJavascript::add("base", "controller.setUtilisateur", array(\config\Conf::$user["user"]->login, \config\Conf::$user["user"]->keyconnexion, \config\Conf::$user["user"]->role));
     }
 }
예제 #2
0
<?php

/**
 * Created by PhpStorm.
 * User: salorium
 * Date: 19/03/14
 * Time: 20:25
 */
\core\LoaderJavascript::add("accueil", "controller.init");
?>
<ul class="carrousel show-for-medium-up">

    <li><a href="<?php 
echo \core\Router::url("torrent/all");
?>
"><img title="Torrent" src="images/torrent.svg"/>
        </a></li>

    <li><a href="<?php 
echo \core\Router::url("film/nouveau");
?>
"> <img title="Film" src="images/film.svg"/>
        </a></li>
    <li><a href="<?php 
echo \core\Router::url("serie/nouveau");
?>
"> <img title="Série" src="images/serie.svg"/>
        </a></li>
    <li><a href="#DDD"> <img title="Musique" src="images/musique.svg"/>
        </a></li>
</ul>
예제 #3
0
<?php

/**
 * Created by PhpStorm.
 * User: salorium
 * Date: 22/03/14
 * Time: 03:36
 */
\core\LoaderJavascript::add("base", "controller.setHost", array($_SERVER["HTTP_HOST"] . dirname(dirname($_SERVER["SCRIPT_NAME"])) . ($_SERVER["SCRIPT_NAME"] !== "/index.php" ? "/" : ""), $_SERVER["SERVER_PORT"] == 443));
?>
<div class="container">
    <script src="<?php 
echo BASE_URL;
?>
javascripts/mediastorrent/film.js"></script>
    <script>
        // Execution de cette fonction lorsque le DOM sera entièrement chargé
        $(document).ready(function () {
            Film.init(<?php 
echo json_encode($film);
?>
);
        });
    </script>
</div>
예제 #4
0
 function roleUser()
 {
     foreach (Conf::$numerorole as $k => $v) {
         if (is_array($v)) {
             foreach ($v as $kk => $vv) {
                 Conf::$rolenumero[$vv] = $k;
             }
         } else {
             Conf::$rolenumero[$v] = $k;
         }
     }
     /*$a["zzz"]="sssd";
       $a["zdz"]= new \model\xmlrpc\rTorrent();
       //Memcached::value("deb","ddd",$a);
       Memcached::value("deb","ddd");
       Memcached::value("deb1","ddd");*/
     $u = null;
     if (isset($_COOKIE["keyconnexion"])) {
         if (extension_loaded("memcached")) {
             $u = Memcached::value($_COOKIE["keyconnexion"], "user");
         }
         if (is_null($u)) {
             $u = \model\mysql\Utilisateur::authentifierUtilisateurParKeyConnexion($_COOKIE["keyconnexion"]);
             if ($u) {
                 \core\Memcached::value($_COOKIE["keyconnexion"], "user", $u, 60 * 5);
             }
         } else {
             $u = $u->keyconnexion === $_COOKIE["keyconnexion"] ? $u : false;
         }
     }
     $role = 1;
     $roletext = "Visiteur";
     if ($u && !is_null($u)) {
         $role = Conf::$rolenumero[$u->role];
         $roletext = $u->role;
         \core\Memcached::value($_COOKIE["keyconnexion"], "user", $u, 60 * 5);
         setcookie("keyconnexion", $u->keyconnexion, strtotime('+1 days'), "/");
     }
     Conf::$user["user"] = $u;
     Conf::$user["role"] = $role;
     Conf::$user["roletxt"] = $roletext;
     if ($u) {
         LoaderJavascript::add("base", "controller.setUtilisateur", array(Conf::$user["user"]->login, Conf::$user["user"]->keyconnexion, Conf::$user["user"]->role));
     }
 }
예제 #5
0
<?php

/**
 * Created by PhpStorm.
 * User: salorium
 * Date: 15/03/14
 * Time: 17:50
 */
\core\LoaderJavascript::add("base", "controller.redirection", $url);
?>
<div data-alert class="alert-box warning radius connexion">
    Erreur ticket, (Ticket introuvable)
    <a href="#" class="close">&times;</a>
</div>

예제 #6
0
<?php
/**
 * Created by PhpStorm.
 * User: salorium
 * Date: 26/04/14
 * Time: 13:49
 */
\core\LoaderJavascript::add("base", "controller.setHost", array($_SERVER["HTTP_HOST"] . dirname(dirname($_SERVER["SCRIPT_NAME"])) . ($_SERVER["SCRIPT_NAME"] !== "/index.php" ? "/" : ""), false));
\core\LoaderJavascript::add("install");
?>
    <!--
<form id="root">

    <table>
        <td>Password du root:</td>
        <td><input type="password" name="password"></td>
    </table>
</form>
<table>
    <tr>
        <td>Memcached</td>
        <td><a <?= (!$memcached ? 'onclick="Install.controller.enableModule(this);"' : '') ?>
                data-module="memcached"><?= ($memcached ? \model\simple\String::styleSuccess("Ok") : \model\simple\String::styleError("Non ok")); ?></a>
        </td>
    </tr>
    <tr>
        <td>Mysqli</td>
        <td><a <?= (!$mysqli ? 'onclick="Install.controller.enableModule(this);"' : '') ?>
                data-module="mysqli"><?= ($mysqli ? \model\simple\String::styleSuccess("Ok") : \model\simple\String::styleError("Non ok")); ?></a>
        </td>
    </tr>
예제 #7
0
<?php

/**
 * Created by PhpStorm.
 * User: salorium
 * Date: 06/05/14
 * Time: 18:21
 */
\core\LoaderJavascript::add("base", "controller.fixeHeightContainer");
\core\LoaderJavascript::add("base", "controller.setHost", array(substr($_SERVER["HTTP_HOST"] . dirname(dirname($_SERVER["SCRIPT_NAME"])) . ($_SERVER["SCRIPT_NAME"] !== "/index.php" ? "/" : ""), 0, -1), $_SERVER["SERVER_PORT"] == 443));
\core\LoaderJavascript::add("sysoputilisateur", "controller.init");
\core\LoaderJavascript::add("sysoputilisateur", "controller.setRole", array_slice(\config\Conf::$numerorole, 2));
?>
<div class="container">
<nav class="top-bar" data-topbar>
    <!-- Title -->
    <ul class="title-area">
        <li class="name"></li>

        <!-- Mobile Menu Toggle -->
        <li class="toggle-topbar menu-icon"><a href="#">Menu</a></li>
    </ul>

    <!-- Top Bar Section -->
    <!--</a><a href="#ADD"><img width="40px"  title="Démarrer un Torrent" src="images/play.svg"/></a><a href="#ADD"><img width="40px"  title="Mettre en pause un Torrent" src="images/pause.svg"/></a><a href="#ADD"><img width="40px"  title="Arrêter un Torrent" src="images/stop.svg"/></a>-->
    <section class="top-bar-section">
        <!--<img src="images/disk.svg" title="Disque dur">
        <!-- Top Bar Left Nav Elements -->
        <ul class="left">
            <li class="divider"></li>
            <li><a onclick="Sysoputilisateur.view.ajouteUtilisateur();">Ajouter un utilisateur</a>
예제 #8
0
<?php
/**
 * Created by PhpStorm.
 * User: salorium
 * Date: 06/05/14
 * Time: 18:02
 */
if ($del) {
    \core\LoaderJavascript::add("base", "controller.redirection", \core\Router::url(""));
    ?>
    <div class="container">
        <div data-alert class="alert-box success radius connexion">
            Les serveur à bien été supprimé de la liste des serveurs rtorrent.
            <a href="#" class="close">&times;</a>
        </div>
    </div>
<?
} else {
    ?>
    <div class="container">
        <div data-alert class="alert-box alert radius connexion">
            Erreur lors de la suppression du serveur de seebox
            <a href="#" class="close">&times;</a>
        </div>
    </div>
<?
}
?>