<?
#########################################################################################
# Croquis en ligne, pour réaliser la pancarte dans Pnyx #
# Auteur : Sébastien Tremblay, hide@address.com #
# #
# Pnyx - une application Web (PHP/MySQL) d'élections virtuelles conçue pour des élèves #
# du primaire et du secondaire, dans lequel ils sont amenés à faire des propositions #
# en ligne et voter pour leur favorite, sous la supervision d'un enseignant. #
# #
# Copyright (C) <2008 - 2009> #
# <Service national du RÉCIT de l'univers social de la Commission scolaire de la #
# Pointe-de-l'Île> #
# #
# This program is free software; you can redistribute it and/or modify it under the #
# terms of the GNU General Public License as published by the Free Software Foundation. #
# This program is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A #
# PARTICULAR PURPOSE. See the GNU General Public License for more details. #
# You should have received a copy of the GNU General Public License along with this #
# program as the file LICENSE.txt; if not, please see #
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. #
# #
# Service national du RÉCIT de l'univers social #
# http://www.recitus.qc.ca #
# Contact e-mail : steve-hide@address.com #
#########################################################################################
include_once(file_exists("constante.php")? "constante.php" : "../constante.php");
class CSecure
{
var $m_VarFormulaire = array();
function construct()
{
$this->Init();
}
function Init()
{
if ((isset($_POST)) && (isset($_GET)))
$this->m_VarFormulaire = array_merge ($_POST, $_GET);
elseif ((isset($HTTP_POST_VARS)) && (isset($HTTP_GET_VARS)))
$this->m_VarFormulaire = array_merge ($HTTP_POST_VARS, $HTTP_GET_VARS);
}
function Main()
{
$oCSecure = new CSecure();
$oCSecure->construct();
$oCSecure->Demarrer();
}
function Demarrer()
{
if (!$this->EstConnected())
{
$this->Afficher();
exit;
}
}
function EstConnected()
{
session_name("pnyx");
session_start();
return isset($_SESSION['SESSION']['projet']) && isset($_SESSION['SESSION']['usager_id']);
}
function Afficher()
{
include(REP_ROOT.REP_TEMPLATES."secure.template");
}
}
CSecure::Main();
?>