Migration
This commit is contained in:
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');
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user