From d2c5c6381155e09da1b995b16cb9d964a0a05e24 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Mon, 27 Aug 2007 07:19:10 +0000 Subject: [PATCH] parameter checking in subdomain creation, + translations added in dom_subdodel.php --- bureau/admin/dom_subdodel.php | 6 +++--- bureau/class/functions.php | 22 +++++++++----------- bureau/class/m_dom.php | 4 +++- bureau/locales/en_US/LC_MESSAGES/manual.po | 14 ++++++------- bureau/locales/fr_FR/LC_MESSAGES/messages.po | 5 +++++ debian/changelog | 1 + 6 files changed, 29 insertions(+), 23 deletions(-) diff --git a/bureau/admin/dom_subdodel.php b/bureau/admin/dom_subdodel.php index c2c868f1..bf9722f4 100644 --- a/bureau/admin/dom_subdodel.php +++ b/bureau/admin/dom_subdodel.php @@ -41,15 +41,15 @@ include("head.php"); ?> -

Suppression du sous-domaine http:// :

+

$error

"; exit(); } else { - echo "

Le sous-domaine a ete supprime, les modifications seront prises en comptes dans 5 minutes.

"; + echo "

"._("The subdomain has been deleted. Changes will take place in 5 minutes.")."

"; } ?> -

Continuer

+

diff --git a/bureau/class/functions.php b/bureau/class/functions.php index e46ef993..f5b76322 100644 --- a/bureau/class/functions.php +++ b/bureau/class/functions.php @@ -165,23 +165,21 @@ function checkfqdn($fqdn) { // Retourne 0 si tout va bien, sinon, retourne un code erreur... // 1. Nom de domaine complet trop long. // 2. L'un des membres est trop long. - // 3. Caract?re interdit dans l'un des membres. + // 3. Caractere interdit dans l'un des membres. + // 4. Le fqdn ne fait qu'un seul membre (il n'est donc pas fq...) if (strlen($fqdn)>255) return 1; $members=explode(".", $fqdn); - if (count($members)>1) { - reset($members); - while (list ($key, $val) = each ($members)) { - if (strlen($val)>63) - return 2; - if (!eregi("^[a-z0-9][a-z0-9-]*[a-z0-9]$",$val)) { - /*"*/ return 3; - } + if (count($members)>1) $ret=0; else $ret=4; + reset($members); + while (list ($key, $val) = each ($members)) { + if (strlen($val)>63) + return 2; + if (!eregi("^[a-z0-9][a-z0-9-]*[a-z0-9]$",$val)) { + /*"*/ return 3; } - } else { - return 4; } - return 0; + return $ret; } function checkuserpath($path) { diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index d64b1e15..e99b1721 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -631,11 +631,13 @@ class m_dom { return false; } $dest=trim($dest); + $sub=trim(trim($sub),"."); $dom=strtolower($dom); $sub=strtolower($sub); // if (!(($sub == '*') || ($sub=="") || (preg_match('/([a-z0-9][\.\-a-z0-9]*)?[a-z0-9]/', $sub)))) { - if (($sub != '*') && checkfqdn($sub)) { + $fqdn=checkfqdn($sub); + if (($sub != '*') && !($fqdn==0 || $fqdn==4)) { $err->raise("dom",24); return false; } diff --git a/bureau/locales/en_US/LC_MESSAGES/manual.po b/bureau/locales/en_US/LC_MESSAGES/manual.po index 0f410b5a..3ddae97b 100644 --- a/bureau/locales/en_US/LC_MESSAGES/manual.po +++ b/bureau/locales/en_US/LC_MESSAGES/manual.po @@ -860,7 +860,7 @@ msgstr "The requested raw statistic set has not been found." #~ msgid "No files in this folder" #~ msgstr "No files in this folder" -msgid "help_dns_mx" +msgid "help_dns_mx %s %s" msgstr "" "If we manage your DNS
You can manage your mails elsewhere if you " "want (MX field).
Write %s in this field if your " @@ -872,11 +872,11 @@ msgid "help_dns_mail" msgstr "" "If we don't manage the DNS for this domain
do we manage your mails?" -#~ msgid "help_domain_del" -#~ msgstr "" -#~ "If you want to delete the domain %s, click the button below.Warning : " -#~ "this delete all the ftp, mails, mailing-lists ... associated with " -#~ "thisdomain and all its subdomains!" +msgid "help_domain_del %s" +msgstr "" +"If you want to delete the domain %s, click the button below.Warning : " +"this delete all the ftp, mails, mailing-lists ... associated with " +"thisdomain and all its subdomains!" #~ msgid "Domain hosting" #~ msgstr "Domain hosting" @@ -1192,7 +1192,7 @@ msgstr "" msgid "help_sql_list_ok" msgstr "" "You can create various databases
Click on 'SQL Admin' in the menu to " -manage them
or use the table below to backup, retrieve or delete " +"manage them
or use the table below to backup, retrieve or delete " "them:" msgid "help_sql_list_no" diff --git a/bureau/locales/fr_FR/LC_MESSAGES/messages.po b/bureau/locales/fr_FR/LC_MESSAGES/messages.po index 3576632c..bc308e73 100644 --- a/bureau/locales/fr_FR/LC_MESSAGES/messages.po +++ b/bureau/locales/fr_FR/LC_MESSAGES/messages.po @@ -2211,3 +2211,8 @@ msgstr "Nouveau nom : " msgid "Image_Graph not installed. use 'aptitude install php-pear' then 'pear --alldeps install Image_Graph-devel' to see the graph." msgstr "Image_Graph n'est pas installée. Lancez 'aptitude install php-pear' puis 'pear --alldeps install Image_Graph-devel' pour voir le graphique." +msgstr "The subdomain has been deleted. Changes will take place in 5 minutes." +msgid "Le sous-domaine a ete supprime, les modifications seront prises en comptes dans 5 minutes." + +msgstr "Deleting the subdomain %s:" +msgid "Effacement du sous-domaine %s : " diff --git a/debian/changelog b/debian/changelog index 21117a95..d83f8a66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ alternc (0.9.6.5) testing; urgency=low + * parameter checking in subdomain creation (#1037) * Changing ownership of /var/alternc/tmp, makes file upload work again (#1058) * Force the restart of apache & apache-ssl (#1000) * Redirect are now done on http://$url$1 base, not $url/$1 (#1054)