Migration
111
0.7.1/daemon/GestionBridage.php
Executable file
@@ -0,0 +1,111 @@
|
||||
<?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.
|
||||
*/
|
||||
/*
|
||||
[ERREUR 1] => Le serveur web du domaine ne repond pas correctement.
|
||||
[ERREUR 2] => Le domaine n'a pu etre mis a jour sur le panel.
|
||||
[ERREUR 3] => La mise en suppression du domaine n'a pu etre mis a jour sur le panel
|
||||
*/
|
||||
|
||||
// Annulation de la connexion MySql locale :
|
||||
$ConnexionLocale = "non";
|
||||
|
||||
// Inclusion du core
|
||||
require ('/var/www/daemon/system/core.php');
|
||||
|
||||
|
||||
$ListDomaine = $ConnexionPanel->Select ("*", "domaine", "Status='2'", "", "", "", "");
|
||||
if ( $ListDomaine != FALSE )
|
||||
{
|
||||
$CountDomaine = count($ListDomaine);
|
||||
echo "\nDomaine(s) a controler : ".$CountDomaine."\n";
|
||||
|
||||
for ($i=0; $i < $CountDomaine; $i++)
|
||||
{
|
||||
echo "Domaine de ".$ListDomaine[$i]["Utilisateur"]." : ".$ListDomaine[$i]["Adresse"];
|
||||
|
||||
if ( gethostbyname($ListDomaine[$i]["Adresse"]) == gethostbyname($ServeurFichier) )
|
||||
{
|
||||
|
||||
$CodeSource = @file_get_contents("http://".$ListDomaine[$i]["Adresse"]);
|
||||
if ( $CodeSource != FALSE )
|
||||
{
|
||||
if ( preg_match("#pub-3624271267101348#sUi", $CodeSource) )
|
||||
{
|
||||
if ( $ListDomaine[$i]["Bridage"] == "Oui" )
|
||||
{
|
||||
$MajDomaine = $ConnexionPanel->Update("domaine", array("Bridage", "Regeneration"), array("Non", "Oui"), "Adresse='".$ListDomaine[$i]["Adresse"]."'");
|
||||
if ( $MajDomaine != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 2]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $ListDomaine[$i]["Bridage"] == "Non" )
|
||||
{
|
||||
$MajDomaine = $ConnexionPanel->Update("domaine", array("Bridage", "Regeneration"), array("Oui", "Oui"), "Adresse='".$ListDomaine[$i]["Adresse"]."'");
|
||||
if ( $MajDomaine != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 4]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 1]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$MajDomaine = $ConnexionPanel->Update("domaine", "Status", "3", "Adresse='".$ListDomaine[$i]["Adresse"]."'");
|
||||
if ( $MajDomaine != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 3]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun domaine a controler (bug ?)\n";
|
||||
}
|
||||
|
||||
?>
|
||||
308
0.7.1/daemon/GestionDomaine.php
Executable file
@@ -0,0 +1,308 @@
|
||||
<?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.
|
||||
*/
|
||||
/*
|
||||
[ERREUR 1] => Le vhost ne peut pas etre ouvert en ecriture.
|
||||
{ERREUR 2] => Le vhost n'a pu etre lu.
|
||||
[ERREUR 3] => Le vhost n'a pu etre supprim<69>
|
||||
[ERREUR 4] => Le vhost n'a pu etre <20>crit
|
||||
[ERREUR 5] => La mise a jour sur le panel a <20>chou<6F>.
|
||||
*/
|
||||
|
||||
// Annulation de la connexion MySql locale :
|
||||
$ConnexionLocale = "non";
|
||||
|
||||
// Inclusion du core
|
||||
require ('/var/www/daemon/system/core.php');
|
||||
|
||||
/* ------------*/
|
||||
/* Suppression */
|
||||
/* ----------- */
|
||||
$ListDomaine = $ConnexionPanel->Select ("*", "domaine", "Status='3' OR Regeneration='Oui'", "", "", "", "");
|
||||
if ( $ListDomaine != FALSE )
|
||||
{
|
||||
$CountDomaine = count($ListDomaine);
|
||||
echo "\nDomaine(s) en attente de suppr<70>ssion : ".$CountDomaine."\n";
|
||||
|
||||
for ($i=0; $i < $CountDomaine; $i++)
|
||||
{
|
||||
$SelectUtilisateur = $ConnexionPanel->Select ("*", "utilisateur", "Utilisateur='".$ListDomaine[$i]["Utilisateur"]."'", "", "", "", "");
|
||||
if ( $SelectUtilisateur[0]["ServeurFichier"] == $ServeurFichier )
|
||||
{
|
||||
echo "Domaine de ".$ListDomaine[$i]["Utilisateur"]." : ".$ListDomaine[$i]["Adresse"];
|
||||
if ( is_writable("/var/www/vhost/".$ListDomaine[$i]["Utilisateur"]) )
|
||||
{
|
||||
$LoadFichier = file_get_contents ("/var/www/vhost/".$ListDomaine[$i]["Utilisateur"]);
|
||||
|
||||
// Ne renvoit pas true ou false !!! http://fr.php.net/preg_replace
|
||||
$SupprimeDomaine = preg_replace("#\#DEBUT: ".$ListDomaine[$i]["Adresse"]."(.+)\#FIN: ".$ListDomaine[$i]["Adresse"]."#iUs", "", $LoadFichier);
|
||||
|
||||
$Fichier = file_put_contents("/var/www/vhost/".$ListDomaine[$i]["Utilisateur"], $SupprimeDomaine);
|
||||
|
||||
if ( $Fichier != FALSE )
|
||||
{
|
||||
|
||||
if ( $ListDomaine[$i]["Regeneration"] == "Oui" )
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Update("domaine", array("Status", "Regeneration"), array("1", "Non"), "Adresse='".$ListDomaine[$i]["Adresse"]."'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Delete("domaine", "Adresse='".$ListDomaine[$i]["Adresse"]."'");
|
||||
}
|
||||
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 5]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 4]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 1]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun domaine n'est en attente de suppression.\n";
|
||||
}
|
||||
|
||||
/* -------- */
|
||||
/* Cr<43>ation */
|
||||
/* -------- */
|
||||
$ListDomaine = $ConnexionPanel->Select ("*", "domaine", "Status='1'", "", "", "", "");
|
||||
if ( $ListDomaine != FALSE )
|
||||
{
|
||||
$CountDomaine = count($ListDomaine);
|
||||
echo "\nDomaine(s) en attente de cr<63>ation : ".$CountDomaine."\n";
|
||||
|
||||
for ( $i=0; $i < $CountDomaine; $i++)
|
||||
{
|
||||
$SelectUtilisateur = $ConnexionPanel->Select ("*", "utilisateur", "Utilisateur='".$ListDomaine[$i]["Utilisateur"]."'", "", "", "", "");
|
||||
|
||||
if ( $SelectUtilisateur[0]["ServeurFichier"] == $ServeurFichier )
|
||||
{
|
||||
echo "Domaine de ".$ListDomaine[$i]["Utilisateur"]." : ".$ListDomaine[$i]["Adresse"];
|
||||
if ( is_writable("/var/www/vhost/".$ListDomaine[$i]["Utilisateur"]) )
|
||||
{
|
||||
|
||||
// Pr<50>paration des variables
|
||||
$Remplacement = array ();
|
||||
|
||||
if ( !empty($ListDomaine[$i]["MysqlDefaultHost"]) )
|
||||
{
|
||||
$Remplacement["{MYSQL_DEFAUT_HOST}"] = 'php_admin_value mysql.default_host "'.$ListDomaine[$i]["MysqlDefaultHost"].'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{MYSQL_DEFAUT_HOST}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["MysqlDefaultUser"]) )
|
||||
{
|
||||
$Remplacement["{MYSQL_DEFAUT_USER}"] = 'php_admin_value mysql.default_user "'.$ListDomaine[$i]["MysqlDefaultUser"].'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{MYSQL_DEFAUT_USER}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["MysqlDefaultPassword"]) )
|
||||
{
|
||||
$Remplacement["{MYSQL_DEFAUT_PASS}"] = 'php_admin_value mysql.default_password "'.$ListDomaine[$i]["MysqlDefaultPassword"].'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{MYSQL_DEFAUT_PASS}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["tmp"]) )
|
||||
{
|
||||
$Remplacement["{TMP_DIR}"] = 'php_admin_value upload_tmp_dir "/var/www/web/'.$ListDomaine[$i]["Utilisateur"].$ListDomaine[$i]["tmp"].'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{TMP_DIR}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["sessions"]) )
|
||||
{
|
||||
$Remplacement["{SESSION}"] = 'php_admin_value session.save_path "/var/www/web/'.$ListDomaine[$i]["Utilisateur"].$ListDomaine[$i]["sessions"].'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{SESSION}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["Short_Open_Tag"]) )
|
||||
{
|
||||
if ( $ListDomaine[$i]["Allow_url_fopen"] == "Oui") { $Reponse = "On" ; } else { $Reponse = "Off"; }
|
||||
$Remplacement["{SHORT_OPEN_TAG}"] = 'php_admin_value short_open_tag "'.$Reponse.'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{SHORT_OPEN_TAG}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["Allow_url_fopen"]) )
|
||||
{
|
||||
if ( $ListDomaine[$i]["Allow_url_fopen"] == "Oui") { $Reponse = "On" ; } else { $Reponse = "Off"; }
|
||||
$Remplacement["{URL_FOPEN}"] = 'php_admin_value allow_url_fopen "'.$Reponse.'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{URL_FOPEN}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["Allow_url_include"]) )
|
||||
{
|
||||
if ( $ListDomaine[$i]["Allow_url_include"] == "Oui") { $Reponse = "On" ; } else { $Reponse = "Off"; }
|
||||
$Remplacement["{URL_INCLUDE}"] = 'php_admin_value allow_url_include "'.$Reponse.'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{URL_INCLUDE}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["Session_auto_start"]) )
|
||||
{
|
||||
if ( $ListDomaine[$i]["Session_auto_start"] == "Oui") { $Reponse = "On" ; } else { $Reponse = "Off"; }
|
||||
$Remplacement["{SESSION_AUTO_START}"] = 'php_admin_value session.auto_start "'.$Reponse.'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{SESSION_AUTO_START}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["Magic_quotes_gpc"]) )
|
||||
{
|
||||
if ( $ListDomaine[$i]["Magic_quotes_gpc"] == "Oui") { $Reponse = "On" ; } else { $Reponse = "Off"; }
|
||||
$Remplacement["{MAGIC_QUOTE}"] = 'php_admin_value magic_quotes_gpc "'.$Reponse.'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{MAGIC_QUOTE}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["Register_globals"]) )
|
||||
{
|
||||
if ( $ListDomaine[$i]["Register_globals"] == "Oui") { $Reponse = "On" ; } else { $Reponse = "Off"; }
|
||||
$Remplacement["{REGISTER_GLOBAL}"] = 'php_admin_value register_globals "'.$Reponse.'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{REGISTER_GLOBAL}"] = "";
|
||||
}
|
||||
|
||||
if ( !empty($ListDomaine[$i]["DisplayErrors"]) )
|
||||
{
|
||||
if ( $ListDomaine[$i]["DisplayErrors"] == "Oui") { $Reponse = "On" ; } else { $Reponse = "Off"; }
|
||||
$Remplacement["{DISPLAY_ERROR}"] = 'php_admin_value display_errors "'.$Reponse.'"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{DISPLAY_ERROR}"] = "";
|
||||
}
|
||||
|
||||
if ( $ListDomaine[$i]["Listage"] == "Oui" )
|
||||
{
|
||||
$Remplacement["{INDEXE}"] = "Indexes";
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{INDEXE}"] = "-Indexes";
|
||||
}
|
||||
|
||||
$Remplacement["{DOMAINE}"] = $ListDomaine[$i]["Adresse"];
|
||||
$Remplacement["{CHEMIN}"] = "/var/www/web/".$ListDomaine[$i]["Utilisateur"].$ListDomaine[$i]["Racine"];
|
||||
$Remplacement["{BASEDIR}"] = "/var/www/web/".$ListDomaine[$i]["Utilisateur"].$ListDomaine[$i]["OpenBasedir"];
|
||||
|
||||
if ( $ListDomaine[$i]["Bridage"] == "Oui" )
|
||||
{
|
||||
$Remplacement["{BRIDAGE}"] = "CBandRemoteSpeed 50kb/s 3 3";
|
||||
}
|
||||
else
|
||||
{
|
||||
$Remplacement["{BRIDAGE}"] = "";
|
||||
}
|
||||
|
||||
$Fichier = file_get_contents("/var/www/daemon/system/vhost.tpl");
|
||||
$Vhost = str_replace (array_keys($Remplacement), array_values($Remplacement), $Fichier);
|
||||
|
||||
$AncienVhost = file_get_contents("/var/www/vhost/".$ListDomaine[$i]["Utilisateur"]);
|
||||
if ( $AncienVhost != FALSE )
|
||||
{
|
||||
$NouveauVhost = $AncienVhost.$Vhost."\n";
|
||||
$SuppressionVhost = unlink("/var/www/vhost/".$ListDomaine[$i]["Utilisateur"]);
|
||||
|
||||
if ( $SuppressionVhost != FALSE )
|
||||
{
|
||||
$EcritureNouveauVhost = file_put_contents("/var/www/vhost/".$ListDomaine[$i]["Utilisateur"], $NouveauVhost);
|
||||
if ( $EcritureNouveauVhost != FALSE )
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Update("domaine", array("Status", "Regeneration"), array("2", "Non"), "Adresse='".$ListDomaine[$i]["Adresse"]."'");
|
||||
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 5]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 4]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 3]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 2]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 1]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun domaine n'est en attente de cr<63>ation.\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
126
0.7.1/daemon/GestionFtp.php
Executable file
@@ -0,0 +1,126 @@
|
||||
<?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.
|
||||
*/
|
||||
/*
|
||||
[ERREUR 1] => L'utilisateur n'est pas trouv<75> dans la table utilisateur (afin de detecter le serveur de stockage)
|
||||
[ERREUR 2] => L'utilisateur n'a aucun serveur d'attribu<62>
|
||||
[ERREUR 3] => L'insertion dans la table accessible via proftpd <20> <20>chou<6F>
|
||||
[ERREUR 4] => La mise a jour du compte ftp sur le panel a <20>chou<6F>
|
||||
[ERREUR 5] => La suppression de la table accessible via proftpd <20> <20>chou<6F>
|
||||
[ERREUR 6] => La suppression du compte ftp sur le panel <20> <20>chou<6F>
|
||||
*/
|
||||
|
||||
// Annulation de la connexion MySql locale :
|
||||
$ConnexionLocale = "non";
|
||||
|
||||
// Inclusion du core
|
||||
require ('/var/www/daemon/system/core.php');
|
||||
|
||||
/* -------- */
|
||||
/* Cr<43>ation */
|
||||
/* -------- */
|
||||
$ListFtp = $ConnexionPanel->Select ("*", "ftp", "Status='1'", "", "", "", "");
|
||||
if ( $ListFtp != FALSE )
|
||||
{
|
||||
$CountFtp = count ($ListFtp);
|
||||
echo "\nCompte(s) en attente de cr<63>ation : ".$CountFtp."\n";
|
||||
|
||||
for ($i=0; $i < $CountFtp; $i++)
|
||||
{
|
||||
echo "Compte de ".$ListFtp[$i]["Utilisateur"]." : ".$ListFtp[$i]["Nom"];
|
||||
|
||||
$SelectServeur = $ConnexionPanel->Select ("*", "utilisateur", "Utilisateur='".$ListFtp[$i]["Utilisateur"]."'", "", "", "", "");
|
||||
if ( $SelectServeur != FALSE )
|
||||
{
|
||||
if ( !empty($SelectServeur[0]["ServeurFichier"]) )
|
||||
{
|
||||
$Champs = "userid, passwd, homedir, Server";
|
||||
$Valeurs = "'".$ListFtp[$i]["Nom"]."', ENCRYPT('".$ListFtp[$i]["Password"]."'), '/var/www/web/".$ListFtp[$i]["Utilisateur"].$ListFtp[$i]["Chemin"]."', '".$SelectServeur[0]["ServeurFichier"]."'";
|
||||
|
||||
$InsertFtp = $ConnexionSystem->Insert ($Champs, $Valeurs, "ftpuser");
|
||||
if ( $InsertFtp != FALSE )
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Update ("ftp", "Status", "2", "Nom='".$ListFtp[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 4]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 3]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 2]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 1]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun compte n'est en attente de cr<63>ation\n";
|
||||
}
|
||||
|
||||
/* ----------- */
|
||||
/* Suppression */
|
||||
/* ----------- */
|
||||
$ListFtp = $ConnexionPanel->Select ("*", "ftp", "Status='3'", "", "", "", "");
|
||||
if ( $ListFtp != FALSE )
|
||||
{
|
||||
$CountFtp = count ($ListFtp);
|
||||
echo "\nCompte(s) en attente de suppression : ".$CountFtp."\n";
|
||||
|
||||
for ($i=0; $i < $CountFtp; $i++)
|
||||
{
|
||||
echo "Compte de ".$ListFtp[$i]["Utilisateur"]." : ".$ListFtp[$i]["Nom"];
|
||||
|
||||
$SuppressionSystem = $ConnexionSystem->Delete ("ftpuser", "userid='".$ListFtp[$i]["Nom"]."'");
|
||||
if ( $SuppressionSystem != FALSE )
|
||||
{
|
||||
$SuppressionPanel = $ConnexionPanel->Delete ("ftp", "Nom='".$ListFtp[$i]["Nom"]."'");
|
||||
if ( $SuppressionPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 6]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 5]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun compte n'est en attente de supression\n";
|
||||
}
|
||||
|
||||
?>
|
||||
331
0.7.1/daemon/GestionMail.php
Executable file
@@ -0,0 +1,331 @@
|
||||
<?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.
|
||||
*/
|
||||
/*
|
||||
[ERREUR 1] => Erreur lors de la s<>lection du type dans la BDD
|
||||
[ERREUR 2] => Erreur lors de l'ajout d'un compte dans la BDD
|
||||
[ERREUR 3] => Erreur lors de la mise <20> jour du statut du compte dans la BDD
|
||||
[ERREUR 4] => Erreur lors de l'ajout d'un alias dans la BDD
|
||||
[ERREUR 5] => Erreur lors de la mise <20> jour du statut du compte dans la BDD
|
||||
[ERREUR 6] => Erreur lors de la suppression du domaine email dans la BDD
|
||||
[ERREUR 7] => Erreur lors de la s<>lection du type dans la BDD
|
||||
[ERREUR 8] => Erreur lors de la suppression du compte email dans la BDD
|
||||
[ERREUR 9] => Erreur lors de la suppression du dossier complet du domaine email
|
||||
[ERREUR 10] => Erreur lors de la suppression de l'entr<74>e compte dans la BDD
|
||||
[ERREUR 11] => Erreur lors de la suppression du domaine email dans la BDD
|
||||
[ERREUR 12] => Erreur lors de la suppression de l'alias email dans la BDD
|
||||
[ERREUR 13] => Erreur lors de la suppression de l'entr<74>e alias dans la BDD
|
||||
[ERREUR 14] => Le MX ne correspond pas.
|
||||
[ERREUR 15] => Erreur lors de la s<>lection du type dans la BDD.
|
||||
[ERREUR 16] => Erreur lors de l'ajout du domaine email dans la BDD.
|
||||
*/
|
||||
|
||||
// Annulation de la connexion MySql locale :
|
||||
$ConnexionLocale = "non";
|
||||
|
||||
// Inclusion du core
|
||||
require ('/var/www/daemon/system/core.php');
|
||||
|
||||
/* -------- */
|
||||
/* Cr<43>ation */
|
||||
/* -------- */
|
||||
$ListMail = $ConnexionPanel->Select ("*", "email", "Status='1'", "", "", "", "");
|
||||
if ( $ListMail != FALSE )
|
||||
{
|
||||
$CountMail = count ($ListMail);
|
||||
echo "\nCompte(s) ou alias en attente de cr<63>ation : ".$CountMail."\n";
|
||||
|
||||
for ($i=0; $i < $CountMail; $i++)
|
||||
{
|
||||
if ( $ListMail[$i]["Type"] == "alias" )
|
||||
{
|
||||
echo "Alias de ".$ListMail[$i]["Utilisateur"]." : ".$ListMail[$i]["Nom"];
|
||||
}
|
||||
elseif ( $ListMail[$i]["Type"] == "compte" )
|
||||
{
|
||||
echo "Compte de ".$ListMail[$i]["Utilisateur"]." : ".$ListMail[$i]["Nom"];
|
||||
}
|
||||
|
||||
$Email = explode ('@', $ListMail[$i]["Nom"]);
|
||||
$Domaine = $Email[1];
|
||||
$VerifMX = getmxrr($Domaine, $Mxhost, $MxWeight);
|
||||
if ( $VerifMX != FALSE )
|
||||
{
|
||||
$u=0;
|
||||
foreach ($Mxhost as $key => $value)
|
||||
{
|
||||
$ServeurMail[$value] = $MxWeight[$u];
|
||||
$u++;
|
||||
}
|
||||
asort($ServeurMail);
|
||||
|
||||
if ( (current(array_keys($ServeurMail)) == "mail.kelio.org") or (gethostbyname(current(array_keys($ServeurMail))) == gethostbyname("mail.kelio.org")) )
|
||||
{
|
||||
|
||||
//v<>rification du domaine dans la bdd
|
||||
$VerifMailDomain = $ConnexionPanel->Count("*", "email", "Nom LIKE '%@".$Domaine."' AND Status='2'");
|
||||
if ( $VerifMailDomain <= 0 ) { $VerifMailDomain = FALSE; } else { $VerifMailDomain = TRUE; }
|
||||
|
||||
if ( $ListMail[$i]["Type"] == "alias" )
|
||||
{
|
||||
$Champs = "source, destination";
|
||||
$Valeurs = "'".$ListMail[$i]["Nom"]."', '".$ListMail[$i]["Pointage"]."'";
|
||||
|
||||
$InsertMail = $ConnexionSystem->Insert($Champs, $Valeurs, "alias");
|
||||
if ( $InsertMail != FALSE )
|
||||
{
|
||||
|
||||
//si il n'y a pas de domaine
|
||||
if ( $VerifMailDomain == FALSE )
|
||||
{
|
||||
//on l'ajoute
|
||||
$InsertMailDomain = $ConnexionSystem->Insert("domain", "'".$Domaine."'", "domain");
|
||||
if ( $InsertMailDomain != FALSE )
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Update ("email", "Status", "2", "Nom='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 5]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 16]\n";
|
||||
}
|
||||
}
|
||||
// sinon on met <20> jour le panel
|
||||
else
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Update ("email", "Status", "2", "Nom='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 5]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 4]\n";
|
||||
}
|
||||
}
|
||||
elseif ( $ListMail[$i]["Type"] == "compte" )
|
||||
{
|
||||
$Champs = "email, password";
|
||||
$Valeurs = "'".$ListMail[$i]["Nom"]."', ENCRYPT('".$ListMail[$i]["Password"]."')";
|
||||
|
||||
$InsertMail = $ConnexionSystem->Insert($Champs, $Valeurs, "mailbox");
|
||||
if ( $InsertMail != FALSE )
|
||||
{
|
||||
if ( $VerifMailDomain == FALSE )
|
||||
{
|
||||
$InsertMailDomain = $ConnexionSystem->Insert("domain", "'".$Domaine."'", "domain");
|
||||
if ( $InsertMailDomain != FALSE )
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Update("email", "Status", "2", "Nom='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
$mail = "robot@kelio.org";
|
||||
mail ($ListMail[$i]['Nom'], 'Kelio.org - Cr<43>ation de votre compte email','Ce message confirme que votre adresse email '.$ListMail[$i]['Nom'].' a bien <20>t<EFBFBD> cr<63><72>e.', 'FROM: '.$mail);
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 3]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 16]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Update("email", "Status", "2", "Nom='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
$mail = "robot@kelio.org";
|
||||
mail ($ListMail[$i]['Nom'], 'Kelio.org - Cr<43>ation de votre compte email','Ce message confirme que votre adresse email '.$ListMail[$i]['Nom'].' a bien <20>t<EFBFBD> cr<63><72>e.', 'FROM: '.$mail);
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 3]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 2]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 1]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 14]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 15]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun compte ou alias en attente de cr<63>ation\n";
|
||||
}
|
||||
|
||||
/* ----------- */
|
||||
/* Suppression */
|
||||
/* ----------- */
|
||||
$ListMail = $ConnexionPanel->Select ("*", "email", "Status='3'", "", "", "", "");
|
||||
if ( $ListMail != FALSE )
|
||||
{
|
||||
$CountMail = count ($ListMail);
|
||||
echo "\nCompte(s) ou alias en attente de suppression : ".$CountMail."\n";
|
||||
|
||||
for ($i=0; $i < $CountMail; $i++)
|
||||
{
|
||||
$Email = explode ('@', $ListMail[$i]["Nom"]);
|
||||
$Domaine = $Email[1];
|
||||
$Nom = $Email[0];
|
||||
//v<>rifier si l'utilisateur n'a pas plusieurs adresses d<>j<EFBFBD> existantes sur le m<>me domaine!
|
||||
$VerifDomGeneral = $ConnexionPanel->Count("*", "email", "Nom LIKE '%@".$Domaine."'") - 1;
|
||||
$VerifDomCompte = $ConnexionPanel->Count("*", "email", "Nom LIKE '%@".$Domaine."' AND Type='compte'") - 1;
|
||||
|
||||
if ( $VerifDomGeneral <= 0 ) { $VerifDomGeneral = FALSE; } else { $VerifDomGeneral = TRUE; }
|
||||
if ( $VerifDomCompte <= 0 ) { $VerifDomCompte = FALSE; } else { $VerifDomCompte = TRUE; }
|
||||
|
||||
|
||||
if ( $ListMail[$i]["Type"] == "alias" )
|
||||
{
|
||||
echo "Alias de ".$ListMail[$i]["Utilisateur"]." : ".$ListMail[$i]["Nom"];
|
||||
|
||||
$DeleteMail = $ConnexionSystem->Delete ("alias", "source='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $DeleteMail != FALSE )
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Delete ("email", "Nom='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE AND $VerifDomGeneral == FALSE )
|
||||
{
|
||||
$SuppressionMailDomain = $ConnexionSystem->Delete ("domain", "domain='".$Domaine."'"); // Verifier si cette req != FALSE
|
||||
if ( $SuppressionMailDomain != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 11]\n";
|
||||
}
|
||||
}
|
||||
elseif ( $MajPanel != FALSE AND $VerifDomGeneral != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 13]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 12]\n";
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($ListMail[$i]["Type"] == "compte")
|
||||
{
|
||||
echo "Compte de ".$ListMail[$i]["Utilisateur"]." : ".$ListMail[$i]["Nom"];
|
||||
|
||||
$DeleteMail = $ConnexionSystem->Delete ("mailbox", "email='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $DeleteMail != FALSE )
|
||||
{
|
||||
shell_exec("rm -Rf /var/www/mail/".$Domaine."/".$Nom);
|
||||
$dossier = "/var/www/mail/".$Domaine."/";
|
||||
|
||||
if ( $VerifDomCompte != FALSE ) // Il reste encore des comptes
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Delete ("email", "Nom='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 10]\n";
|
||||
}
|
||||
}
|
||||
else // Il ne reste plus de comptes
|
||||
{
|
||||
|
||||
$DeleteAll = shell_exec("rm -Rf /var/www/mail/".$Domaine);
|
||||
|
||||
$MajPanel = $ConnexionPanel->Delete ("email", "Nom='".$ListMail[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
if ( $VerifDomGeneral == FALSE ) // Il n'y a plus d'alias
|
||||
{
|
||||
$SuppressionMailDomain = $ConnexionSystem->Delete ("domain", "domain='".$Domaine."'");
|
||||
if ( $SuppressionMailDomain != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 11]\n";
|
||||
}
|
||||
}// Il reste des alias
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 10]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 8]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 7]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun compte n'est en attente de suppression\n";
|
||||
}
|
||||
|
||||
?>
|
||||
154
0.7.1/daemon/GestionMysql.php
Executable file
@@ -0,0 +1,154 @@
|
||||
<?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.
|
||||
*/
|
||||
/*
|
||||
{ERREUR 1] => La base de donn<6E>es pour l'utilisateur n'a pu <20>tre cr<63><72>e.
|
||||
[ERREUR 2] => L'utilisateur pour la base de donn<6E>es n'a pu <20>tre cr<63><72>e.
|
||||
[ERREUR 3] => Les droits n'ont pu <20>tre mis sur l'utilisateur.
|
||||
[ERREUR 4] => La base de donn<6E>es n'a pu <20>tre mis a jour sur le panel.
|
||||
[ERREUR 5] => La base de donn<6E>es pour l'utilisateur n'a pu <20>tre supprim<69>.
|
||||
[ERREUR 6] => L'utilisateur pour la base de donn<6E>es n'a pu <20>tre supprim<69>.
|
||||
[ERREUR 7] => La base de donn<6E>es n'a pu etre supprim<69> sur le panel.
|
||||
*/
|
||||
|
||||
// Inclusion du core
|
||||
require ('/var/www/daemon/system/core.php');
|
||||
|
||||
/* -------- */
|
||||
/* Cr<43>ation */
|
||||
/* -------- */
|
||||
$ListBdd = $ConnexionPanel->Select("*", "basededonnee", "Status='1'", "", "", "", "");
|
||||
if ( $ListBdd != FALSE )
|
||||
{
|
||||
$CountBdd = count ($ListBdd);
|
||||
echo "\nBase(s) de donn<6E>es en attente de cr<63>ation : ".$CountBdd."\n";
|
||||
|
||||
if ( !empty($ServeurMySql) )
|
||||
{
|
||||
for ($i=0; $i < $CountBdd; $i++)
|
||||
{
|
||||
$DetecteServeur = $ConnexionPanel->Select ("*", "utilisateur", "Utilisateur='".$ListBdd[$i]["Utilisateur"]."'", "", "", "", "");
|
||||
if ( $DetecteServeur[0]["ServeurMysql"] == $ServeurMySql )
|
||||
{
|
||||
echo "Base de ".$ListBdd[$i]["Utilisateur"]." : ".$ListBdd[$i]["Nom"];
|
||||
|
||||
$CreationBdd = $ConnexionLocale->Query ('CREATE DATABASE '.$ListBdd[$i]["Nom"]);
|
||||
if ( $CreationBdd != FALSE )
|
||||
{
|
||||
$CreationUser = $ConnexionLocale->Query("CREATE USER '".$ListBdd[$i]["Nom"]."'@'%' IDENTIFIED BY '".$ListBdd[$i]["Password"]."'");
|
||||
if ( $CreationUser != FALSE )
|
||||
{
|
||||
$AttribueDroit = $ConnexionLocale->Query ("GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , INDEX , ALTER , CREATE TEMPORARY TABLES , CREATE VIEW , SHOW VIEW , CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON `".$ListBdd[$i]["Nom"]."`.* TO'".$ListBdd[$i]["Nom"]."'@'%'");
|
||||
if ( $AttribueDroit != FALSE )
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Update ("basededonnee", "Status", "2", "Nom='".$ListBdd[$i]["Nom"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 4]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 3]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 2]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 1]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Erreur : Aucun serveur MySql n'est d<>finit\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucune base de donn<6E>es n'est en attente de cr<63>ation\n";
|
||||
}
|
||||
|
||||
|
||||
/* ----------- */
|
||||
/* Suppression */
|
||||
/* ----------- */
|
||||
$ListBdd = $ConnexionPanel->Select("*", "basededonnee", "Status='3'", "", "", "", "");
|
||||
if ( $ListBdd != FALSE )
|
||||
{
|
||||
$CountBdd = count ($ListBdd);
|
||||
echo "\nBase(s) de donn<6E>es en attente de suppr<70>ssion : ".$CountBdd."\n";
|
||||
|
||||
if ( !empty($ServeurMySql) )
|
||||
{
|
||||
for ($i=0; $i < $CountBdd; $i++)
|
||||
{
|
||||
$DetecteServeur = $ConnexionPanel->Select ("*", "utilisateur", "Utilisateur='".$ListBdd[$i]["Utilisateur"]."'", "", "", "", "");
|
||||
if ( $DetecteServeur[0]["ServeurMysql"] == $ServeurMySql )
|
||||
{
|
||||
echo "Base de ".$ListBdd[$i]["Utilisateur"]." : ".$ListBdd[$i]["Nom"];
|
||||
|
||||
$SuppressionBdd = $ConnexionLocale->Query('DROP DATABASE '.$ListBdd[$i]["Nom"]);
|
||||
if ( $SuppressionBdd != FALSE )
|
||||
{
|
||||
$SuppressionUser = $ConnexionLocale->Query("DROP USER ".$ListBdd[$i]["Nom"]."@'%'");
|
||||
if ( $SuppressionUser != FALSE )
|
||||
{
|
||||
$MajPanel = $ConnexionPanel->Delete ('basededonnee', 'Nom="'.$ListBdd[$i]["Nom"].'"');
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 7]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 6]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 5]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Erreur : Aucun serveur MySql n'est d<>finit\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucune base de donn<6E>es n'est en attente de suppr<70>ssion\n";
|
||||
}
|
||||
|
||||
?>
|
||||
207
0.7.1/daemon/GestionTaille.php
Executable file
@@ -0,0 +1,207 @@
|
||||
<?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.
|
||||
*/
|
||||
/*
|
||||
[ERREUR 1] => Le dossier de l'utilisateur n'existe pas
|
||||
[ERREUR 2] => La commande pour <20>valuer la taille du fichier n'a pu etre execut<75>
|
||||
[ERREUR 3] => La modification de la chaine sortant de la commande d'evaluation de taille a <20>chou<6F>.
|
||||
[ERREUR 4] => Le fichier de logs de trafic ne peut etre lu (pas forcement une erreur)
|
||||
[ERREUR 5] => La mise a jour sur le panel a <20>chou<6F>.
|
||||
[ERREUR 6] => Le fichier de log n'a pu etre supprim<69>
|
||||
*/
|
||||
|
||||
|
||||
// Annulation de la connexion MySql locale :
|
||||
$ConnexionLocale = "non";
|
||||
|
||||
// Inclusion du core
|
||||
require ('/var/www/daemon/system/core.php');
|
||||
|
||||
|
||||
/* -------- */
|
||||
/* Espace */
|
||||
/* -------- */
|
||||
|
||||
echo "Mise a jour des quotas d'espace\n";
|
||||
$ListBdd = $ConnexionPanel->Select("*", "utilisateur", "ServeurFichier='".$ServeurFichier."'", "", "", "", "");
|
||||
if ( $ListBdd != FALSE )
|
||||
{
|
||||
$CountBdd = count ($ListBdd);
|
||||
|
||||
for ($i=0; $i < $CountBdd; $i++)
|
||||
{
|
||||
echo "Taille de ".$ListBdd[$i]["Utilisateur"]." : ";
|
||||
|
||||
if ( is_dir("/var/www/web/".$ListBdd[$i]["Utilisateur"]."/") )
|
||||
{
|
||||
$ExecTest = shell_exec("du -hcaL /var/www/web/".$ListBdd[$i]["Utilisateur"]."/ | grep -wv '/var/www/web/".$ListBdd[$i]["Utilisateur"]."/*'");
|
||||
if ( $ExecTest != FALSE )
|
||||
{
|
||||
|
||||
$Chiffre = explode ("\t", $ExecTest);
|
||||
$Chiffre = str_replace(",", ".", $Chiffre[0]);
|
||||
$Chiffre = trim ($Chiffre);
|
||||
|
||||
$MajPanel = $ConnexionPanel->Update ("utilisateur", "Espace", $Chiffre, "Utilisateur='".$ListBdd[$i]["Utilisateur"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 2]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 1]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun utilisateurs sur ".$ServeurFichier."\n";
|
||||
}
|
||||
|
||||
|
||||
/* ---------------- */
|
||||
/* Bande Passante */
|
||||
/* ---------------- */
|
||||
/*
|
||||
echo "\n\nMise a jour des quotas de bande passante\n";
|
||||
$ListBdd = $ConnexionPanel->Select("*", "utilisateur", "ServeurFichier='".$ServeurFichier."'", "", "", "", "");
|
||||
if ( $ListBdd != FALSE )
|
||||
{
|
||||
$CountBdd = count ($ListBdd);
|
||||
|
||||
for ($i=0; $i < $CountBdd; $i++)
|
||||
{
|
||||
|
||||
// Domaine kelio.org
|
||||
echo "Domaine de ".$ListBdd[$i]["Utilisateur"]." : ".$ListBdd[$i]["Utilisateur"].".kelio.org";
|
||||
if ( is_readable("/var/www/logs/trafic/".$ListBdd[$i]["Utilisateur"].".kelio.org.log") )
|
||||
{
|
||||
$Fichier = file ("/var/www/logs/trafic/".$ListBdd[$i]["Utilisateur"].".kelio.org.log");
|
||||
$Total = 0;
|
||||
|
||||
foreach ($Fichier as $key => $value)
|
||||
{
|
||||
$value = trim($value);
|
||||
|
||||
if ( is_numeric($value) )
|
||||
{
|
||||
$Total += $value;
|
||||
}
|
||||
}
|
||||
$Suppression = unlink ("/var/www/logs/trafic/".$ListBdd[$i]["Utilisateur"].".kelio.org.log");
|
||||
if ( $Suppression != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 6]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 4]\n";
|
||||
}
|
||||
|
||||
//Domaine externe
|
||||
$ListDomaine = $ConnexionPanel->Select("*", "domaine", "Utilisateur='".$ListBdd[$i]["Utilisateur"]."' AND Status='2'", "", "", "", "");
|
||||
if ( $ListDomaine != FALSE )
|
||||
{
|
||||
$CountDomaine = count($ListDomaine);
|
||||
|
||||
for ($o=0; $o < $CountDomaine; $o++)
|
||||
{
|
||||
sleep (1);
|
||||
echo "Domaine de ".$ListDomaine[$o]["Utilisateur"]." : ".$ListDomaine[$o]["Adresse"];
|
||||
|
||||
if ( is_readable("/var/www/logs/trafic/".$ListDomaine[$o]["Adresse"].".log") )
|
||||
{
|
||||
$Fichier = file ("/var/www/logs/trafic/".$ListDomaine[$o]["Adresse"].".log");
|
||||
foreach ($Fichier as $key => $value)
|
||||
{
|
||||
$value = trim($value);
|
||||
|
||||
if ( is_numeric($value) )
|
||||
{
|
||||
$Total += $value;
|
||||
}
|
||||
}
|
||||
$Suppression = unlink ("/var/www/logs/trafic/".$ListDomaine[$o]["Adresse"].".log");
|
||||
if ( $Suppression != FALSE)
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 6]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 4]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Convertion et mise a jour du panel
|
||||
$Total = ($Total / 1024) / 1024;
|
||||
$Total = $ListBdd[$i]["BandePassante"] + $Total;
|
||||
|
||||
$MajPanel = $ConnexionPanel->Update ("utilisateur", "BandePassante", round($Total, 1), "Utilisateur='".$ListBdd[$i]["Utilisateur"]."'");
|
||||
if ( $MajPanel != FALSE )
|
||||
{
|
||||
echo "Domaines de ".$ListBdd[$i]["Utilisateur"]."\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Domaines de ".$ListBdd[$i]["Utilisateur"]."\t\t\t[ERREUR 5]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Aucun utilisateurs sur ".$ServeurFichier."\n";
|
||||
}
|
||||
*/
|
||||
|
||||
/* -------------- */
|
||||
/* RECHARGEMENT */
|
||||
/* -------------- */
|
||||
/*
|
||||
$Commande = shell_exec("sudo /etc/init.d/apache2 reload");
|
||||
if ( $Commande != FALSE )
|
||||
{
|
||||
echo "Rechargement d'apache : \t\t\t[OK]\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Rechargement d'apache : \t\t\t[ERREUR]\n\n";
|
||||
}
|
||||
*/
|
||||
|
||||
?>
|
||||
71
0.7.1/daemon/OutilVhost.php
Executable file
@@ -0,0 +1,71 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
// Annulation de la connexion MySql locale :
|
||||
$ConnexionLocale = "non";
|
||||
|
||||
// Inclusion du core
|
||||
require ('system/core.php');
|
||||
|
||||
$ListUser = $ConnexionPanel->Select ("*", "utilisateur", "", "", "", "", "");
|
||||
if ( $ListUser != FALSE )
|
||||
{
|
||||
$CountUser = count($ListUser);
|
||||
|
||||
for ($i=0; $i < $CountUser; $i++)
|
||||
{
|
||||
echo "Vhost de ".$ListUser[$i]["Utilisateur"];
|
||||
|
||||
$Vhost = '
|
||||
|
||||
#DEBUT: '.$ListUser[$i]["Utilisateur"].'.kelio.org
|
||||
<VirtualHost *>
|
||||
<Directory "/var/www/web/'.$ListUser[$i]["Utilisateur"].'/public/">
|
||||
AllowOverride All
|
||||
Options -ExecCGI -MultiViews SymLinksIfOwnerMatch -Indexes
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
ServerName '.$ListUser[$i]["Utilisateur"].'.kelio.org
|
||||
DocumentRoot /var/www/web/'.$ListUser[$i]["Utilisateur"].'/public/
|
||||
php_admin_value open_basedir "/var/www/web/'.$ListUser[$i]["Utilisateur"].'/public/:/tmp/"
|
||||
ErrorLog /var/www/logs/error/'.$ListUser[$i]["Utilisateur"].'.kelio.org.log
|
||||
CustomLog /var/www/logs/access/'.$ListUser[$i]["Utilisateur"].'.kelio.org.log combined
|
||||
CustomLog /var/www/logs/trafic/'.$ListUser[$i]["Utilisateur"].'.kelio.org.log trafic
|
||||
CBandRemoteSpeed 50kb/s 3 3
|
||||
</VirtualHost>
|
||||
#FIN: '.$ListUser[$i]["Utilisateur"].'.kelio.org
|
||||
|
||||
';
|
||||
|
||||
$InsertVhost = file_put_contents("/var/www/vhost/".$ListUser[$i]["Utilisateur"],$Vhost);
|
||||
sleep(0.5);
|
||||
if ( $InsertVhost != FALSE )
|
||||
{
|
||||
echo "\t\t\t[OK]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "\t\t\t[ERREUR 1]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
282
0.7.1/daemon/system/class.mysql.php
Executable file
@@ -0,0 +1,282 @@
|
||||
<?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);
|
||||
}
|
||||
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 false;
|
||||
//return mysql_error();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
//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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function Query ($query)
|
||||
{
|
||||
if ($this->id_connect != false)
|
||||
{
|
||||
$res=mysql_query($query);
|
||||
if ($res != false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private $db;
|
||||
public $id_connect;
|
||||
public $total_req = 0;
|
||||
}
|
||||
|
||||
?>
|
||||
97
0.7.1/daemon/system/core.php
Executable file
@@ -0,0 +1,97 @@
|
||||
<?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.
|
||||
*/
|
||||
// Fichier Core : Inclusion et connexion a MySql
|
||||
|
||||
// Inclusion de la class mysql
|
||||
require ('system/class.mysql.php');
|
||||
|
||||
// D<>claration du serveur :
|
||||
$ServeurFichier = "";
|
||||
$ServeurMySql = "";
|
||||
|
||||
// Base de donn<6E>es Panel :
|
||||
$Connexion["Panel"]["Serveur"] = "";
|
||||
$Connexion["Panel"]["Login"] = "root_panel";
|
||||
$Connexion["Panel"]["Database"] = "root_panel";
|
||||
$Connexion["Panel"]["Passwd"] = "";
|
||||
|
||||
// Base de donn<6E>es System :
|
||||
$Connexion["System"]["Serveur"] = "";
|
||||
$Connexion["System"]["Login"] = "root_system";
|
||||
$Connexion["System"]["Database"] = "root_system";
|
||||
$Connexion["System"]["Passwd"] = "";
|
||||
|
||||
// Identifiant serveur local (Uniquement si un serveur MySql est d<>finit) :
|
||||
$Connexion["Local"]["Serveur"] = "";
|
||||
$Connexion["Local"]["Login"] = "";
|
||||
$Connexion["Local"]["Database"] = "";
|
||||
$Connexion["Local"]["Passwd"] = "";
|
||||
|
||||
|
||||
/* ---------------------------------------- */
|
||||
/* ---------------------------------------- */
|
||||
/* ---------------------------------------- */
|
||||
|
||||
// Afficharge de l'heure
|
||||
echo "---------------------------\n";
|
||||
echo "--> ".date ("d-m-Y H:i:s")." <--\n";
|
||||
echo "---------------------------\n\n";
|
||||
|
||||
// Connexion MySql au panel :
|
||||
$ConnexionPanel = new MySql ($Connexion["Panel"]["Serveur"], $Connexion["Panel"]["Database"], $Connexion["Panel"]["Login"], $Connexion["Panel"]["Passwd"]);
|
||||
if ( $ConnexionPanel->id_connect == FALSE )
|
||||
{
|
||||
die ("Erreur : Connexion a la bdd panel <20>chou<6F>");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Connexion a la bdd panel reussie\n";
|
||||
}
|
||||
|
||||
// Connexion MySql au system :
|
||||
$ConnexionSystem = new MySql ($Connexion["System"]["Serveur"], $Connexion["System"]["Database"], $Connexion["System"]["Login"], $Connexion["System"]["Passwd"]);
|
||||
if ( $ConnexionSystem->id_connect == FALSE )
|
||||
{
|
||||
die ("Erreur : Connexion a la bdd system <20>chou<6F>");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Connexion a la bdd system reussie\n";
|
||||
}
|
||||
|
||||
// Connexion au serveur MySql local :
|
||||
if ( !empty($ServeurMySql) )
|
||||
{
|
||||
if ( !isset($ConnexionLocale) )
|
||||
{
|
||||
$ConnexionLocale = new MySql ($Connexion["Local"]["Serveur"], $Connexion["Local"]["Database"], $Connexion["Local"]["Login"], $Connexion["Local"]["Passwd"]);
|
||||
if ( $ConnexionLocale->id_connect == FALSE )
|
||||
{
|
||||
die ("Erreur : Connexion au serveur MySql local <20>chou<6F>");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Connexion au serveur MySql local reussie\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "---------------------------\n\n";
|
||||
|
||||
?>
|
||||
38
0.7.1/daemon/system/vhost.tpl
Executable file
@@ -0,0 +1,38 @@
|
||||
|
||||
#DEBUT: {DOMAINE}
|
||||
<VirtualHost *>
|
||||
|
||||
<Directory "{CHEMIN}">
|
||||
AllowOverride All
|
||||
Options -ExecCGI -MultiViews SymLinksIfOwnerMatch {INDEXE}
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
ServerName {DOMAINE}
|
||||
DocumentRoot {CHEMIN}
|
||||
|
||||
#Configuration PHP
|
||||
php_admin_value open_basedir "{BASEDIR}:/tmp/"
|
||||
{MYSQL_DEFAUT_HOST}
|
||||
{MYSQL_DEFAUT_USER}
|
||||
{MYSQL_DEFAUT_PASS}
|
||||
{TMP_DIR}
|
||||
{SESSION}
|
||||
{URL_FOPEN}
|
||||
{URL_INCLUDE}
|
||||
{DISPLAY_ERROR}
|
||||
{SHORT_OPEN_TAG}
|
||||
{SESSION_AUTO_START}
|
||||
{MAGIC_QUOTE}
|
||||
{REGISTER_GLOBAL}
|
||||
|
||||
# Logs
|
||||
ErrorLog /var/www/logs/error/{DOMAINE}.log
|
||||
CustomLog /var/www/logs/access/{DOMAINE}.log combined
|
||||
CustomLog /var/www/logs/trafic/{DOMAINE}.log trafic
|
||||
|
||||
#Bridage
|
||||
{BRIDAGE}
|
||||
|
||||
</VirtualHost>
|
||||
#FIN: {DOMAINE}
|
||||
8
0.7.1/panel/.htaccess
Executable file
@@ -0,0 +1,8 @@
|
||||
RewriteEngine on
|
||||
|
||||
RewriteRule ^Page\.html$ mainpage.php [L]
|
||||
RewriteRule ^Page-([a-zA-Z]+)\.html$ mainpage.php?id=$1 [L]
|
||||
RewriteRule ^Page-([a-zA-Z]+)-([a-zA-Z0-9]+)\.html$ mainpage.php?id=$1&ids=$2 [L]
|
||||
RewriteRule ^resultat\.html$ resultat.php [L]
|
||||
|
||||
RewriteRule ^execution-([0-9]+)\.html$ traitement.php?id=$1 [L]
|
||||
BIN
0.7.1/panel/image/assistance.png
Executable file
|
After Width: | Height: | Size: 11 KiB |
BIN
0.7.1/panel/image/background.png
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
0.7.1/panel/image/ban_azote.gif
Executable file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
0.7.1/panel/image/body.png
Executable file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
0.7.1/panel/image/cd_body.gif
Executable file
|
After Width: | Height: | Size: 119 B |
BIN
0.7.1/panel/image/cd_body.png
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
0.7.1/panel/image/cd_footer.gif
Executable file
|
After Width: | Height: | Size: 285 B |
BIN
0.7.1/panel/image/cd_footer.png
Executable file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
0.7.1/panel/image/cd_head.gif
Executable file
|
After Width: | Height: | Size: 835 B |
BIN
0.7.1/panel/image/cd_head.png
Executable file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
0.7.1/panel/image/chargement.gif
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
0.7.1/panel/image/corner_bottom_left.gif
Executable file
|
After Width: | Height: | Size: 172 B |
BIN
0.7.1/panel/image/corner_bottom_right.gif
Executable file
|
After Width: | Height: | Size: 170 B |
BIN
0.7.1/panel/image/corner_top_left.gif
Executable file
|
After Width: | Height: | Size: 168 B |
BIN
0.7.1/panel/image/corner_top_right.gif
Executable file
|
After Width: | Height: | Size: 170 B |
BIN
0.7.1/panel/image/design/body.png
Executable file
|
After Width: | Height: | Size: 227 B |
BIN
0.7.1/panel/image/design/bouton_off.png
Executable file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
0.7.1/panel/image/design/bouton_on.png
Executable file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
0.7.1/panel/image/design/corner_bottom_left.gif
Executable file
|
After Width: | Height: | Size: 194 B |
BIN
0.7.1/panel/image/design/corner_bottom_right.gif
Executable file
|
After Width: | Height: | Size: 193 B |
BIN
0.7.1/panel/image/design/corner_top_left.gif
Executable file
|
After Width: | Height: | Size: 192 B |
BIN
0.7.1/panel/image/design/corner_top_right.gif
Executable file
|
After Width: | Height: | Size: 196 B |
BIN
0.7.1/panel/image/design/fond.png
Executable file
|
After Width: | Height: | Size: 286 B |
BIN
0.7.1/panel/image/design/footer.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
0.7.1/panel/image/design/head_d.png
Executable file
|
After Width: | Height: | Size: 16 KiB |
BIN
0.7.1/panel/image/design/head_g.png
Executable file
|
After Width: | Height: | Size: 44 KiB |
BIN
0.7.1/panel/image/design/list-off.gif
Executable file
|
After Width: | Height: | Size: 37 B |
BIN
0.7.1/panel/image/design/list-on.gif
Executable file
|
After Width: | Height: | Size: 37 B |
BIN
0.7.1/panel/image/design/logo_3d.gif
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
0.7.1/panel/image/design/logo_3d.png
Executable file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
0.7.1/panel/image/design/menu_body.gif
Executable file
|
After Width: | Height: | Size: 122 B |
BIN
0.7.1/panel/image/design/menu_d.png
Executable file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
0.7.1/panel/image/design/menu_footer.gif
Executable file
|
After Width: | Height: | Size: 285 B |
BIN
0.7.1/panel/image/design/menu_g.png
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
0.7.1/panel/image/design/menu_head.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
0.7.1/panel/image/design/rss.gif
Executable file
|
After Width: | Height: | Size: 652 B |
BIN
0.7.1/panel/image/design/shead.png
Executable file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
0.7.1/panel/image/design/shead_b1.png
Executable file
|
After Width: | Height: | Size: 896 B |
BIN
0.7.1/panel/image/design/shead_b2.png
Executable file
|
After Width: | Height: | Size: 688 B |
BIN
0.7.1/panel/image/design/shead_form.png
Executable file
|
After Width: | Height: | Size: 181 B |
BIN
0.7.1/panel/image/exemple.png
Executable file
|
After Width: | Height: | Size: 47 KiB |
BIN
0.7.1/panel/image/favicon.png
Executable file
|
After Width: | Height: | Size: 569 B |
BIN
0.7.1/panel/image/footer.png
Executable file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
0.7.1/panel/image/head_d.png
Executable file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
0.7.1/panel/image/head_g.png
Executable file
|
After Width: | Height: | Size: 40 KiB |
BIN
0.7.1/panel/image/head_shop.png
Executable file
|
After Width: | Height: | Size: 11 KiB |
BIN
0.7.1/panel/image/icons/16-member-profile.png
Executable file
|
After Width: | Height: | Size: 398 B |
BIN
0.7.1/panel/image/icons/application_home.png
Executable file
|
After Width: | Height: | Size: 685 B |
BIN
0.7.1/panel/image/icons/arrow_refresh.png
Executable file
|
After Width: | Height: | Size: 685 B |
BIN
0.7.1/panel/image/icons/book_open.png
Executable file
|
After Width: | Height: | Size: 622 B |
BIN
0.7.1/panel/image/icons/cog.png
Executable file
|
After Width: | Height: | Size: 512 B |
BIN
0.7.1/panel/image/icons/cube_green.png
Executable file
|
After Width: | Height: | Size: 313 B |
BIN
0.7.1/panel/image/icons/database.png
Executable file
|
After Width: | Height: | Size: 390 B |
BIN
0.7.1/panel/image/icons/em-check.png
Executable file
|
After Width: | Height: | Size: 194 B |
BIN
0.7.1/panel/image/icons/em-cross.png
Executable file
|
After Width: | Height: | Size: 177 B |
BIN
0.7.1/panel/image/icons/em-plus.png
Executable file
|
After Width: | Height: | Size: 222 B |
BIN
0.7.1/panel/image/icons/email.png
Executable file
|
After Width: | Height: | Size: 641 B |
BIN
0.7.1/panel/image/icons/file-archive.png
Executable file
|
After Width: | Height: | Size: 293 B |
BIN
0.7.1/panel/image/icons/group.png
Executable file
|
After Width: | Height: | Size: 753 B |
BIN
0.7.1/panel/image/icons/house.png
Executable file
|
After Width: | Height: | Size: 806 B |
BIN
0.7.1/panel/image/icons/house_go.png
Executable file
|
After Width: | Height: | Size: 861 B |
BIN
0.7.1/panel/image/icons/message-info.png
Executable file
|
After Width: | Height: | Size: 746 B |
BIN
0.7.1/panel/image/icons/message-warn.png
Executable file
|
After Width: | Height: | Size: 536 B |
BIN
0.7.1/panel/image/icons/question.png
Executable file
|
After Width: | Height: | Size: 682 B |
BIN
0.7.1/panel/image/icons/stop.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
0.7.1/panel/image/icons/tick.png
Executable file
|
After Width: | Height: | Size: 537 B |
BIN
0.7.1/panel/image/icons/user_comment.png
Executable file
|
After Width: | Height: | Size: 743 B |
BIN
0.7.1/panel/image/icons/wrench.png
Executable file
|
After Width: | Height: | Size: 610 B |
BIN
0.7.1/panel/image/list-active.gif
Executable file
|
After Width: | Height: | Size: 51 B |
BIN
0.7.1/panel/image/list-off.gif
Executable file
|
After Width: | Height: | Size: 37 B |
BIN
0.7.1/panel/image/list-on.gif
Executable file
|
After Width: | Height: | Size: 37 B |
BIN
0.7.1/panel/image/logo_3d-2.png
Executable file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
0.7.1/panel/image/menu_h.png
Executable file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
0.7.1/panel/image/menu_h_over.png
Executable file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
0.7.1/panel/image/result_bottom.png
Executable file
|
After Width: | Height: | Size: 260 B |
BIN
0.7.1/panel/image/result_top.png
Executable file
|
After Width: | Height: | Size: 517 B |
BIN
0.7.1/panel/image/sbt_lg.png
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
0.7.1/panel/image/shead_d.png
Executable file
|
After Width: | Height: | Size: 20 KiB |
BIN
0.7.1/panel/image/shead_g.png
Executable file
|
After Width: | Height: | Size: 14 KiB |
BIN
0.7.1/panel/image/smiley/Thumbs.db
Executable file
BIN
0.7.1/panel/image/smiley/content.gif
Executable file
|
After Width: | Height: | Size: 699 B |
BIN
0.7.1/panel/image/smiley/genial.gif
Executable file
|
After Width: | Height: | Size: 696 B |
BIN
0.7.1/panel/image/smiley/hmm.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
0.7.1/panel/image/smiley/oeil.gif
Executable file
|
After Width: | Height: | Size: 698 B |
BIN
0.7.1/panel/image/smiley/sifflote.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
0.7.1/panel/image/sshead.png
Executable file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
0.7.1/panel/image/sshead_b1.png
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
0.7.1/panel/image/sshead_b2.png
Executable file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
0.7.1/panel/image/valid-xhtml10.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |