Migration
This commit is contained in:
261
0.9.0/panel/system/class/mysql.php
Executable file
261
0.9.0/panel/system/class/mysql.php
Executable file
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Class de connexion Base de donn?es MySQL |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | 5 Septembre 2004 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Ceci est une classe pour la cr?ation d'objet de connexion ? une |
|
||||
// | base de donn?e MySQL, ainsi que des m?thodes pour la gestion |
|
||||
// | et les diff?rentes possibilit?s de s?lection. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Auteur: Nottet Thomas |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Remarque: Tous les arguments des m?thodes sont de types STRING |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
|
||||
class Mysql
|
||||
{
|
||||
function Mysql($srv,$db,$usr,$pwd) //Constructeur
|
||||
{
|
||||
/* Ouverture d'une connexion ? un serveur MySQL et
|
||||
selection de la table ? utiliser
|
||||
|
||||
$srv = nom du serveur MySQL
|
||||
$db = Base de donn?es ? utiliser
|
||||
$usr = nom d'utlisateur du serveur MySQL
|
||||
$pwd = mot de passe de cette utilisateur
|
||||
*/
|
||||
|
||||
$this->db=$db;
|
||||
$this->id_connect=@mysql_connect($srv,$usr,$pwd);
|
||||
$dbselect=@mysql_select_db($this->db, $this->id_connect);
|
||||
if(!$dbselect)
|
||||
{
|
||||
$this->Close();
|
||||
$this->id_connect=false;
|
||||
}
|
||||
}
|
||||
|
||||
public function Close()
|
||||
{
|
||||
@mysql_close($this->id_connect);
|
||||
}
|
||||
|
||||
public function Select($champs,$tables,$conditions,$group,$order,$nbrec,$liminf)
|
||||
/* Effectue une requ?te SELECT sur la table choisie
|
||||
|
||||
RETOUR: une matrice (nbre de records X nbre de champs)
|
||||
false en cas d'?chec ou 0 enregistrement
|
||||
|
||||
$champs = une liste des champs s?par?s par ,
|
||||
$tables = une liste des tables s?par?es par , avec alias si n?cessaire
|
||||
$conditions = liste des conditions s?par?s par des op?rateurs logiques
|
||||
$group = champ(s) sur le(s)quel(s) sera effectu? un regroupement
|
||||
$order = champ(s) sur le(s)quel(s) seront tri?s les enregistrements
|
||||
(+ ASC pour croissant et DESC pour d?croissant)
|
||||
$liminf = index du premier enregistrement de l'intervalle ? retourner
|
||||
$nbrec = nombre d'enregistrements ? retourner
|
||||
*/
|
||||
{
|
||||
$this->total_req++;
|
||||
|
||||
$query="SELECT ".$champs." FROM ".$tables;
|
||||
if(!empty($conditions))
|
||||
{
|
||||
$query=$query." WHERE ".$conditions;
|
||||
}
|
||||
if(!empty($group))
|
||||
{
|
||||
$query=$query." GROUP BY ".$group;
|
||||
}
|
||||
if(!empty($order))
|
||||
{
|
||||
$query=$query." ORDER BY ".$order;
|
||||
}
|
||||
if(!empty($nbrec))
|
||||
{
|
||||
if(!empty($liminf))
|
||||
{
|
||||
$query=$query." LIMIT ".$liminf.", ".$nbrec;
|
||||
}
|
||||
else
|
||||
{
|
||||
$query=$query." LIMIT ".$nbrec;
|
||||
}
|
||||
}
|
||||
if($this->id_connect != false)
|
||||
{
|
||||
$res=@mysql_query($query, $this->id_connect);
|
||||
if (empty($res))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$nbRows=@mysql_num_rows($res);
|
||||
if ($nbRows==0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0;$i<$nbRows;$i++)
|
||||
{
|
||||
$enregs[$i]=@mysql_fetch_array($res, MYSQL_ASSOC);
|
||||
}
|
||||
return $enregs;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function Count($champs,$tables,$conditions) {
|
||||
$this->total_req++;
|
||||
$query = "SELECT COUNT(".$champs.") AS count FROM ".$tables;
|
||||
if(!empty($conditions)) {
|
||||
$query.= " WHERE ".$conditions;
|
||||
}
|
||||
$res = @mysql_query($query, $this->id_connect);
|
||||
|
||||
if($res) {
|
||||
$res2 = mysql_fetch_array($res);
|
||||
return $res2['count'];
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function Insert($champs,$valeurs,$table)
|
||||
/* Effectue une requ?te INSERT sur une table de la
|
||||
base s?lectionn?e
|
||||
|
||||
RETOUR : True en cas de r?ussite
|
||||
False en cas d'?chec
|
||||
|
||||
$champs = une liste des champs s?par?s par ,
|
||||
$valeurs = une liste de valeurs pour les champs correspondant s?par?s par ,
|
||||
$table = la table dans laquelle il faut ins?rer les enregistrements
|
||||
*/
|
||||
{
|
||||
$this->total_req++;
|
||||
|
||||
$query="INSERT INTO ".$table." (".$champs.")
|
||||
VALUES (".$valeurs.")";
|
||||
if($this->id_connect != false)
|
||||
{
|
||||
$res= @mysql_query($query, $this->id_connect);
|
||||
if ($res)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mysql_error();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return mysql_error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function Delete($table,$conditions)
|
||||
/* Effectue une requ?te DELETE sur une table de la
|
||||
base s?lectionn?e
|
||||
|
||||
RETOUR : Le nombre d'enregistrements supprim?s
|
||||
False en cas d'?chec
|
||||
|
||||
$table = la table dans laquelle il faut ins?rer les enregistrements
|
||||
$conditions = liste des conditions s?par?s par des op?rateurs logiques
|
||||
*/
|
||||
{
|
||||
$this->total_req++;
|
||||
|
||||
$query="DELETE FROM ".$table;
|
||||
if(!empty($conditions))
|
||||
{
|
||||
$query=$query." WHERE ".$conditions;
|
||||
}
|
||||
|
||||
if($this->id_connect != false)
|
||||
{
|
||||
$res=@mysql_query($query, $this->id_connect);
|
||||
if (empty($res))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mysql_affected_rows($this->id_connect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function Update($tables,$champs,$valeurs,$conditions)
|
||||
/* Effectue une requ?te UPDATE sur une table de la
|
||||
base s?lectionn?e
|
||||
|
||||
RETOUR : Le nombre d'enregistrements mis ? jour
|
||||
False en cas d'?chec
|
||||
|
||||
$tables = listes de tables dans lesquelles il faut mettre ? jour les enregistrements
|
||||
$champs = Champs ? mettre ? jour : soit une valeur
|
||||
soit un vecteur si il y a plusieurs champs
|
||||
$valeurs = Valeurs pour mettre ? jour : soit une valeur
|
||||
soit un vecteur si il y a plusieurs champs
|
||||
$conditions = liste des conditions s?par?s par des op?rateurs logiques
|
||||
*/
|
||||
{
|
||||
$this->total_req++;
|
||||
|
||||
$query="UPDATE ".$tables." ";
|
||||
$nbchamps=count($champs);
|
||||
if ($nbchamps!=0)
|
||||
{
|
||||
if ($nbchamps==1)
|
||||
{
|
||||
$query=$query."SET ".$champs."='".$valeurs."' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query=$query."SET ".$champs[0]."='".$valeurs[0]."'";
|
||||
for($i=1;$i<$nbchamps;$i++)
|
||||
{
|
||||
$query=$query.", ".$champs[$i]."=".$valeurs[$i];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!empty($conditions))
|
||||
{
|
||||
$query=$query." WHERE ".$conditions;
|
||||
}
|
||||
if($this->id_connect != false)
|
||||
{
|
||||
$res=@mysql_query($query, $this->id_connect);
|
||||
if (empty($res))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return @mysql_affected_rows($this->id_connect);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private $db;
|
||||
public $id_connect;
|
||||
public $total_req = 0;
|
||||
}
|
||||
|
||||
?>
|
||||
53
0.9.0/panel/system/core.php
Executable file
53
0.9.0/panel/system/core.php
Executable file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// Page core du systeme
|
||||
// Elle contient toute les pages a inclures
|
||||
|
||||
// Demarrage de la session
|
||||
session_start ();
|
||||
$_SESSION['Utilisateur'] = 'test';
|
||||
$_SESSION['Hash'] = '098f6bcd4621d373cade4e832627b4f6'; // MD5: test
|
||||
$_SESSION['Offre'] = 8;
|
||||
|
||||
// Inclusion de la classe MySql
|
||||
require ('system/class/mysql.php');
|
||||
$MySql = new MySql ('localhost', 'root', 'keliopanel', '');
|
||||
if ( $MySql->id_connect == FALSE ) { die ("Erreur d'execution (01)"); }
|
||||
|
||||
// Différents états des composants du panel
|
||||
define("KELIO_WAIT", "1");
|
||||
define("KELIO_ACTIVE", "2");
|
||||
define("KELIO_DELETE", "3");
|
||||
define("KELIO_ERROR", "4");
|
||||
|
||||
// Inclusion des functions
|
||||
require ('system/function.php');
|
||||
|
||||
|
||||
// Verification des autorisations sur la page
|
||||
require ('system/librairie/lib.securite.php');
|
||||
|
||||
//deconnexion
|
||||
if ( isset($_GET['action']) && $_GET['action'] == 'deconnexion' )
|
||||
{
|
||||
disconnect();
|
||||
}
|
||||
|
||||
?>
|
||||
102
0.9.0/panel/system/function.php
Executable file
102
0.9.0/panel/system/function.php
Executable file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// Page contenant toute les functions
|
||||
|
||||
// Function de redirection
|
||||
function Redirect ($Destination)
|
||||
{
|
||||
header ('Location: '.$Destination);
|
||||
die ("Fin des op<6F>rations");
|
||||
}
|
||||
|
||||
// Function de verificatio des form GET avec regex
|
||||
function VerifGET ($Get, $Regex, $TailleMIN, $TailleMAX)
|
||||
{
|
||||
if ( !empty($_GET[$Get]) )
|
||||
{
|
||||
if ( preg_match ($Regex, $_GET[$Get]) )
|
||||
{
|
||||
$Taille = strlen($_GET[$Get]);
|
||||
if ( ($Taille >= $TailleMIN) or ($TailleMIN == 0) )
|
||||
{
|
||||
if ( ($Taille <= $TailleMAX) or ($TailleMAX == 0) )
|
||||
{
|
||||
return "ChaineValide";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "ChaineLongue";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "ChaineCourte";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "ChaineInvalide";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "ChaineVide";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Function de verificatio des form POST avec regex
|
||||
function VerifPOST ($Get, $Regex, $TailleMIN, $TailleMAX)
|
||||
{
|
||||
if ( !empty($_POST[$Get]) )
|
||||
{
|
||||
if ( preg_match ($Regex, $_POST[$Get]) )
|
||||
{
|
||||
$Taille = strlen($_POST[$Get]);
|
||||
if ( ($Taille >= $TailleMIN) or ($TailleMIN == 0) )
|
||||
{
|
||||
if ( ($Taille <= $TailleMAX) or ($TailleMAX == 0) )
|
||||
{
|
||||
return "ChaineValide";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "ChaineLongue";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "ChaineCourte";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "ChaineInvalide";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "ChaineVide";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
104
0.9.0/panel/system/javascript.js
Executable file
104
0.9.0/panel/system/javascript.js
Executable file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
h = 0;
|
||||
id = 0;
|
||||
c = 0;
|
||||
Menu = 1;
|
||||
|
||||
|
||||
function Derouler()
|
||||
{
|
||||
if(h != 0 && id != 0)
|
||||
{
|
||||
if(c <= h)
|
||||
{
|
||||
if(document.getElementById(id))
|
||||
{
|
||||
document.getElementById(id).style.height=c+'px';
|
||||
c++;
|
||||
setTimeout("Derouler()", 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Voir(div, taille)
|
||||
{
|
||||
if(document.getElementById(div))
|
||||
{
|
||||
document.getElementById(div).style.display = 'block';
|
||||
id = div;
|
||||
h = taille;
|
||||
Derouler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Cache (div)
|
||||
{
|
||||
if ( document.getElementById(div).style.display == "" )
|
||||
{
|
||||
document.getElementById(div).style.display = "none";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById(div).style.display = "";
|
||||
}
|
||||
}
|
||||
|
||||
function CacheMenu ()
|
||||
{
|
||||
if ( Menu == 0 )
|
||||
{
|
||||
document.getElementById('JS_menu').style.display = '';
|
||||
document.getElementById('contenu').style.width = '82%;';
|
||||
Menu = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('JS_menu').style.display = 'none';
|
||||
document.getElementById('contenu').style.width = '100%;';
|
||||
Menu = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function ChangeVision (id1, id2)
|
||||
{
|
||||
// alert ("DEBUG NOW");
|
||||
if ( document.getElementById(id1).style.display == '' )
|
||||
{
|
||||
document.getElementById(id1).style.display = 'none';
|
||||
document.getElementById(id2).style.display = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById(id1).style.display = '';
|
||||
document.getElementById(id2).style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
/* Affiche ou cache une partie d'un formulaire */
|
||||
function Montre_Form (div)
|
||||
{
|
||||
document.getElementById(div).style.display = "";
|
||||
}
|
||||
function Cache_Form (div)
|
||||
{
|
||||
document.getElementById(div).style.display = "none";
|
||||
}
|
||||
76
0.9.0/panel/system/librairie/dns/ajoutdomaine.php
Executable file
76
0.9.0/panel/system/librairie/dns/ajoutdomaine.php
Executable file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// Librairie contenant l'ajout de zone DNS
|
||||
|
||||
if ( VerifPOST('Domaine', '#^[a-z0-9.-]+\.[a-z]+$#', 3, 50) != 'ChaineValide' ){
|
||||
$_SESSION['Resultat'] = "La syntaxe du nom de domaine est invalide";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
} elseif ( VerifPOST("Domaine", "#kelio\.org#", 5, 120) == "ChaineValide") {
|
||||
$_SESSION['Resultat'] = "Vous ne pouvez ajouter kelio.org";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
$Commentaire = htmlspecialchars($_POST['Commentaire']);
|
||||
|
||||
if ( (VerifPOST("Racine", "#^/[.a-z0-9/_-]+/$#", 1, 120) != "ChaineValide") and (VerifPOST("Racine", "#^/$#", 1, 120) != "ChaineValide") ) {
|
||||
$_SESSION['Resultat'] = "La racine du nom de domaine est invalide";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
if ( (VerifPOST("OpenBasedir", "#^/[.a-z0-9/_-]+/$#", 1, 120) != "ChaineValide") and (VerifPOST("OpenBasedir", "#^/$#", 1, 120) != "ChaineValide") ) {
|
||||
$_SESSION['Resultat'] = "L'Open Basedir du nom de domaine est invalide";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
$VerifExistence = $MySql->Count('id', 'domaineinterdit', "Adresse='{$_POST['Domaine']}'", '', '', '', '');
|
||||
if ($VerifExistence >= 1) {
|
||||
$_SESSION['Resultat'] = "Ce nom de domaine ne vous appartient pas !";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
$VerifExistence = $MySql->Count('id', 'domainedns', "Domaine='{$_POST['Domaine']}'", '', '', '', '');
|
||||
if ($VerifExistence >= 1) {
|
||||
$_SESSION['Resultat'] = "Ce nom de domaine existe deja sur Kelio";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
$CountDns = $MySql->Count('id', 'domainedns', "Utilisateur='{$_SESSION['Utilisateur']}'");
|
||||
if ( ($_SESSION['Offre']['DomaineDns'] != '-1') and ($CountDns >= $_SESSION['Offre']['DomaineDns']) ) {
|
||||
$_SESSION['Resultat'] = "Votre offre ne vous permet pas d'ajouter plus de noms de domaine";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
if($_POST['Mail'] == "autre")
|
||||
$Mail = $_POST['ServeurMail'];
|
||||
else
|
||||
$Mail = $_POST['Mail'];
|
||||
|
||||
$conteneur = 'Domaine, Utilisateur, Racine, OpenBasedir, Mail, Commentaire, DateDeCreation, Status';
|
||||
$contenu = "'{$_POST['Domaine']}', '{$_SESSION['Utilisateur']}', '{$_POST['Racine']}', '{$_POST['OpenBasedir']}', '{$Mail}', '{$Commentaire}', '".time()."', 1";
|
||||
$MySql->Insert ($conteneur,$contenu, "domainedns");
|
||||
Redirect ('Page-DNS-Recapitulatif.html');
|
||||
|
||||
?>
|
||||
143
0.9.0/panel/system/librairie/dns/ajoutsousdomaine.php
Executable file
143
0.9.0/panel/system/librairie/dns/ajoutsousdomaine.php
Executable file
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// Librairie contenant l'ajout de sous-zone DNS
|
||||
|
||||
if ( VerifPOST('Donnee', '#^[a-z0-9.-]+$#', 1, 50) != 'ChaineValide' ){
|
||||
$_SESSION['Resultat'] = "La syntaxe du sous domaine est invalide";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
if ( VerifPOST('Domaine', "#kelio\.org#", 5, 120) == 'ChaineValide') {
|
||||
$_SESSION['Resultat'] = "Vous ne pouvez ajouter de sous domaine kelio.org";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
$Commentaire = htmlspecialchars($_POST['Commentaire']);
|
||||
|
||||
// Un sous domaine peut-il être ajouté
|
||||
$CountDns = $MySql->Count('id', 'sousdomainedns', "Utilisateur='{$_SESSION['Utilisateur']}'");
|
||||
if ( ($_SESSION['Offre']['SousDomaineDns'] != '-1') and ($CountDns >= $_SESSION['Offre']['SousDomaineDns']) ) {
|
||||
$_SESSION['Resultat'] = "Votre offre ne vous permet pas d'ajouter plus de sous domaines";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
// Le domaine appartient-il à quelqu'un d'autre
|
||||
$VerifExistence = $MySql->Count('id', 'domaineinterdit', "Adresse='{$_POST['Domaine']}'", '', '', '', '');
|
||||
if ($VerifExistence >= 1) {
|
||||
$_SESSION['Resultat'] = "Ce nom de domaine ne vous appartient pas !";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
$VerifExistence = $MySql->Count('id', 'domaineinterdit', "Adresse='{$_POST['Donnee']}.{$_POST['Domaine']}'", '', '', '', '');
|
||||
if ($VerifExistence >= 1) {
|
||||
$_SESSION['Resultat'] = "Ce nom de domaine ne vous appartient pas !";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
// Le nom de domaine existe-t-il
|
||||
$VerifZone = $MySql->Count('id', 'domainedns', "Utilisateur='{$_SESSION['Utilisateur']}' AND Domaine='{$_POST['Domaine']}' AND Status!='3'");
|
||||
if ($VerifZone == 0) {
|
||||
$_SESSION['Resultat'] = "Ce nom de domaine n'existe pas sur Kelio ou est en cours de suppression";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
// Le sous domaine existe déjà
|
||||
$VerifExistence = $MySql->Count('id', 'sousdomainedns', "Type='{$_POST['Type']}' AND Donnee='{$_POST['Donnee']}' AND Domaine='{$_POST['Domaine']}'");
|
||||
if ($VerifExistence > 0) {
|
||||
$_SESSION['Resultat'] = "Ce sous domaine existe deja sur Kelio";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
// Domaine pointant sur les serveurs Kerio
|
||||
if($_POST['Type'] == 1)
|
||||
{
|
||||
// Test de la racine
|
||||
if ( (VerifPOST("Racine", "#^/[.a-z0-9/_-]+/$#", 1, 120) != "ChaineValide") and (VerifPOST("Racine", "#^/$#", 1, 120) != "ChaineValide") ) {
|
||||
$_SESSION['Resultat'] = "La racine du sous domaine est invalide";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
// Test de l'Open Basedir
|
||||
if ( (VerifPOST("OpenBasedir", "#^/[.a-z0-9/_-]+/$#", 1, 120) != "ChaineValide") and (VerifPOST("OpenBasedir", "#^/$#", 1, 120) != "ChaineValide") ) {
|
||||
$_SESSION['Resultat'] = "L'Open Basedir du sous domaine est invalide";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
// Construction des données SQL
|
||||
$Racine = $_POST['Racine'];
|
||||
$OpenBasedir = $_POST['OpenBasedir'];
|
||||
$Type = 1;
|
||||
$Pointage = "";
|
||||
}
|
||||
// Domaine pointant à l'extérieur (de type CNAME, A ou AAAA)
|
||||
elseif(($_POST['Type'] == 2) && ($_POST['TypePointage'] > 0) && ($_POST['TypePointage'] < 4))
|
||||
{
|
||||
// Vérification pour un CNAME
|
||||
if(($_POST['TypePointage'] == 2) && (VerifPOST('Pointage', '#^[a-z0-9.-]+\.[a-z]+$#', 3, 50) == 'ChaineValide'))
|
||||
{
|
||||
// Construction des données SQL
|
||||
$Pointage = $_POST['Pointage'];
|
||||
}
|
||||
// Vérification pour A
|
||||
elseif(($_POST['TypePointage'] == 3) && (VerifPOST('Pointage', '#^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$#', 7, 15) == 'ChaineValide'))
|
||||
{
|
||||
// Construction des données SQL
|
||||
$Pointage = $_POST['Pointage'];
|
||||
}
|
||||
// Vérification pour AAAA
|
||||
/*elseif(($_POST['TypePointage'] == 4) && (VerifPOST('Pointage', '#^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$#', 7, 15) == 'ChaineValide'))
|
||||
{
|
||||
// Construction des données SQL
|
||||
$Pointage = $_POST['Pointage'];
|
||||
}*/
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Impossible de déterminer le pointage de ce sous domaine ".$POST['TypePointage'];
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
// Construction des données SQL
|
||||
$Racine = "";
|
||||
$OpenBasedir = "";
|
||||
$Type = $_POST['TypePointage'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Impossible de déterminer le pointage de ce sous domaine";
|
||||
$_SESSION['Lien'] = "Page-DNS-AjoutSousDomaine.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
$conteneur = 'Domaine, Donnee, Utilisateur, Racine, OpenBasedir, Type, Pointage, Commentaire, DateDeCreation, Status';
|
||||
$contenu = "'{$_POST['Domaine']}', '{$_POST['Donnee']}', '{$_SESSION['Utilisateur']}', '{$Racine}', '{$OpenBasedir}', '{$Type}', '{$_POST['Pointage']}', '{$Commentaire}', '".time()."', 1";
|
||||
$MySql->Insert ($conteneur,$contenu, "sousdomainedns");
|
||||
Redirect ('Page-DNS-Recapitulatif.html');
|
||||
|
||||
?>
|
||||
70
0.9.0/panel/system/librairie/dns/suppression.php
Executable file
70
0.9.0/panel/system/librairie/dns/suppression.php
Executable file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
// Librairie contenant la suppression des zones / sous-zones
|
||||
if ( VerifPOST("Domaine", "# #", 3, 120) == "ChaineValide" )
|
||||
{
|
||||
// On est peut être en présence d'une sous-zone
|
||||
$base = "sousdomainedns";
|
||||
$champ = "Donnee";
|
||||
$_POST['Domaine'] = substr($_POST['Domaine'], 3, (strlen($_POST['Domaine']) - 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$base = "domainedns";
|
||||
$champ = "Domaine";
|
||||
}
|
||||
|
||||
if ( VerifPOST("Domaine", "#^[a-z0-9.-]+$#", 1, 120) != "ChaineValide" )
|
||||
{
|
||||
$_SESSION['Resultat'] = "'".$_POST['Domaine']."' Aucun (sous-) domaine n'a été selectionné";
|
||||
$_SESSION['Lien'] = "Page-Dns-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
if ( VerifPOST("Confirmation", "#^oui$#", 3, 3) != "ChaineValide" )
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le code de confirmation est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Dns-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
$VerifExistence = $MySql->Select ("*", $base, $champ."='".$_POST['Domaine']."'", "", "", "", "");
|
||||
if ( $VerifExistence == FALSE )
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce (sous-) domaine n'existe pas";
|
||||
$_SESSION['Lien'] = "Page-Dns-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
if ( $VerifExistence[0]["Status"] != "2" )
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce (sous-) domaine n'est pas activé (ou deja en cours de suppression)";
|
||||
$_SESSION['Lien'] = "Page-Dns-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
$MySql->Update ($base, "Status", "3", $champ."='".$_POST['Domaine']."'");
|
||||
if($champ == "Domaine")
|
||||
{
|
||||
$MySql->Update ("sousdomainedns", "Status", "3", "Domaine='".$_POST['Domaine']."'");
|
||||
}
|
||||
|
||||
Redirect ('Page-Dns-Recapitulatif.html');
|
||||
|
||||
?>
|
||||
231
0.9.0/panel/system/librairie/domaine/ajoutdomaine.php
Executable file
231
0.9.0/panel/system/librairie/domaine/ajoutdomaine.php
Executable file
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// Librairie contenant l'ajout de domaine
|
||||
|
||||
if ( VerifPOST("Adresse", "#^[a-z0-9.-]+\.[a-z]+$#", 5, 120) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("Adresse", "#kelio\.org#", 5, 120) == "ChaineValide")
|
||||
{
|
||||
$_SESSION['Resultat'] = "Vous ne pouvez pas utiliser Kelio dans vos domaines !!!";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (VerifPOST("Racine", "#^/[.a-z0-9/_-]+/$#", 1, 120) == "ChaineValide") or
|
||||
(VerifPOST("Racine", "#^/$#", 1, 120) == "ChaineValide") )
|
||||
{
|
||||
if ( (VerifPOST("BaseDir", "#^/[.a-z0-9/_-]+/$#", 1, 120) == "ChaineValide") or
|
||||
(VerifPOST("BaseDir", "#^/$#", 1, 120) == "ChaineValide") )
|
||||
{
|
||||
if ( (VerifPOST("Commentaire", "#^[a-z0-9 ]+$#i", 1, 50) == "ChaineValide") or
|
||||
(VerifPOST("Commentaire", "#^[a-z0-9]+$#i", 1, 50) == "ChaineVide") )
|
||||
{
|
||||
if ( VerifPOST("Listage", "#^Oui|Non$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
if ( (VerifPOST("mysqldefault_host", "#^[a-z0-9.-]+\.[a-z]+$#", 5, 50) == "ChaineValide") or
|
||||
(VerifPOST("mysqldefault_host", "#^[a-z0-9.-]+\.[a-z]+$#", 5, 50) == "ChaineVide") )
|
||||
{
|
||||
if ( (VerifPOST("mysqldefault_user", "#^[a-z0-9_]+$#", 3, 16) == "ChaineValide") or
|
||||
(VerifPOST("mysqldefault_user", "#^[a-z0-9_]+$#", 3, 16) == "ChaineVide") )
|
||||
{
|
||||
if ( (VerifPOST("mysqldefault_password", "#^[a-z0-9]+$#", 3, 16) == "ChaineValide") or
|
||||
(VerifPOST("mysqldefault_password", "#^[a-z0-9]+$#", 3, 16) == "ChaineVide") )
|
||||
{
|
||||
if ( (VerifPOST("temporaire", "#^/[a-z0-9/_-]+/$#", 1, 120) == "ChaineValide") or
|
||||
(VerifPOST("temporaire", "#^/[a-z0-9/_-]+/$#", 1, 120) == "ChaineVide") )
|
||||
{
|
||||
if ( (VerifPOST("sessions", "#^/[a-z0-9/_-]+/$#", 1, 120) == "ChaineValide") or
|
||||
(VerifPOST("sessions", "#^/[a-z0-9/_-]+/$#", 1, 120) == "ChaineVide") )
|
||||
{
|
||||
if ( VerifPOST("allow_url_fopen", "#^Oui|Non$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("allow_url_include", "#^Oui|Non$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("display_errors", "#^Oui|Non$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("short_open_tag", "#^Oui|Non$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("sessionauto_start", "#^Oui|Non$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("magic_quotes_gpc", "#^Oui|Non$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("register_globals", "#^Oui|Non$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
$DetecteServeur = $MySql->Select ("*", "utilisateur", "Utilisateur='".$_SESSION['Utilisateur']."'", "", "", "", "");
|
||||
$VerificatinIP = gethostbyname ($_POST['Adresse']);
|
||||
//if ( $VerificatinIP == gethostbyname($DetecteServeur[0]["ServeurFichier"]) )
|
||||
// {
|
||||
$VerificationExistance = $MySql->Select ("*", "domaine", "Adresse='".$_POST["Adresse"]."'", "", "", "", "");
|
||||
if ( $VerificationExistance == FALSE )
|
||||
{
|
||||
$ListTable = $MySql->Select ("*", "domaine", "Utilisateur='".$_SESSION['Utilisateur']."'", "", "", "", "");
|
||||
$CountEnregistrement = count ($ListTable);
|
||||
if ( ($CountEnregistrement >= $_SESSION['Offre']['Domaine']) and ($_SESSION['Offre']['Domaine'] != '-1') ) {
|
||||
$_SESSION['Resultat'] = "D<EFBFBD>sol<EFBFBD>, votre offre ne vous permet pas d'ajouter plus de domaine(s).";
|
||||
$_SESSION['Lien'] = "Page-Domaine-SuppressionDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
} else {
|
||||
$Conteneur = "Utilisateur, Adresse, OpenBasedir, Racine, Status, Listage, Commentaire, DateDeCreation, MysqlDefaultHost, MysqlDefaultUser, MysqlDefaultPassword, tmp, sessions, Allow_url_fopen, Allow_url_include, Session_auto_start, Magic_quotes_gpc, Register_globals, DisplayErrors, Short_Open_Tag";
|
||||
$Contenu = "'".$_SESSION['Utilisateur']."', '".$_POST['Adresse']."', '".$_POST['BaseDir']."', '".$_POST['Racine']."', '1', '".$_POST['Listage']."', '".$_POST['Commentaire']."', '".time()."', '".$_POST['mysqldefault_host']."', '".$_POST['mysqldefault_user']."', '".$_POST['mysqldefault_password']."', '".$_POST['temporaire']."', '".$_POST['sessions']."', '".$_POST['allow_url_fopen']."', '".$_POST['allow_url_include']."', '".$_POST['sessionauto_start']."', '".$_POST['magic_quotes_gpc']."', '".$_POST['register_globals']."', '".$_POST['display_errors']."', '".$_POST['short_open_tag']."'";
|
||||
|
||||
$MySql->Insert($Conteneur, $Contenu, 'domaine');
|
||||
Redirect ('Page-Domaine-Recapitulatif.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le domaine existe deja sur un des serveurs";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
// }
|
||||
//else
|
||||
// {
|
||||
// $_SESSION['Resultat'] = "Le domaine ne pointe pas sur le serveur";
|
||||
// $_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
// Redirect ('resultat.html');
|
||||
// }
|
||||
} // Fin de la verif register_globals
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'option php 'register_globals' est incorrecte.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif magic_quotes_gpc
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'option php 'magic_quotes_gpc' est incorrecte.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif sessionauto_start
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'option php 'session.auto_start' est incorrecte.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif short_open_tag
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'option php 'short_open_tag' est incorrecte.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif display_errors
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'option php 'display_errors' est incorrecte.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif allow_url_include
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'option php 'allow_url_include' est incorrecte.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif du allow_url_fopen
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'option php 'allow_url_fopen' est incorrecte.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif du dossier sessions
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le dossier sessions est invalide. (il doit commencer et finir par /)";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif du dossier temporaire
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le dossier temporaire est invalide. (il doit commencer et finir par /)";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif sql pass
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le mot de passe pour la base de donn<6E>es mysql est invalide.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif sql user
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'utilisateur pour la base de donn<6E>es mysql est invalide.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
} // Fin de la verif sql adresse
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'adresse du serveur mysql est invalide.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le listage est incorrect.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le commentaire est incorrect.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le BaseDir est incorrect (il doit commencer et finir par /)";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "La racine est incorrecte (il doit commencer et finir par /)";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'adresse est incorrecte";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
69
0.9.0/panel/system/librairie/domaine/suppressiondomaine.php
Executable file
69
0.9.0/panel/system/librairie/domaine/suppressiondomaine.php
Executable file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
// Librairie contenant la suppression des domaines
|
||||
if ( VerifPOST("Domaine", "#^[a-z0-9.-]+\.[a-z]+$#", 3, 120) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("Confirmation", "#^oui$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
$VerifExistence = $MySql->Select ("*", "domaine", "Adresse='".$_POST['Domaine']."'", "", "", "", "");
|
||||
if ( $VerifExistence != FALSE )
|
||||
{
|
||||
if ( $VerifExistence[0]["Utilisateur"] == $_SESSION['Utilisateur'] )
|
||||
{
|
||||
if ( $VerifExistence[0]["Status"] == "2" )
|
||||
{
|
||||
$UpdateDB = $MySql->Update ("domaine", "Status", "3", "Adresse='".$_POST['Domaine']."'");
|
||||
Redirect ('Page-Domaine-Recapitulatif.html');
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce domaine n'est pas activ<69> (ou deja en cours de suppression)";
|
||||
$_SESSION['Lien'] = "Page-Domaine-SuppressionDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Monsieur veut la jouer h4X00R ?";
|
||||
$_SESSION['Lien'] = "Page-Domaine-SuppressionDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce domaine n'existe pas";
|
||||
$_SESSION['Lien'] = "Page-Domaine-SuppressionDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le code de confirmation est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Domaine-SuppressionDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Aucun domaine n'est selection<6F>";
|
||||
$_SESSION['Lien'] = "Page-Domaine-SuppressionDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
?>
|
||||
112
0.9.0/panel/system/librairie/email/ajoutalias.php
Executable file
112
0.9.0/panel/system/librairie/email/ajoutalias.php
Executable file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// Librairie d'ajout d'un alias
|
||||
|
||||
if ( VerifPOST("Nom", "#^[a-z0-9._-]+@[a-z0-9._-]{2,25}\.[a-z]{2,4}$#", 7, 60) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("Pointage", "#^[a-z0-9._-]+@[a-z0-9._-]{2,15}\.[a-z]{2,4}$#", 7, 60) == "ChaineValide" )
|
||||
{
|
||||
if ( ( VerifPOST("Commentaire", "#^[a-z0-9 ]+$#i", 0, 50) == "ChaineValide") or ( VerifPOST("Commentaire", "#^[a-z0-9]+$#i", 0, 50) == "ChaineVide"))
|
||||
{
|
||||
if ( VerifPOST("Nom", "#@kelio\.org#i", 0, 0) != "ChaineValide" )
|
||||
{
|
||||
$VerifExistente = $MySql->Select ("*", "email", "Nom='".$_POST['Nom']."'", "", "", "", "");
|
||||
if ( $VerifExistente == FALSE )
|
||||
{
|
||||
$Email = explode ('@', $_POST['Nom']);
|
||||
$Domaine = $Email[1];
|
||||
$Login = $Email[0];
|
||||
$VerifMX = getmxrr($Domaine, $Mxhost, $MxWeight);
|
||||
|
||||
if ( $VerifMX != FALSE )
|
||||
{
|
||||
$i=0;
|
||||
foreach ($Mxhost as $key => $value)
|
||||
{
|
||||
$ServeurMail[$value] = $MxWeight[$i];
|
||||
$i++;
|
||||
}
|
||||
asort($ServeurMail);
|
||||
|
||||
if ( (current(array_keys($ServeurMail)) == "mail.kelio.org") or (gethostbyname(current(array_keys($ServeurMail))) == gethostbyname("mail.kelio.org")) )
|
||||
{
|
||||
$CountAlias = $MySql->Count('id', 'email', "Utilisateur = '{$_SESSION['Utilisateur']}' AND Type = 'alias'");
|
||||
if ( ($CountAlias < $_SESSION['Offre']['AliasEmail']) or ($_SESSION['Offre']['AliasEmail'] == '-1') ) {
|
||||
$Conteneur = "Utilisateur, Nom, Type, Pointage, Status, Commentaire, DateDeCreation";
|
||||
$Contenu = "'".$_SESSION['Utilisateur']."', '".$_POST['Nom']."', 'alias', '".$_POST['Pointage']."', '1', '".$_POST['Commentaire']."', '".time()."'";
|
||||
$MySql->Insert ($Conteneur, $Contenu, "email");
|
||||
Redirect ('Page-Email-Recapitulatif.html');
|
||||
} else {
|
||||
$_SESSION['Resultat'] = "Désolé, votre offre ne vous permet pas d'ajouter plus d'alias.";
|
||||
$_SESSION['Lien'] = "Page-Email-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le MX prioritaire ne pointe pas vers mail.kelio.org.<br />Il pointe actuellement vers ".current(array_keys($ServeurMail));
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutAlias.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce domaine n'a aucune redirection MX.";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutAlias.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Cet email existe deja.";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutAlias.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Vous ne pouvez pas utiliser le domaine kelio.org";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutAlias.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le commentaire est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutAlias.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'email de pointage de passe est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutAlias.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'email est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutAlias.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
113
0.9.0/panel/system/librairie/email/ajoutcompte.php
Executable file
113
0.9.0/panel/system/librairie/email/ajoutcompte.php
Executable file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
// Librairie d'ajout d'un compte email
|
||||
|
||||
if ( VerifPOST("Nom", "#^[a-z0-9._-]+@[a-z0-9._-]{2,25}\.[a-z]{2,4}$#", 7, 60) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("MotDePasse", "#^[a-z0-9]+$#", 3, 9) == "ChaineValide" )
|
||||
{
|
||||
if ( ( VerifPOST("Commentaire", "#^[a-z0-9 ]+$#i", 0, 50) == "ChaineValide") or ( VerifPOST("Commentaire", "#^[a-z0-9]+$#i", 0, 50) == "ChaineVide"))
|
||||
{
|
||||
if ( VerifPOST("Nom", "#@kelio\.org#i", 0, 0) != "ChaineValide" )
|
||||
{
|
||||
$VerifExistente = $MySql->Select ("*", "email", "Nom='".$_POST['Nom']."'", "", "", "", "");
|
||||
if ( $VerifExistente == FALSE )
|
||||
{
|
||||
$Email = explode ('@', $_POST['Nom']);
|
||||
$Domaine = $Email[1];
|
||||
$Login = $Email[0];
|
||||
$VerifMX = getmxrr($Domaine, $Mxhost, $MxWeight);
|
||||
|
||||
$ServeurMail = array();
|
||||
if ( $VerifMX != FALSE )
|
||||
{
|
||||
$i=0;
|
||||
foreach ($Mxhost as $key => $value)
|
||||
{
|
||||
$ServeurMail[$value] = $MxWeight[$i];
|
||||
$i++;
|
||||
}
|
||||
asort($ServeurMail);
|
||||
|
||||
if ( (current(array_keys($ServeurMail)) == "mail.kelio.org") or (gethostbyname(current(array_keys($ServeurMail))) == gethostbyname("mail.kelio.org")) )
|
||||
{
|
||||
$CountMailbox = $MySql->Count('id', 'email', "Utilisateur = '{$_SESSION['Utilisateur']}' AND Type = 'compte'");
|
||||
if ( ($CountMailbox < $_SESSION['Offre']['CompteEmail']) or ($_SESSION['Offre']['CompteEmail'] == '-1')) {
|
||||
$Conteneur = "Utilisateur, Nom, Type, Password, Status, Commentaire, DateDeCreation";
|
||||
$Contenu = "'".$_SESSION['Utilisateur']."', '".$_POST['Nom']."', 'compte', '".$_POST['MotDePasse']."', '1', '".$_POST['Commentaire']."', '".time()."'";
|
||||
$MySql->Insert ($Conteneur, $Contenu, "email");
|
||||
Redirect ('Page-Email-Recapitulatif.html');
|
||||
} else {
|
||||
$_SESSION['Resultat'] = "Désolé, votre offre ne vous permet pas d'ajouter plus de compte.";
|
||||
$_SESSION['Lien'] = "Page-Email-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le MX prioritaire ne pointe pas vers l'ip de mail.kelio.org.";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce domaine n'a aucune redirection MX.";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Cet email existe deja.";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Vous ne pouvez pas utiliser le domaine kelio.org";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le commentaire est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le mot de passe est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "L'email est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Email-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
69
0.9.0/panel/system/librairie/email/suppression.php
Executable file
69
0.9.0/panel/system/librairie/email/suppression.php
Executable file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
// Librairie contenant la suppression des domaines
|
||||
if ( VerifPOST("Nom", "#^[a-z0-9._-]+@[a-z0-9._-]{2,15}\.[a-z]{2,4}$#", 7, 60) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("Confirmation", "#^oui$#", 3, 3) == "ChaineValide" )
|
||||
{
|
||||
$VerifExistence = $MySql->Select ("*", "email", "Nom='".$_POST['Nom']."'", "", "", "", "");
|
||||
if ( $VerifExistence != FALSE )
|
||||
{
|
||||
if ( $VerifExistence[0]["Utilisateur"] == $_SESSION['Utilisateur'] )
|
||||
{
|
||||
if ( $VerifExistence[0]["Status"] == "2" )
|
||||
{
|
||||
$UpdateDB = $MySql->Update ("email", "Status", "3", "Nom='".$_POST['Nom']."'");
|
||||
Redirect ('Page-Email-Recapitulatif.html');
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce compte/alias n'est pas activé (ou deja en cours de suppression)";
|
||||
$_SESSION['Lien'] = "Page-Email-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Email en cours de suppression<br />(Non, je plaisante :D)";
|
||||
$_SESSION['Lien'] = "http://www.perdu.com";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Cet email n'existe pas";
|
||||
$_SESSION['Lien'] = "Page-Email-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le code de confirmation est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Email-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Aucun compte/alias n'est selectioné";
|
||||
$_SESSION['Lien'] = "Page-Email-Suppression.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
?>
|
||||
80
0.9.0/panel/system/librairie/ftp/ajoutcompte.php
Executable file
80
0.9.0/panel/system/librairie/ftp/ajoutcompte.php
Executable file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// Librairie contenant l'ajout de compte ftp
|
||||
|
||||
if ( VerifPOST("Nom", "#^[a-z0-9]+$#", 3, 9) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("MotDePasse", "#^[a-z0-9]+$#i", 3, 9) == "ChaineValide" )
|
||||
{
|
||||
if ( (VerifPOST("Chemin", "#^/[a-z0-9/_-]+/$#", 1, 70) == "ChaineValide") or (VerifPOST("Chemin", "#^/$#", 1, 70) == "ChaineValide") )
|
||||
{
|
||||
if ( (VerifPOST("Commentaire", "#^[a-z0-9 ]+$#i", 1, 50) == "ChaineValide") or (VerifPOST("Commentaire", "#^[a-z0-9]+$#i", 1, 50) == "ChaineVide") )
|
||||
{
|
||||
$VerifExistance = $MySql->Select ("*", "ftp", "Nom='".$_SESSION['Utilisateur']."_".$_POST['Nom']."'", "", "", "", "");
|
||||
if ( $VerifExistance == FALSE )
|
||||
{
|
||||
$CountFTP = $MySql->Count('id', 'ftp', "Utilisateur='{$_SESSION['Utilisateur']}'");
|
||||
if ( ($CountFTP >= $_SESSION['Offre']['Ftp']) and ($_SESSION['Offre']['Ftp'] != '-1')) {
|
||||
$_SESSION['Resultat'] = "Desole, votre offre ne vous permet pas d'ajouter plus de compte(s) FTP.";
|
||||
$_SESSION['Lien'] = "Page-Ftp-SuppressionCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
} else {
|
||||
$Conteneur = "Utilisateur, Nom, Password, Status, Chemin, Commentaire, DateDeCreation";
|
||||
$Contenu = "'".$_SESSION['Utilisateur']."', '".$_SESSION['Utilisateur']."_".$_POST['Nom']."', '".$_POST['MotDePasse']."', '1', '".$_POST['Chemin']."', '".$_POST['Commentaire']."', '".time()."'";
|
||||
$MySql->Insert ($Conteneur,$Contenu, "ftp");
|
||||
Redirect ('Page-Ftp-Recapitulatif.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce compte existe deja.";
|
||||
$_SESSION['Lien'] = "Page-Ftp-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le commentaire est incorrect.";
|
||||
$_SESSION['Lien'] = "Page-Domaine-AjoutDomaineExterne.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le chemin est incorrect (il doit commencer et finir par /)";
|
||||
$_SESSION['Lien'] = "Page-Ftp-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le mot de passe est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Ftp-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le nom du compte est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Ftp-AjoutCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
?>
|
||||
70
0.9.0/panel/system/librairie/ftp/suppressioncompte.php
Executable file
70
0.9.0/panel/system/librairie/ftp/suppressioncompte.php
Executable file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
// Librairie contenant la suppresion d'un compte ftp
|
||||
|
||||
if ( VerifPOST("Nom", "#^[a-z0-9]+_[a-z0-9]+$#", 3, 25) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("MotDePasse", "#^[a-z0-9]+$#", 3, 9) == "ChaineValide" )
|
||||
{
|
||||
$VerifExistence = $MySql->Select ("*", "ftp", "Nom='".$_POST['Nom']."'", "", "", "", "");
|
||||
if ( $VerifExistence != FALSE )
|
||||
{
|
||||
if ( $VerifExistence[0]["Utilisateur"] == $_SESSION['Utilisateur'] )
|
||||
{
|
||||
if ( $VerifExistence[0]["Status"] == "2" )
|
||||
{
|
||||
$UpdateDB = $MySql->Update ("ftp", "Status", "3", "Nom='".$_POST['Nom']."'");
|
||||
Redirect ('Page-Ftp-Recapitulatif.html');
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce compte n'est pas activé (ou deja en cours de suppression)";
|
||||
$_SESSION['Lien'] = "Page-Ftp-SuppressionCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Monsieur veut la jouer h4X00R ?";
|
||||
$_SESSION['Lien'] = "Page-Ftp-SuppressionCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Ce compte n'existe pas";
|
||||
$_SESSION['Lien'] = "Page-Ftp-SuppressionCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le mot de passe est incorrect";
|
||||
$_SESSION['Lien'] = "Page-Ftp-SuppressionCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Aucun compte n'est selectioné";
|
||||
$_SESSION['Lien'] = "Page-Ftp-SuppressionCompte.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
?>
|
||||
56
0.9.0/panel/system/librairie/lib.auth.php
Executable file
56
0.9.0/panel/system/librairie/lib.auth.php
Executable file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
if ( VerifPOST("login", "#^[a-z0-9]+$#i", 3, 9) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("pass", "#^[a-z0-9]+$#i", 3, 25) == "ChaineValide" )
|
||||
{
|
||||
$VerifLogin = $MySql->Select ("*", "utilisateur", "Utilisateur='".strtolower($_POST['login'])."'", "", "", "", "");
|
||||
if ( $VerifLogin != FALSE )
|
||||
{
|
||||
if ( $VerifLogin[0]["Password"] == md5(md5($_POST['pass'])) )
|
||||
{
|
||||
|
||||
$_SESSION['Utilisateur'] = $VerifLogin[0]["Utilisateur"];
|
||||
$_SESSION['Hash'] = $VerifLogin[0]["Password"];
|
||||
$Offre = $MySql->Select("*", "offre", "id='{$VerifLogin[0]["Offre_id"]}'", "", "", "", "");
|
||||
$_SESSION['Offre'] = $Offre[0];
|
||||
Redirect ('Page.html');
|
||||
}
|
||||
else
|
||||
{
|
||||
Redirect ('http://www.kelio.org#Mauvais_Password');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Redirect ('http://www.kelio.org#Login_Inexistant');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Redirect ('http://www.kelio.org#Syntaxe_Incorrecte');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Redirect ('http://www.kelio.org#Syntaxe_Incorrecte');
|
||||
}
|
||||
|
||||
?>
|
||||
60
0.9.0/panel/system/librairie/lib.page.php
Executable file
60
0.9.0/panel/system/librairie/lib.page.php
Executable file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// Page contenant la gestion des pages
|
||||
if ( VerifGET ("id", "#[a-z]+#i", 3, 30) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifGET("ids", "#[a-z]+#i", 3, 30) == "ChaineValide" )
|
||||
{
|
||||
$SelectPage = $MySql->Select ("*", "page", "Page1='".$_GET['id']."' AND Page2='".$_GET['ids']."'", "", "", "", "");
|
||||
|
||||
if ( $SelectPage != FALSE )
|
||||
{
|
||||
if ( $SelectPage[0]["Activation"] == "oui" )
|
||||
{
|
||||
if(file_exists($SelectPage[0]["Chemin"]))
|
||||
{
|
||||
require ($SelectPage[0]["Chemin"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
require ('module/erreur/inconnu.php');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
require ('module/erreur/desactive.php');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
require ('module/erreur/inconnu.php');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
require ('module/accueil.php');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
require ('module/accueil.php');
|
||||
}
|
||||
|
||||
?>
|
||||
69
0.9.0/panel/system/librairie/lib.securite.php
Executable file
69
0.9.0/panel/system/librairie/lib.securite.php
Executable file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
// Page contenant la verification de l'existance du login
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
function VerifDroit ()
|
||||
{
|
||||
global $MySql;
|
||||
if ( isset($_SESSION['Utilisateur']) && isset($_SESSION['Hash']) )
|
||||
{
|
||||
$SelectUtilisateur = $MySql->Select ("*", "utilisateur", "Utilisateur='".$_SESSION['Utilisateur']."'", "", "", "", "");
|
||||
|
||||
if ( $SelectUtilisateur != FALSE )
|
||||
{
|
||||
if ( $SelectUtilisateur[0]["Password"] != $_SESSION['Hash'] OR $SelectUtilisateur[0]["Status"] == '5' )
|
||||
{
|
||||
//session_destroy ();
|
||||
Redirect ('http://www.kelio.asso.fr#s1');
|
||||
}
|
||||
else
|
||||
{
|
||||
$MySql->Update ("utilisateur", array("AdresseIP", "DernierLogin"), array($_SERVER['REMOTE_ADDR'], 'NOW()'), "Utilisateur='".$_SESSION['Utilisateur']."'");
|
||||
$Offre = $MySql->Select("*", "offre", "id='{$SelectUtilisateur[0]["Offre_id"]}'", "", "", "", "");
|
||||
$_SESSION['Offre'] = $Offre[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//session_destroy ();
|
||||
Redirect ('http://www.kelio.asso.fr#s2');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//session_destroy ();
|
||||
Redirect ('http://www.kelio.asso.fr#s3');
|
||||
}
|
||||
}
|
||||
|
||||
function VerifProvenance ($Provenance)
|
||||
{
|
||||
if ( !preg_match("#".addslashes($Provenance)."#i", $_SERVER['HTTP_REFERER']) )
|
||||
{
|
||||
Redirect ('http://www.kelio.asso.fr#5');
|
||||
}
|
||||
}
|
||||
|
||||
function disconnect ()
|
||||
{
|
||||
session_start();
|
||||
$_SESSION=array();//on efface toutes les variables de la session
|
||||
session_destroy(); // Puis on détruit la session
|
||||
Redirect ('http://www.kelio.asso.fr#deconnexion'); // On renvoie ensuite sur la page d'accueil
|
||||
}
|
||||
?>
|
||||
76
0.9.0/panel/system/librairie/mysql/ajoutbdd.php
Executable file
76
0.9.0/panel/system/librairie/mysql/ajoutbdd.php
Executable file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
// Librairie d'ajout de base de donnée
|
||||
|
||||
if ( VerifPOST("Nom", "#^[a-z0-9]+$#", 3, 6) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("MotDePasse", "#^[a-z0-9]+$#", 3, 9) == "ChaineValide" )
|
||||
{
|
||||
if ( ( VerifPOST("Commentaire", "#^[a-z0-9 ]+$#i", 0, 50) == "ChaineValide") or ( VerifPOST("Commentaire", "#^[a-z0-9]+$#i", 0, 50) == "ChaineVide"))
|
||||
{
|
||||
$NomBase = str_replace('_','',$_POST['Nom']);
|
||||
$NomBase = str_replace(' ','',$NomBase);
|
||||
|
||||
$MdpBase = str_replace('_','',$_POST['MotDePasse']);
|
||||
$MdpBase = str_replace(' ','',$MdpBase);
|
||||
|
||||
$VerificationExistance = $MySql->Select ("*", "basededonnee", "Nom='".$_SESSION['Utilisateur']."_".$NomBase."'", "", "", "", "");
|
||||
if ( $VerificationExistance == FALSE )
|
||||
{
|
||||
$CountDB = $MySql->Count('id', 'basededonnee', "Utilisateur='{$_SESSION['Utilisateur']}'");
|
||||
if ( ($CountDB >= $_SESSION['Offre']['BaseDeDonnees']) and ($_SESSION['Offre']['BaseDeDonnees'] != '-1')) {
|
||||
$_SESSION['Resultat'] = "Désolé, votre offre ne vous permet pas d'ajouter plus de base(s) de données.";
|
||||
$_SESSION['Lien'] = "Page-MySql-SuppressionBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
} else {
|
||||
$Conteneur = "Utilisateur, Nom, Password, Commentaire, DateDeCreation";
|
||||
$Contenu = "'".$_SESSION['Utilisateur']."', '".$_SESSION['Utilisateur']."_".$NomBase."', '".$MdpBase."', '".$_POST['Commentaire']."', '".time()."'";
|
||||
$MySql->Insert ($Conteneur,$Contenu, "basededonnee");
|
||||
Redirect ('Page-MySql-Recapitulatif.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Cette base de données existe deja";
|
||||
$_SESSION['Lien'] = "Page-MySql-AjoutBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le commentaire est incorrect";
|
||||
$_SESSION['Lien'] = "Page-MySql-AjoutBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le mot de passe est incorrect";
|
||||
$_SESSION['Lien'] = "Page-MySql-AjoutBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le nom de la base de données est incorrect";
|
||||
$_SESSION['Lien'] = "Page-MySql-AjoutBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
?>
|
||||
73
0.9.0/panel/system/librairie/mysql/suppressionbdd.php
Executable file
73
0.9.0/panel/system/librairie/mysql/suppressionbdd.php
Executable file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2007 Mercier Benjamin
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
// Librairie de suppression de base de données
|
||||
|
||||
if ( VerifPOST("Base", "#^[a-z0-9]+_[a-z0-9]+$#", 3, 25) == "ChaineValide" )
|
||||
{
|
||||
if ( VerifPOST("MotDePasse", "#^[a-z0-9]+$#", 3, 9) == "ChaineValide" )
|
||||
{
|
||||
$VerifExistence = $MySql->Select ("*", "basededonnee", "Nom='".$_POST['Base']."'", "", "", "", "");
|
||||
if ( $VerifExistence != FALSE )
|
||||
{
|
||||
if ( $VerifExistence[0]["Utilisateur"] == $_SESSION['Utilisateur'] )
|
||||
{
|
||||
if ( $VerifExistence[0]["Status"] == "2" )
|
||||
{
|
||||
$UpdateDB = $MySql->Update ("basededonnee", "Status", "3", "Nom='".$_POST['Base']."'");
|
||||
Redirect ('Page-MySql-Recapitulatif.html');
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Cette base de donnée n'est pas activée (ou deja en cours de suppression)";
|
||||
$_SESSION['Lien'] = "Page-MySql-SuppressionBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Monsieur veut la jouer h4X00R ?";
|
||||
$_SESSION['Lien'] = "Page-MySql-SuppressionBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Cette base de données n'existe pas";
|
||||
$_SESSION['Lien'] = "Page-MySql-SuppressionBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Le mot de passe est incorrect";
|
||||
$_SESSION['Lien'] = "Page-MySql-SuppressionBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['Resultat'] = "Aucune bdd n'a été sélectionnée";
|
||||
$_SESSION['Lien'] = "Page-MySql-SuppressionBdd.html";
|
||||
Redirect ('resultat.html');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user