Exemple #1
0
    return;
}
// end page get
$root = clearRoot(glob(PATH_TO_DISPLAY . '*/'), $dirs_to_ignore);
foreach ($root as &$path) {
    $structure = array();
    $structure['name'] = $path;
    $structure['url'] = PATH_TO_DISPLAY . $path;
    $structure['img'] = getPreview($path);
    $path = $structure;
}
// main code vhost
$vhost_include_not_define = true;
if (($apache_conf = glob(WAMP_PATH . 'bin/apache/apache*/conf/httpd.conf')) > 0 || $custom_vhost_path_config) {
    $apache_conf = realpath(isset($apache_conf[0]) ? $apache_conf[0] : null);
    if ($vhostIsEnable = vhostIsEnable($apache_conf) ||  isset($custom_vhost_path_config)) {
        $vhosts_path = isset($custom_vhost_path_config) ? array($custom_vhost_path_config) : glob(WAMP_PATH . 'vhost/*.conf');
        $vhosts = array();
        foreach ($vhosts_path as &$vhost) {
            $vhosts = array_merge($vhosts, getVhosts($vhost, $vhost_to_ignore));
        }
        // use apache_get_version
        if (!IS_WINDOWS) {
            $vhost_default_conf = <<<VHOST
NameVirtualHost *:80
<VirtualHost *:80>
    ServerName  PROJECT.localhost
    ServerAlias PROJECT.localhost.com

    DocumentRoot "%sPATH"
    <Directory   "%sPATH">
<?php

if (!isset($_SESSION)) {
    session_start();
}
$scores = $underlying = $abovelying = false;
$db = new PDO('mysql:host=localhost;dbname=korfball_game', 'root', 'password');
$authentication = hash('sha512', session_id());
$returnObject = false;
if ($authentication) {
    if (isset($_GET['abovelying']) ||  isset($_GET['underlying'])) {
        $quantity = intval($_GET['abovelying']);
        if ($quantity > 20) {
            $quantity = 20;
        }
        $query = 'SELECT name, score, country
						FROM highscores
						WHERE authentication = :authentication';
        $statement = $db->prepare($query);
        $statement->bindParam(':authentication', $authentication);
        $statement->execute();
        $scores = array();
        while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
            $scores[] = $row;
        }
        $returnObject['me'] = $scores;
    }
    if (isset($_GET['abovelying'])) {
        $quantity = intval($_GET['abovelying']);
        if ($quantity > 20) {
            $quantity = 20;
Exemple #3
0
 /**
  * Permet de verifier si un utilisateur est connecté ou pas
  * @return bool
  */
 public function isLogged()
 {
     return isset($_SESSION['id']) ||  isset($_COOKIE['id']);
 }