From 8ebd61261f182098f67299fbf376889922c154ac Mon Sep 17 00:00:00 2001 From: Julien Simonet Date: Mon, 20 Jan 2014 19:45:48 +0100 Subject: [PATCH] Ajout du TLD contenu dans le fichier de configuration. Suppression des possibles "point" doublons. - si l'utilisateur entre "mondomaine." par exempe. --- www/conf/config.ini | 11 +++++++++-- www/lib/DNSManager.pm | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/www/conf/config.ini b/www/conf/config.ini index f4d9df0..3772c75 100644 --- a/www/conf/config.ini +++ b/www/conf/config.ini @@ -1,11 +1,18 @@ +# TLD +# Must contains the first "." +tld = ".netlib.re" + +# Database Options +sgbd = mysql dbname = dnsmanager host = localhost -# other options : see DBI module -sgbd = mysql + # default port for mysql port = 3306 user = bla passwd = HardPass4bla +# other options : see DBI module + # possible options for dnsserver : bind rndc dnsapp = rndc zones_path = "/srv/named/" diff --git a/www/lib/DNSManager.pm b/www/lib/DNSManager.pm index 193e9a6..592a196 100644 --- a/www/lib/DNSManager.pm +++ b/www/lib/DNSManager.pm @@ -137,6 +137,10 @@ prefix '/domain' => sub { else { + # Add tld + my $domain = param('domain').$cfg->param('tld'); + $domain =~ s/\.{2,}/\./g; + # create domain my $app = initco(); $app->add_domain( session('login'), param('domain') ); redirect '/home';