Initial commit
This commit is contained in:
commit
998d011cd3
233 changed files with 36893 additions and 0 deletions
100
db/fic2014.sql
Normal file
100
db/fic2014.sql
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
-- phpMyAdmin SQL Dump
|
||||||
|
-- version 3.5.1
|
||||||
|
-- http://www.phpmyadmin.net
|
||||||
|
--
|
||||||
|
-- Host: localhost
|
||||||
|
-- Generation Time: Oct 09, 2013 at 03:38 PM
|
||||||
|
-- Server version: 5.5.32-log
|
||||||
|
-- PHP Version: 5.4.9--pl0-gentoo
|
||||||
|
|
||||||
|
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
||||||
|
SET time_zone = "+00:00";
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Database: `fic2014`
|
||||||
|
--
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `exercices`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `exercices` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_theme` int(10) unsigned NOT NULL,
|
||||||
|
`name` varchar(255) COLLATE utf16_unicode_ci NOT NULL,
|
||||||
|
`difficulty` tinyint(3) unsigned NOT NULL,
|
||||||
|
`points` smallint(6) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_unicode_ci AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `exercice_dependancies`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `exercice_dependancies` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_exercice` int(10) unsigned NOT NULL,
|
||||||
|
`id_dependence` int(10) unsigned NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `sessions`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `sessions` (
|
||||||
|
`session` binary(32) NOT NULL,
|
||||||
|
`uid` binary(16) NOT NULL,
|
||||||
|
`time` int(11) NOT NULL,
|
||||||
|
`ip` varbinary(16) NOT NULL,
|
||||||
|
`var` varchar(9999) COLLATE utf8_unicode_ci NOT NULL,
|
||||||
|
`level` tinyint(2) NOT NULL,
|
||||||
|
`active` enum('1','0') COLLATE utf8_unicode_ci NOT NULL,
|
||||||
|
PRIMARY KEY (`session`)
|
||||||
|
) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `solved`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `solved` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_user` int(10) unsigned NOT NULL,
|
||||||
|
`id_exercice` int(10) unsigned NOT NULL,
|
||||||
|
`time` datetime NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_unicode_ci AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `themes`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `themes` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(255) COLLATE utf16_unicode_ci NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_unicode_ci AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `users`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `users` (
|
||||||
|
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`username` varchar(255) COLLATE utf16_unicode_ci NOT NULL,
|
||||||
|
`password` binary(64) NOT NULL,
|
||||||
|
`auth_level` tinyint(1) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_unicode_ci AUTO_INCREMENT=1 ;
|
||||||
1
htdocs/.onyx
Normal file
1
htdocs/.onyx
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
../onyx/load.php
|
||||||
174
htdocs/index.php
Normal file
174
htdocs/index.php
Normal file
|
|
@ -0,0 +1,174 @@
|
||||||
|
<?php
|
||||||
|
//Inclusion de l'API Onyx
|
||||||
|
require_once(trim(file_get_contents('./.onyx')));
|
||||||
|
|
||||||
|
//On active le débogage si l'on est sur le domaine de debug
|
||||||
|
if ($_SERVER["SERVER_NAME"] == "localhost" || $_SERVER["SERVER_NAME"] == "fic.nemunai.re")
|
||||||
|
define("DEBUG", true);
|
||||||
|
|
||||||
|
//Chargement de tout le nécessaire pour le site
|
||||||
|
require_once("common.php");
|
||||||
|
|
||||||
|
$p = strtolower(gpc("p"));
|
||||||
|
|
||||||
|
if (empty($page) && $SESS->level > 0)
|
||||||
|
{
|
||||||
|
if ($SESS->level&1)
|
||||||
|
{
|
||||||
|
switch($p)
|
||||||
|
{
|
||||||
|
case "adm_users":
|
||||||
|
include("admin/users.php");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($SESS->level&2)
|
||||||
|
{
|
||||||
|
switch($p)
|
||||||
|
{
|
||||||
|
case "articles":
|
||||||
|
include("articles/articles.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "articles_prod":
|
||||||
|
include("articles/production.php");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($SESS->level&4)
|
||||||
|
{
|
||||||
|
switch($p)
|
||||||
|
{
|
||||||
|
case "palettes":
|
||||||
|
include("articles/palettes.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "palettes_besoins":
|
||||||
|
include("articles/needs.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "prod_couts":
|
||||||
|
include("production/costs.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "stocks_besoins":
|
||||||
|
include("materials/needs.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "stocks_etat":
|
||||||
|
include("materials/etat.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "transport":
|
||||||
|
include("materials/transport.php");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($SESS->level&16)
|
||||||
|
{
|
||||||
|
switch($p)
|
||||||
|
{
|
||||||
|
case "commandes":
|
||||||
|
include("materials/commandes.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "stocks_besoins":
|
||||||
|
include("materials/needs.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "transport":
|
||||||
|
include("materials/transport.php");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($SESS->level&8)
|
||||||
|
{
|
||||||
|
switch($p)
|
||||||
|
{
|
||||||
|
case "prod_resume":
|
||||||
|
include("articles/needs.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "prod_entry":
|
||||||
|
include("production/entry.php");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch($p)
|
||||||
|
{
|
||||||
|
case "":
|
||||||
|
$_GET["p"] = "";
|
||||||
|
case "accueil":
|
||||||
|
include("users/accueil.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "disconnect":
|
||||||
|
include("public/login.php");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($page)) // Public pages
|
||||||
|
{
|
||||||
|
switch($p)
|
||||||
|
{
|
||||||
|
case "":
|
||||||
|
$_GET["p"] = "";
|
||||||
|
case "login":
|
||||||
|
include("public/login.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "forgotpasswd":
|
||||||
|
include("public/forgotpasswd.php");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "403":
|
||||||
|
$template->assign("err", 403);
|
||||||
|
$page = "404";
|
||||||
|
break;
|
||||||
|
case "404":
|
||||||
|
$template->assign("err", 404);
|
||||||
|
$page = "404";
|
||||||
|
break;
|
||||||
|
case "5mail":
|
||||||
|
include("mail.php");
|
||||||
|
exit;
|
||||||
|
case "500":
|
||||||
|
$template->assign("err", 500);
|
||||||
|
$page = "404";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($page))
|
||||||
|
{
|
||||||
|
$template->assign("err", 404);
|
||||||
|
$template->display("404.tpl");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ALERTS = array();
|
||||||
|
$nbAlert = @count($SESS->values["alerts"]);
|
||||||
|
if ($nbAlert > 0)
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < $nbAlert; $i++)
|
||||||
|
{
|
||||||
|
if ($SESS->values["alerts"][$i]->page == $page)
|
||||||
|
{
|
||||||
|
$ALERTS[] = $SESS->values["alerts"][$i];
|
||||||
|
unset($SESS->values["alerts"][$i]);
|
||||||
|
$i--; $nbAlert--;
|
||||||
|
$SESS->values["alerts"] = array_values($SESS->values["alerts"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$SESS->put();
|
||||||
|
}
|
||||||
|
$template->assign("ALERTS", $ALERTS);
|
||||||
|
|
||||||
|
$template->display($page.".tpl");
|
||||||
|
}
|
||||||
0
onyx/ban.list
Normal file
0
onyx/ban.list
Normal file
0
onyx/cache/templates/cache/cache
vendored
Normal file
0
onyx/cache/templates/cache/cache
vendored
Normal file
0
onyx/cache/templates/compile/compile
vendored
Normal file
0
onyx/cache/templates/compile/compile
vendored
Normal file
60
onyx/config/sample.root.xml
Normal file
60
onyx/config/sample.root.xml
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configs active="1" root="/var/www/jacobdelafon/htdocs/" cache="1">
|
||||||
|
<config match="index.php">
|
||||||
|
<var name="chrono"><![CDATA[<!--Page générée en: $ secondes.-->]]></var>
|
||||||
|
</config>
|
||||||
|
<config match="*">
|
||||||
|
<env option="auth">0</env>
|
||||||
|
<env option="ignore_user_abort">1</env>
|
||||||
|
<env option="error_level">6143</env>
|
||||||
|
<env option="timezone">Europe/Paris</env>
|
||||||
|
<env option="header">
|
||||||
|
<env option="Content-Type">text/html;charset=utf-8</env>
|
||||||
|
</env>
|
||||||
|
<env option="ini">
|
||||||
|
<env option="allow_url_fopen">0</env>
|
||||||
|
<env option="allow_url_include">0</env>
|
||||||
|
<env option="display_errors">1</env>
|
||||||
|
<env option="display_startup_errors">1</env>
|
||||||
|
<env option="magic_quotes_runtime">0</env>
|
||||||
|
<env option="magic_quotes_sybase">0</env>
|
||||||
|
<env option="memory_limit">64M</env>
|
||||||
|
<env option="log_errors">1</env>
|
||||||
|
</env>
|
||||||
|
<env option="log_php">1</env>
|
||||||
|
<env option="locale">
|
||||||
|
<env option="0">fr_FR.UTF8</env>
|
||||||
|
<env option="1">fr.UTF8</env>
|
||||||
|
<env option="2">fr_FR.UTF-8</env>
|
||||||
|
<env option="3">fr.UTF-8</env>
|
||||||
|
</env>
|
||||||
|
|
||||||
|
<module name="db">
|
||||||
|
<option name="type">mysql</option>
|
||||||
|
<option name="profile">default</option>
|
||||||
|
<option name="log">1</option>
|
||||||
|
<option name="crypt"></option>
|
||||||
|
<option name="no_connection"><![CDATA[Connexion à la base de donnée impossible]]></option>
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<module name="session">
|
||||||
|
<option name="active">1</option>
|
||||||
|
<option name="time">3600</option>
|
||||||
|
<option name="maxip">20</option>
|
||||||
|
<option name="cookie">jdlsession</option>
|
||||||
|
<option name="db">
|
||||||
|
<option name="table">sessions</option>
|
||||||
|
</option>
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<module name="lang" />
|
||||||
|
|
||||||
|
<module name="bbcode" />
|
||||||
|
|
||||||
|
<module name="templates">
|
||||||
|
<option name="tpl">bootstrap</option>
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<module name="captcha" />
|
||||||
|
</config>
|
||||||
|
</configs>
|
||||||
10
onyx/db/sample.profile.php
Normal file
10
onyx/db/sample.profile.php
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if(!defined('ONYX')) exit;
|
||||||
|
|
||||||
|
$___profile['db'] = 'kohler_palettes';
|
||||||
|
$___profile['host'] = 'localhost';
|
||||||
|
$___profile['user'] = 'root';
|
||||||
|
$___profile['pass'] = '';
|
||||||
|
|
||||||
|
?>
|
||||||
28
onyx/include/common.php
Normal file
28
onyx/include/common.php
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
if(!defined('ONYX')) exit;
|
||||||
|
|
||||||
|
if (empty($sess->values["connected"]) && !defined("xCSRF"))
|
||||||
|
define("xCSRF", true);
|
||||||
|
|
||||||
|
require_once("functions.php"); //Inclusion des principales fonctions
|
||||||
|
|
||||||
|
//On charge la session
|
||||||
|
$SESS = new Session();
|
||||||
|
|
||||||
|
$template = new Template();
|
||||||
|
|
||||||
|
$template->assign("ERRmessage", false);
|
||||||