diff -Nur smeserver-ddclient-1.2.1.bz8961.old/createlinks smeserver-ddclient-1.2.1.bz8961/createlinks
--- smeserver-ddclient-1.2.1.bz8961.old/createlinks 2015-07-07 00:04:46.528387351 +0200
+++ smeserver-ddclient-1.2.1.bz8961/createlinks 2015-07-10 14:39:00.481270709 +0200
@@ -8,15 +8,15 @@
my $event = 'ddclient';
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ddclient");
- templates2events("/etc/ddclient.conf", $event);
+ templates2events("/etc/ddclient/ddclient.conf", $event);
$event = 'domain-delete';
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ddclient");
- templates2events("/etc/ddclient.conf", $event);
+ templates2events("/etc/ddclient/ddclient.conf", $event);
$event = 'domain-modify';
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ddclient");
- templates2events("/etc/ddclient.conf", $event);
+ templates2events("/etc/ddclient/ddclient.conf", $event);
$event = 'post-upgrade';
templates2events("/etc/ddclient.conf", $event);
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/ddclient smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/ddclient
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/ddclient 2015-07-07 00:04:46.527387281 +0200
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/ddclient 2015-07-10 15:41:22.479300535 +0200
@@ -241,7 +241,68 @@
SPDNS (spdns.de) dynamic adresses
+ CUSTOMDNS
+ Custom Dynamic DNS Provider
+
+
+ CUSTOMDNS_LABEL
+ Custom server Address
+
+
+ CUSTOM_PROTOCOL_LABEL
+ Custom ddclient Protocol
+
+
+ CUSTOM_DESCRIPTION
+ You can use a custom dynamic dns provider if yours is not in the published list. Please fill the custom fields with the appropriate settings
+
+
+ CUSTOMDNS_VALIDATION_ERROR
+
+ Error: unexpected or missing characters in custom server address field of domain
+ {$domainName}. The server address should contain one or more
+ letters, numbers, periods and minus signs. Did not apply the change.
+
+
+
ddclient
Dynamic Clients
+
+ DOMAIN_NAME_ALREADY_EXIST
+ Error: this domain:"{$domainName}" already exists. Please chose another.
+
+
+
+ FREE_FORM_DESCRIPTION
+ Here you can create any domain name to publish over the net.
+
+
+ RETRIEVE_SSL
+ SSL update
+
+
+ RETRIEVE_DEAMONUPDATE
+ Deamon update (seconds)
+
+
+ RETRIEVE_URLCHECKIP
+ Url for the external IP
+
+
+ APPLY
+ Save
+
+
+ DOMAIN_NAME_LABEL
+ Domain Name
+
+
+ DESCRIPTION_LABEL
+ Domain description
+
+
+ SUCCESSFULLY_MODIFIED_RETRIEVE_IP
+ You have successfully modified the retrieve IP options.
+
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers 1970-01-01 01:00:00.000000000 +0100
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers 2015-07-10 14:59:35.674527582 +0200
@@ -0,0 +1,13 @@
+ {
+ my $deamonupdate = ${ddclient}{DeamonUpdate} || '300';
+ my $ssl = ${ddclient}{SSL} || 'yes';
+ $OUT .= qq(
+daemon=$deamonupdate # check every $deamonupdate seconds
+syslog=yes # log update msgs to syslog
+mail=admin # mail update msgs to admin
+mail-failure=admin
+pid=/var/run/ddclient.pid # record PID in file.
+ssl=$ssl
+#);
+ }
+
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration 1970-01-01 01:00:00.000000000 +0100
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration 2015-07-07 00:07:17.215743624 +0200
@@ -0,0 +1,186 @@
+{
+ use esmith::DomainsDB;
+
+ $OUT='';
+
+ my $ddb = esmith::DomainsDB->open_ro();
+
+ $OUT .="use=web, web=$ddclient{'urlcheckip'}\/, web-skip='IP Address:' \n";
+
+ for my $edom ( $ddb->domains )
+ {
+ {
+
+ my $dns = $edom->prop('dns') || '';
+ next if ($dns eq '');
+ $dns =~ tr/a-z/A-Z/;
+ my $login = $edom->prop('login');
+ my $password = $edom->prop('password');
+ my $customdns = $edom->prop('customdns') || '';
+ my $customprotocol = $edom->prop('customprotocol') || '';
+ my $pubserv='';
+ my $static='';
+ my $custom='';
+ my $wildcard='';
+ my $mx=$edom->prop('mx') || '';
+ my $backupmx='';
+ my $protocol='';
+ my $explain='';
+
+ if( $dns eq 'DYNDNS1')
+ {
+ $explain='## dyndns.org dynamic addresses';
+ $pubserv ='members.dyndns.org';
+ $protocol='dyndns2';
+ $static='no';
+ $custom='no';
+ $wildcard='yes';
+ }
+ elsif( $dns eq 'DYNDNS2')
+ {
+ $explain='## dyndns.org static addresses';
+ $pubserv ='members.dyndns.org';
+ $protocol='dyndns2';
+ $static ='yes';
+ $custom ='no';
+ $wildcard='yes';
+ }
+ elsif( $dns eq 'DYNDNS3')
+ {
+ $explain='## dyndns.org static2 addresses';
+ $pubserv='members.dyndns.org';
+ $custom ='yes';
+ $protocol='dyndns2';
+ $static ='';
+ $wildcard='yes';
+ }
+ elsif( $dns eq 'ZONEDIT')
+ {
+ $explain='## zoneedit dynamic addresses';
+ $pubserv='www.zoneedit.com';
+ $protocol='zoneedit1';
+ }
+ elsif( $dns eq 'EASYDNS')
+ {
+ $explain='## easydns.com dynamic addresses';
+ $pubserv='members.easydns.com';
+ $protocol='easydns';
+ }
+ elsif( $dns eq 'HAMMER')
+ {
+ $explain='## hammer dup.hn.org dynamic addresses';
+ $pubserv='dup.hn.org';
+ $protocol='hammernode1';
+ }
+ elsif( $dns eq 'DSLREPORTS' )
+ {
+ $explain='## dslreports.org dynamic addresses';
+ $pubserv='members.dslreports.com';
+ $protocol='dslreports1';
+ }
+ elsif( $dns eq 'EURODYNDNS' )
+ {
+ $explain='## euroddyndns.org dynamic addresses';
+ $pubserv='eurodyndns.org';
+ $protocol='namecheap';
+ }
+ elsif( $dns eq 'DTDNS' )
+ {
+ $explain='## DtDNS (www.dtdns.com) dynamic addresses';
+ $pubserv='www.dtdns.com';
+ $protocol='dtdns';
+ }
+ elsif( $dns eq 'LOOPIA' )
+ {
+ $explain='## Loopia (loopia.se) dynamic addresses';
+ $pubserv='dns.loopia.se';
+ $protocol='dyndns2';
+ }
+ elsif( $dns eq 'DNSPARK' )
+ {
+ $explain='## dnspark.com dynamic addresses';
+ $pubserv='www.dnspark.com';
+ $protocol='dnspark';
+ }
+ elsif( $dns eq 'DYNHOST' )
+ {
+ $explain='## DynHost (ovh.com) dynamic addresses';
+ $pubserv='www.ovh.com';
+ $protocol='dyndns2';
+ }
+ elsif( $dns eq 'NOIP' )
+ {
+ $explain='## Noip (noip.com) dynamic addresses';
+ $pubserv='dynupdate.no-ip.com';
+ $protocol='noip';
+ }
+ elsif( $dns eq 'CHANGEIP' )
+ {
+ $explain='## ChangeIP (changeip.com) dynamic addresses';
+ $pubserv='nic.changeip.com';
+ $protocol='dyndns2';
+ }
+
+ elsif( $dns eq 'NAMECHEAP' )
+ {
+ $explain='## NAMECHEAP (namecheap.com) dynamic addresses';
+ $pubserv='dynamicdns.park-your-domain.com';
+ $protocol='namecheap';
+ }
+
+ elsif( $dns eq 'SPDNS' )
+ {
+ $explain='## SPDNS (spdns.de) dynamic addresses';
+ $pubserv='update.spdns.de';
+ $protocol='dyndns2';
+ }
+ elsif( $dns eq 'CUSTOMDNS' )
+ {
+ $explain='## CUSTOMDNS PROVIDER dynamic addresses';
+ $pubserv= $customdns;
+ $protocol= $customprotocol;
+ }
+
+ if($pubserv ne '')
+ {
+ $OUT .="##\n";
+ $OUT .=$explain."\n";
+ $OUT .="##\n";
+ $OUT .="server=".$pubserv.", \\\n";
+ $OUT .="protocol=".$protocol.", \\\n";
+ if( $dns eq 'DTDNS' ) {
+ $OUT .="client=ddclient, \\\n";
+ }
+ if( $dns eq 'LOOPIA' ) {
+ $OUT .="use=web, \\\n";
+ $OUT .="web=loopia, \\\n";
+ $OUT .="script=/XDynDNSServer/XDynDNS.php, \\\n";
+ }
+ if($static ne '') {
+ $OUT .="static=".$static.", \\\n";
+ }
+
+ if($wildcard ne '') {
+ $OUT .="wildcard=".$wildcard.", \\\n";
+ }
+
+ if($custom ne '') {
+ $OUT .="custom=".$custom.", \\\n";
+ }
+
+ if ($mx ne '') {
+ $OUT .="mx=".$mx.", \\\n";
+ }
+
+ $OUT .="login=".$login.", \\\n";
+ $OUT .="password=".$password." \\\n";
+ $OUT .="\@\n" if ( $dns eq 'NAMECHEAP' );
+
+ $OUT .=$edom->key()."\n" if ( $dns ne 'NAMECHEAP' );
+ $OUT .="##\n";
+ $OUT .="##\n";
+ }
+ }
+ }
+}
+
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/30FreeHosts smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/30FreeHosts
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/30FreeHosts 1970-01-01 01:00:00.000000000 +0100
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/30FreeHosts 2015-07-10 15:01:50.685735873 +0200
@@ -0,0 +1,210 @@
+{
+ use strict;
+ use esmith::util;
+ use esmith::ConfigDB;
+ use esmith::AccountsDB;
+
+ $OUT='';
+
+ my $conf = esmith::ConfigDB->open()
+ or die "Unable to open configuration db";
+
+ my $edb;
+
+ $edb = esmith::ConfigDB->open('/home/e-smith/db/ddclient')
+ or $edb = esmith::ConfigDB->create('/home/e-smith/db/ddclient');
+
+ #------------------------------------------------------------
+ # Look up domains and domain descriptions
+ #------------------------------------------------------------
+
+ my $key;
+ my @virtualDomains = ();
+ foreach my $domain ($edb->get_all_by_prop(type=>'ddhost'))
+ {
+ $key = $domain->key;
+ push (@virtualDomains, $key);
+ }
+
+ my $numDomains = @virtualDomains;
+ if ($numDomains > 0) {
+ foreach my $dom (sort @virtualDomains)
+ {
+ my $edom=$edb->get($dom);
+
+ if( defined $edom )
+ {
+ my $dns = $edom->prop('dns');
+ $dns =~ tr/a-z/A-Z/;
+ my $login = $edom->prop('login');
+ my $password = $edom->prop('password');
+ my $customdns = $edom->prop('customdns') || '';
+ my $customprotocol = $edom->prop('customprotocol') || '';
+ my $pubserv='';
+ my $static='';
+ my $custom='';
+ my $wildcard='';
+ my $mx=$edom->prop('mx') || '';
+ my $backupmx='';
+ my $protocol='';
+ my $explain='';
+
+ if( $dns eq 'DYNDNS1')
+ {
+ $explain='## dyndns.org dynamic addresses';
+ $pubserv ='members.dyndns.org';
+ $protocol='dyndns2';
+ $static='no';
+ $custom='no';
+ $wildcard='yes';
+ }
+ elsif( $dns eq 'DYNDNS2')
+ {
+ $explain='## dyndns.org static addresses';
+ $pubserv ='members.dyndns.org';
+ $protocol='dyndns2';
+ $static ='yes';
+ $custom ='no';
+ $wildcard='yes';
+ }
+ elsif( $dns eq 'DYNDNS3')
+ {
+ $explain='## dyndns.org static2 addresses';
+ $pubserv='members.dyndns.org';
+ $custom ='yes';
+ $protocol='dyndns2';
+ $static ='';
+ $wildcard='yes';
+ }
+ elsif( $dns eq 'ZONEDIT')
+ {
+ $explain='## zoneedit dynamic addresses';
+ $pubserv='www.zoneedit.com';
+ $protocol='zoneedit1';
+ }
+ elsif( $dns eq 'EASYDNS')
+ {
+ $explain='## easydns.com dynamic addresses';
+ $pubserv='members.easydns.com';
+ $protocol='easydns';
+ }
+ elsif( $dns eq 'HAMMER')
+ {
+ $explain='## hammer dup.hn.org dynamic addresses';
+ $pubserv='dup.hn.org';
+ $protocol='hammernode1';
+ }
+ elsif( $dns eq 'DSLREPORTS' )
+ {
+ $explain='## dslreports.org dynamic addresses';
+ $pubserv='members.dslreports.com';
+ $protocol='dslreports1';
+ }
+ elsif( $dns eq 'EURODYNDNS' )
+ {
+ $explain='## euroddyndns.org dynamic addresses';
+ $pubserv='eurodyndns.org';
+ $protocol='namecheap';
+ }
+ elsif( $dns eq 'DTDNS' )
+ {
+ $explain='## DtDNS (www.dtdns.com) dynamic addresses';
+ $pubserv='www.dtdns.com';
+ $protocol='dtdns';
+ }
+ elsif( $dns eq 'LOOPIA' )
+ {
+ $explain='## Loopia (loopia.se) dynamic addresses';
+ $pubserv='dns.loopia.se';
+ $protocol='dyndns2';
+ }
+ elsif( $dns eq 'DNSPARK' )
+ {
+ $explain='## dnspark.com dynamic addresses';
+ $pubserv='www.dnspark.com';
+ $protocol='dnspark';
+ }
+ elsif( $dns eq 'DYNHOST' )
+ {
+ $explain='## DynHost (ovh.com) dynamic addresses';
+ $pubserv='www.ovh.com';
+ $protocol='dyndns2';
+ }
+ elsif( $dns eq 'NOIP' )
+ {
+ $explain='## Noip (noip.com) dynamic addresses';
+ $pubserv='dynupdate.no-ip.com';
+ $protocol='noip';
+ }
+ elsif( $dns eq 'CHANGEIP' )
+ {
+ $explain='## ChangeIP (changeip.com) dynamic addresses';
+ $pubserv='nic.changeip.com';
+ $protocol='dyndns2';
+ }
+
+ elsif( $dns eq 'NAMECHEAP' )
+ {
+ $explain='## NAMECHEAP (namecheap.com) dynamic addresses';
+ $pubserv='dynamicdns.park-your-domain.com';
+ $protocol='namecheap';
+ }
+
+ elsif( $dns eq 'SPDNS' )
+ {
+ $explain='## SPDNS (spdns.de) dynamic addresses';
+ $pubserv='update.spdns.de';
+ $protocol='dyndns2';
+ }
+
+ elsif( $dns eq 'CUSTOMDNS' )
+ {
+ $explain='## CUSTOMDNS PROVIDER dynamic addresses';
+ $pubserv= $customdns;
+ $protocol= $customprotocol;
+ }
+
+ if($pubserv ne '')
+ {
+ $OUT .="##\n";
+ $OUT .=$explain."\n";
+ $OUT .="##\n";
+ $OUT .="server=".$pubserv.", \\\n";
+ $OUT .="protocol=".$protocol.", \\\n";
+ if( $dns eq 'DTDNS' ) {
+ $OUT .="client=ddclient, \\\n";
+ }
+ if( $dns eq 'LOOPIA' ) {
+ $OUT .="use=web, \\\n";
+ $OUT .="web=loopia, \\\n";
+ $OUT .="script=/XDynDNSServer/XDynDNS.php, \\\n";
+ }
+ if($static ne '') {
+ $OUT .="static=".$static.", \\\n";
+ }
+
+ if($wildcard ne '') {
+ $OUT .="wildcard=".$wildcard.", \\\n";
+ }
+
+ if($custom ne '') {
+ $OUT .="custom=".$custom.", \\\n";
+ }
+
+ if ($mx ne '') {
+ $OUT .="mx=".$mx.", \\\n";
+ }
+
+ $OUT .="login=".$login.", \\\n";
+ $OUT .="password=".$password." \\\n";
+ $OUT .="\@\n" if ( $dns eq 'NAMECHEAP' );
+
+ $OUT .=$edom->key()."\n" if ( $dns ne 'NAMECHEAP' );
+ $OUT .="##\n";
+ $OUT .="##\n";
+ }
+ }
+ }
+ }
+}
+
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient.conf/10Headers smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient.conf/10Headers
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient.conf/10Headers 2015-07-07 00:04:46.528387351 +0200
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient.conf/10Headers 1970-01-01 01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
- {
- my $deamonupdate = ${ddclient}{DeamonUpdate} || '300';
- my $ssl = ${ddclient}{SSL} || 'yes';
- $OUT .= qq(
-daemon=$deamonupdate # check every $deamonupdate seconds
-syslog=yes # log update msgs to syslog
-mail=admin # mail update msgs to admin
-mail-failure=admin
-pid=/var/run/ddclient/ddclient.pid # record PID in file.
-ssl=$ssl
-#);
- }
-
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient.conf/20Declaration smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient.conf/20Declaration
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates/etc/ddclient.conf/20Declaration 2015-07-07 00:04:46.528387351 +0200
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates/etc/ddclient.conf/20Declaration 1970-01-01 01:00:00.000000000 +0100
@@ -1,178 +0,0 @@
-{
- use esmith::DomainsDB;
-
- $OUT='';
-
- my $ddb = esmith::DomainsDB->open_ro();
-
- $OUT .="use=web, web=$ddclient{'urlcheckip'}\/, web-skip='IP Address:' \n";
-
- for my $edom ( $ddb->domains )
- {
- {
-
- my $dns = $edom->prop('dns') || '';
- next if ($dns eq '');
- $dns =~ tr/a-z/A-Z/;
- my $login = $edom->prop('login');
- my $password = $edom->prop('password');
- my $pubserv='';
- my $static='';
- my $custom='';
- my $wildcard='';
- my $mx=$edom->prop('mx') || '';
- my $backupmx='';
- my $protocol='';
- my $explain='';
-
- if( $dns eq 'DYNDNS1')
- {
- $explain='## dyndns.org dynamic addresses';
- $pubserv ='members.dyndns.org';
- $protocol='dyndns2';
- $static='no';
- $custom='no';
- $wildcard='yes';
- }
- elsif( $dns eq 'DYNDNS2')
- {
- $explain='## dyndns.org static addresses';
- $pubserv ='members.dyndns.org';
- $protocol='dyndns2';
- $static ='yes';
- $custom ='no';
- $wildcard='yes';
- }
- elsif( $dns eq 'DYNDNS3')
- {
- $explain='## dyndns.org static2 addresses';
- $pubserv='members.dyndns.org';
- $custom ='yes';
- $protocol='dyndns2';
- $static ='';
- $wildcard='yes';
- }
- elsif( $dns eq 'ZONEDIT')
- {
- $explain='## zoneedit dynamic addresses';
- $pubserv='www.zoneedit.com';
- $protocol='zoneedit1';
- }
- elsif( $dns eq 'EASYDNS')
- {
- $explain='## easydns.com dynamic addresses';
- $pubserv='members.easydns.com';
- $protocol='easydns';
- }
- elsif( $dns eq 'HAMMER')
- {
- $explain='## hammer dup.hn.org dynamic addresses';
- $pubserv='dup.hn.org';
- $protocol='hammernode1';
- }
- elsif( $dns eq 'DSLREPORTS' )
- {
- $explain='## dslreports.org dynamic addresses';
- $pubserv='members.dslreports.com';
- $protocol='dslreports1';
- }
- elsif( $dns eq 'EURODYNDNS' )
- {
- $explain='## euroddyndns.org dynamic addresses';
- $pubserv='eurodyndns.org';
- $protocol='namecheap';
- }
- elsif( $dns eq 'DTDNS' )
- {
- $explain='## DtDNS (www.dtdns.com) dynamic addresses';
- $pubserv='www.dtdns.com';
- $protocol='dtdns';
- }
- elsif( $dns eq 'LOOPIA' )
- {
- $explain='## Loopia (loopia.se) dynamic addresses';
- $pubserv='dns.loopia.se';
- $protocol='dyndns2';
- }
- elsif( $dns eq 'DNSPARK' )
- {
- $explain='## dnspark.com dynamic addresses';
- $pubserv='www.dnspark.com';
- $protocol='dnspark';
- }
- elsif( $dns eq 'DYNHOST' )
- {
- $explain='## DynHost (ovh.com) dynamic addresses';
- $pubserv='www.ovh.com';
- $protocol='dyndns2';
- }
- elsif( $dns eq 'NOIP' )
- {
- $explain='## Noip (noip.com) dynamic addresses';
- $pubserv='dynupdate.no-ip.com';
- $protocol='noip';
- }
- elsif( $dns eq 'CHANGEIP' )
- {
- $explain='## ChangeIP (changeip.com) dynamic addresses';
- $pubserv='nic.changeip.com';
- $protocol='dyndns2';
- }
-
- elsif( $dns eq 'NAMECHEAP' )
- {
- $explain='## NAMECHEAP (namecheap.com) dynamic addresses';
- $pubserv='dynamicdns.park-your-domain.com';
- $protocol='namecheap';
- }
-
- elsif( $dns eq 'SPDNS' )
- {
- $explain='## SPDNS (spdns.de) dynamic addresses';
- $pubserv='update.spdns.de';
- $protocol='dyndns2';
- }
-
- if($pubserv ne '')
- {
- $OUT .="##\n";
- $OUT .=$explain."\n";
- $OUT .="##\n";
- $OUT .="server=".$pubserv.", \\\n";
- $OUT .="protocol=".$protocol.", \\\n";
- if( $dns eq 'DTDNS' ) {
- $OUT .="client=ddclient, \\\n";
- }
- if( $dns eq 'LOOPIA' ) {
- $OUT .="use=web, \\\n";
- $OUT .="web=loopia, \\\n";
- $OUT .="script=/XDynDNSServer/XDynDNS.php, \\\n";
- }
- if($static ne '') {
- $OUT .="static=".$static.", \\\n";
- }
-
- if($wildcard ne '') {
- $OUT .="wildcard=".$wildcard.", \\\n";
- }
-
- if($custom ne '') {
- $OUT .="custom=".$custom.", \\\n";
- }
-
- if ($mx ne '') {
- $OUT .="mx=".$mx.", \\\n";
- }
-
- $OUT .="login=".$login.", \\\n";
- $OUT .="password=".$password." \\\n";
- $OUT .="\@\n" if ( $dns eq 'NAMECHEAP' );
-
- $OUT .=$edom->key()."\n" if ( $dns ne 'NAMECHEAP' );
- $OUT .="##\n";
- $OUT .="##\n";
- }
- }
- }
-}
-
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates.metadata/etc/ddclient/ddclient.conf smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates.metadata/etc/ddclient/ddclient.conf
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates.metadata/etc/ddclient/ddclient.conf 1970-01-01 01:00:00.000000000 +0100
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates.metadata/etc/ddclient/ddclient.conf 2015-07-10 14:10:14.014570889 +0200
@@ -0,0 +1,3 @@
+UID="root"
+GID="root"
+PERMS=0600
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates.metadata/etc/ddclient.conf smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates.metadata/etc/ddclient.conf
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/templates.metadata/etc/ddclient.conf 2015-07-07 00:04:46.528387351 +0200
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/templates.metadata/etc/ddclient.conf 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-UID="ddclient"
-GID="ddclient"
-PERMS=0600
diff -Nur smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/web/functions/ddclient smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/web/functions/ddclient
--- smeserver-ddclient-1.2.1.bz8961.old/root/etc/e-smith/web/functions/ddclient 2015-07-07 00:04:46.528387351 +0200
+++ smeserver-ddclient-1.2.1.bz8961/root/etc/e-smith/web/functions/ddclient 2015-07-10 15:02:32.360861723 +0200
@@ -49,8 +49,18 @@
sub performModifyDomain ($);
sub deleteDomain ($);
sub performDeleteDomain ($);
+sub ddcreateDomain ($);
+sub ddperformCreateDomain ($);
+sub ddmodifyDomain ($);
+sub ddperformModifyDomain ($);
+sub dddeleteDomain ($);
+sub ddperformDeleteDomain ($);
sub genServer ($$);
+sub genRetrieve($$);
+sub performRetrieve($);
+
+################################################################################################################"
BEGIN
{
# Clear PATH and related environment variables so that calls to
@@ -73,13 +83,12 @@
tie %conf, 'esmith::config', '/home/e-smith/configuration';
}
-my $domaindb = esmith::ConfigDB->open('/home/e-smith/db/domains');
- if ( not defined $domaindb ) {
- $domaindb = esmith::ConfigDB->open('/home/e-smith/domains');
- if ( not defined $domaindb ) {
- die "Unable to open domains db";
- }
- }
+my $domaindb = esmith::ConfigDB->open('/home/e-smith/db/domains')
+ or die "Unable to open domains db";
+my $edb;
+
+$edb = esmith::ConfigDB->open('/home/e-smith/db/ddclient')
+ or $edb = esmith::ConfigDB->create('/home/e-smith/db/ddclient');
#------------------------------------------------------------
# examine state parameter and display the appropriate form
#------------------------------------------------------------
@@ -121,6 +130,29 @@
performDeleteDomain ($q);
}
+elsif ($q->param ('state') eq "ddcreate") {
+ ddcreateDomain ($q);
+}
+elsif ($q->param ('state') eq "ddperformCreate") {
+ ddperformCreateDomain ($q);
+}
+elsif ($q->param ('state') eq "ddmodify") {
+ ddmodifyDomain ($q);
+}
+elsif ($q->param ('state') eq "ddperformModify") {
+ ddperformModifyDomain ($q);
+}
+elsif ($q->param ('state') eq "dddelete") {
+ dddeleteDomain ($q);
+}
+elsif ($q->param ('state') eq "ddperformDelete") {
+ ddperformDeleteDomain ($q);
+}
+
+elsif ($q->param ('state') eq "performRetrieve") {
+ performRetrieve($q);
+}
+
else
{
esmith::cgi::genStateError ($q, \%conf);
@@ -142,6 +174,7 @@
}
my %Labels = (
+ 'CUSTOMDNS' => $fm->localise('CUSTOMDNS'),
'DYNDNS1' => $fm->localise('DYNDNS1'),
'DYNDNS2' => $fm->localise('DYNDNS2'),
'DYNDNS3' => $fm->localise('DYNDNS3'),
@@ -162,7 +195,7 @@
return esmith::cgi::genCell ($q, $q->popup_menu (-name => 'dns',
-values => [
- 'DYNDNS1','DYNDNS2','DYNDNS3','ZONEDIT',
+ 'CUSTOMDNS', 'DYNDNS1','DYNDNS2','DYNDNS3','ZONEDIT',
'EASYDNS','HAMMER','DSLREPORTS', 'EURODYNDNS',
'DTDNS','LOOPIA','DNSPARK','DYNHOST','NOIP','CHANGEIP',
'NAMECHEAP','SPDNS'
@@ -170,6 +203,28 @@
-default => $curSetting,
-labels => \%Labels));
}
+
+#-----------------------------------------------------------------------------------------------------
+sub genRetrieve($$) {
+ my ($q, $curSetting) = @_;
+
+ if ((! defined $curSetting) || ($curSetting eq ''))
+ {
+ $curSetting = 'yes';
+ }
+
+ my %Labels = (
+ 'yes' => $fm->localise('yes'),
+ 'no' => $fm->localise('no'),
+ );
+
+ return esmith::cgi::genCell ($q, $q->popup_menu (-name => 'retrievessl',
+ -values => [
+ 'yes','no'
+ ],
+ -default => $curSetting,
+ -labels => \%Labels));
+}
#------------------------------------------------------------
sub showInitial ($$)
@@ -192,6 +247,44 @@
print $q->hr;
}
+ print $q->p ($fm->localise('FORM_DESCRIPTION'));
+
+ #------------------------------------------------------------
+ # get the ip retrieve method
+ #------------------------------------------------------------
+ my $ddretrieve=$conf->get('ddclient');
+ my $DeamonUpdate=$ddretrieve->prop('DeamonUpdate')|| '300';
+ my $urlcheckip=$ddretrieve->prop('urlcheckip')|| 'checkip.dyndns.org';
+ my $ssl=$ddretrieve->prop('SSL')|| 'yes';
+
+ print $q->startform (-method => 'POST',
+ -action => $q->url (-absolute => 1));
+
+ print $q->table ({border => 0, cellspacing => 0, cellpadding => 4},
+ $q->Tr (esmith::cgi::genCell ($q,$fm->localise('RETRIEVE_SSL')),
+ genRetrieve($q,$ssl)),
+# esmith::cgi::genWidgetRow ($q, $fm->localise('RETRIEVE_SSL')),
+# $q->popup_menu (-name => 'SSL',
+# -values => ['yes', 'no'],
+# -default => $ssl),
+# -labels => \%status)) ,
+
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('RETRIEVE_DEAMONUPDATE'),
+ "retrievedeamonupdate",$DeamonUpdate)),
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('RETRIEVE_URLCHECKIP'),
+ "retrieveurlcheckip",$urlcheckip)),
+ esmith::cgi::genButtonRow ( $q,
+ $q->submit (-name => 'action',
+ -value => $fm->localise('APPLY')))
+ );
+
+ print $q->hidden (-name => 'state',
+ -override => 1,
+ -default => 'performRetrieve');
+
+ print $q->endform;
+ print $q->hr;
#------------------------------------------------------------
# Look up domains and domain descriptions
@@ -256,6 +349,7 @@
esmith::cgi::genSmallCell ($q, $properties{'Description'}),
esmith::cgi::genSmallCell ($q, $content),
esmith::cgi::genSmallCell ($q, ' '),
+ esmith::cgi::genSmallCell ($q, ' '),
esmith::cgi::genSmallCell ($q,
$q->a ({href => $q->url (-absolute => 1)
. "?state=create&domain="
@@ -284,6 +378,61 @@
print '';
}
+ print $q->hr;
+#########################################################################################################################################
+# now the free form part
+#
+ my @FreeDomains = ();
+ foreach my $domain ($edb->get_all_by_prop(type=>'ddhost'))
+ {
+ my $key = $domain->key;
+ push (@FreeDomains, $key);
+ }
+
+ print $q->p ($fm->localise('FREE_FORM_DESCRIPTION'));
+
+ $numDomains = @FreeDomains;
+
+ print $q->p ($q->b ($fm->localise('CURRENT_LIST_OF_DOMAINS')));
+
+ print $q->table ({border => 1, cellspacing => 1, cellpadding => 4});
+
+ print $q->Tr (esmith::cgi::genSmallCell ($q, $q->b ($fm->localise('DOMAIN'))),
+ esmith::cgi::genSmallCell ($q, $q->b ($fm->localise('DESCRIPTION'))),
+ esmith::cgi::genSmallCell ($q, $q->b ($fm->localise('PUBLICATION'))),
+ $q->td (' '),
+ $q->td (' ')
+ );
+
+ if ( $numDomains > 0 ) {
+ foreach my $domain (sort @FreeDomains) {
+ my $vals = $edb->get($domain);
+ my $content = $vals->prop('desc');
+ my $publish = $vals->prop('dns');
+ print $q->Tr (esmith::cgi::genSmallCell ($q, $domain),
+ esmith::cgi::genSmallCell ($q, $content),
+ esmith::cgi::genSmallCell ($q, $publish),
+ esmith::cgi::genSmallCell ($q,
+ $q->a ({href => $q->url (-absolute => 1)
+ . "?state=ddmodify&domain="
+ . $domain}, $fm->localise('MODIFY', ))),
+ esmith::cgi::genSmallCell ($q,
+ $q->a ({href => $q->url (-absolute => 1)
+ . "?state=dddelete&domain="
+ . $domain}, $fm->localise('DELETE', )))
+ );
+ }
+ }
+
+ print $q->Tr (($q->td(' ')),
+ ($q->td(' ')),
+ ($q->td(' ')),
+ ($q->td(' ')),
+ esmith::cgi::genSmallCell ($q,
+ $q->a ({href => $q->url (-absolute => 1)
+ . "?state=ddcreate"}, $fm->localise('CREATE', )))
+ );
+ print '';
esmith::cgi::genFooter ($q);
}
@@ -324,7 +473,27 @@
-labels => \%labels));
}
#------------------------------------------------------------
+#
+#------------------------------------------------------------
+sub performRetrieve($) {
+ my ($q) = @_;
+ my $deamonupdate =$q->param('retrievedeamonupdate');
+ my $urlcheckip =$q->param('retrieveurlcheckip');
+ my $ssl = $q->param('retrievessl');
+
+ my $ddclient=$conf->get('ddclient');
+ $ddclient->set_prop('urlcheckip' => $urlcheckip);
+ $ddclient->set_prop('DeamonUpdate' => $deamonupdate);
+ $ddclient->set_prop('SSL' => $ssl);
+ $domaindb->reload();
+
+ system ("/sbin/e-smith/signal-event", "ddclient");
+
+ showInitial ($q, $fm->localise('SUCCESSFULLY_MODIFIED_RETRIEVE_IP'));
+}
+
+#------------------------------------------------------------
sub createDomain ($)
{
my ($q) = @_;
@@ -502,6 +671,9 @@
{content => $properties{'Content'}});
}
+ print $q->h3 ($fm->localise('CUSTOM_DESCRIPTION'));
+ print $q->p;
+
print $q->table ({border => 0, cellspacing => 0, cellpadding => 4},
$q->Tr (esmith::cgi::genCell ($q,
$fm->localise('DOMAIN_NAME')),
@@ -518,6 +690,14 @@
$q->Tr (esmith::cgi::genCell ($q, $fm->localise('SERVERS_LABEL')),
genServer($q, $eprops{'dns'})),
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('CUSTOMDNS_LABEL'),
+ "customdns",
+ $eprops{'customdns'})),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('CUSTOM_PROTOCOL_LABEL'),
+ "customprotocol",
+ $eprops{'customprotocol'})),
+
$q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('NAME_LABEL'),
"login",
$eprops{'login'})),
@@ -597,12 +777,30 @@
}
my $domainMX = $q->param ('mx');
+ my $customDNS = $q->param('customdns');
+ my $customPROTOCOL = $q->param('customprotocol');
+
+ my $dns = $q->param ('dns');
+ if ($dns eq 'CUSTOMDNS')
+ {
+ if ($customDNS =~ /^([a-zA-Z0-9\-\.]+)$/)
+ {
+ $customDNS = $1;
+ }
+ else
+
+ {
+ showInitial ($q, $fm->localise('CUSTOMDNS_VALIDATION_ERROR',
+ {domainName => $domainName}));
+ return;
+ }
+ }
#------------------------------------------------------------
# Looks good. Find out if this domain has been taken
# or if the domain is a reserved to provide a secured webserver
# for a previous domain
#------------------------------------------------------------
- my $dns = $q->param ('dns');
+# my $dns = $q->param ('dns');
my $dom=$domaindb->get($domainName);
@@ -610,6 +808,8 @@
$dom->set_prop('login' => $domainLogin);
$dom->set_prop('password' => $domainPassword);
$dom->set_prop('mx' => $domainMX);
+ $dom->set_prop('customdns' => $customDNS);
+ $dom->set_prop('customprotocol' => $customPROTOCOL);
$domaindb->reload();
@@ -708,6 +908,11 @@
my $dns = $fm->localise($props{'dns'});
$evalue->set_prop('dns' => '');
+ $evalue->set_prop('login' => '');
+ $evalue->set_prop('password' => '');
+ $evalue->set_prop('customdns' => '');
+ $evalue->set_prop('customprotocol' => '');
+
$domaindb->reload();
system ("/sbin/e-smith/signal-event", "ddclient");
@@ -716,6 +921,422 @@
{domain => $domain, dns => $dns}));
}
+##################################################################################################################################################
+# create a free publish
+#
+sub ddcreateDomain ($)
+{
+ my ($q) = @_;
+
+ esmith::cgi::genHeaderNonCacheable
+ ($q, \%conf, $fm->localise('CREATE_TITLE'));
+
+ print $q->startform (-method => 'POST',
+ -action => $q->url (-absolute => 1));
+ print $q->h3 ($fm->localise('CUSTOM_DESCRIPTION'));
+ print $q->p;
+ print $q->table ({border => 0, cellspacing => 0, cellpadding => 4},
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('DOMAIN_NAME_LABEL'),
+ "domainName","")),
+
+ $q->Tr (esmith::cgi::genNameValueRow($q,$fm->localise('DESCRIPTION_LABEL'),
+ "desc","")),
+
+ $q->Tr (esmith::cgi::genCell ($q, $fm->localise('SERVERS_LABEL')),
+ genServer($q, '')),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('CUSTOMDNS_LABEL'),
+ "customdns",'')),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('CUSTOM_PROTOCOL_LABEL'),
+ "customprotocol",'')),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('NAME_LABEL'),
+ "login","")),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('PASSWORD_LABEL'),
+ "password","")),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('MX'),
+ "mx","")),
+
+ esmith::cgi::genButtonRow ( $q,
+ $q->submit (-name => 'action',
+ -value => $fm->localise('CREATE'))));
+
+ print $q->hidden (-name => 'state',
+ -override => 1,
+ -default => 'ddperformCreate');
+
+ print $q->endform;
+
+ esmith::cgi::genFooter ($q);
+ return;
+}
+
+#------------------------------------------------------------
+#
+#------------------------------------------------------------
+
+sub ddperformCreateDomain ($)
+{
+ my ($q) = @_;
+
+ #------------------------------------------------------------
+ # Validate parameters and untaint them
+ #------------------------------------------------------------
+
+ my $domainName = $q->param ('domainName');
+ if ($domainName =~ /^([a-zA-Z0-9\-\.]+)$/) {
+ $domainName = $1;
+ } else {
+ showInitial ($q, $fm->localise('DOMAIN_NAME_VALIDATION_ERROR',
+ {domainName => $domainName}));
+ return;
+ }
+###############################################
+ foreach my $domain ($domaindb->get_all_by_prop(type=>'domain'))
+ {
+ my $key = $domain->key;
+ if ( $key eq $domainName ) {
+ showInitial ($q, $fm->localise('DOMAIN_NAME_ALREADY_EXIST',
+ {domainName => $domainName}));
+ return;
+ }
+ }
+
+ foreach my $domain ($edb->get_all_by_prop(type=>'ddhost'))
+ {
+ my $key = $domain->key;
+ if ( $key eq $domainName ) {
+ showInitial ($q, $fm->localise('DOMAIN_NAME_ALREADY_EXIST',
+ {domainName => $domainName}));
+ return;
+ }
+ }
+
+#############################################
+
+ my $domainDesc = $q->param ('desc');
+ my $domainLogin = $q->param ('login');
+ if ($domainLogin =~ /^([\-\'\w][\-\'\w\s\.]*)$/) {
+ $domainLogin = $1;
+ } else {
+ showInitial ($q, $fm->localise('DOMAIN_LOGIN_VALIDATION_ERROR',
+ {domainLogin => $domainLogin}));
+ return;
+ }
+
+ my $domainPassword = $q->param ('password');
+ if ($domainPassword =~ /^(.*)$/) {
+ $domainPassword = $1;
+ } else {
+ showInitial ($q, $fm->localise('DOMAIN_PASSWORD_VALIDATION_ERROR',
+ {domainPassword => $domainPassword}));
+ return;
+ }
+
+ my $domainMX = $q->param ('mx');
+##Custom dns retrieve
+ my $customDNS = $q->param('customdns');
+ my $customPROTOCOL = $q->param('customprotocol');
+
+ my $dns = $q->param ('dns');
+ if ($dns eq 'CUSTOMDNS')
+ {
+ if ($customDNS =~ /^([a-zA-Z0-9\-\.]+)$/)
+ {
+ $customDNS = $1;
+ }
+ else
+
+ {
+ showInitial ($q, $fm->localise('CUSTOMDNS_VALIDATION_ERROR',
+ {domainName => $domainName}));
+ return;
+ }
+ }
+ #------------------------------------------------------------
+ # Looks good. Find out if this domain has been taken
+ # or if the domain is a reserved to provide a secured webserver
+ # for a previous domain
+ #------------------------------------------------------------
+# my $dns = $q->param ('dns');
+
+ my %properties = ();
+ $properties{'type'} = 'ddhost';
+ $properties{'dns'} = $dns;
+ $properties{'login'} = $domainLogin;
+ $properties{'password'} = $domainPassword;
+ $properties{'mx'} = $domainMX;
+ $properties{'desc'} = $domainDesc;
+ $properties{'customdns'} = $customDNS;
+ $properties{'customprotocol'} = $customPROTOCOL;
+ $edb->new_record($domainName, \%properties);
+
+ system ("/sbin/e-smith/signal-event", "ddclient");
+
+ showInitial ($q, $fm->localise('SUCCESSFULLY_CREATED',
+ {domainName => $domainName,dns => $fm->localise($dns) }));
+}
+
+#------------------------------------------------------------
+#
+#------------------------------------------------------------
+
+sub ddmodifyDomain ($)
+{
+ my ($q) = @_;
+
+ esmith::cgi::genHeaderNonCacheable ($q, \%conf,
+ $fm->localise('MODIFY_TITLE'));
+
+ print $q->startform (-method => 'POST', -action => $q->url (-absolute => 1));
+
+ my $domain = $q->param ('domain');
+ my $evalue = $edb->get($domain);
+
+ if (defined $evalue)
+ {
+ my %eprops = $evalue->props;
+
+ print $q->h3 ($fm->localise('CUSTOM_DESCRIPTION'));
+ print $q->p;
+
+ print $q->table ({border => 0, cellspacing => 0, cellpadding => 4},
+ $q->Tr (esmith::cgi::genCell ($q, $fm->localise('DOMAIN_NAME_LABEL')),
+ esmith::cgi::genCell ($q, $domain)),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q, $fm->localise('DESCRIPTION_LABEL'),
+ "desc",
+ $eprops{'desc'})),
+
+ $q->Tr (esmith::cgi::genCell ($q, $fm->localise('SERVERS_LABEL')),
+ genServer($q, $eprops{'dns'})),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('CUSTOMDNS_LABEL'),
+ "customdns",
+ $eprops{'customdns'})),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('CUSTOM_PROTOCOL_LABEL'),
+ "customprotocol",
+ $eprops{'customprotocol'})),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('NAME_LABEL'),
+ "login",
+ $eprops{'login'})),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('PASSWORD_LABEL'),
+ "password",
+ $eprops{'password'})),
+
+ $q->Tr (esmith::cgi::genNameValueRow ($q,$fm->localise('MX'),
+ "mx",$eprops{'mx'})),
+
+ esmith::cgi::genButtonRow ($q,
+ $q->submit (-name => 'action',
+ -value => $fm->localise('MODIFY')))
+ );
+
+ print $q->hidden (-name => 'domainName',
+ -override => 1,
+ -default => $domain);
+
+ print $q->hidden (-name => 'state',
+ -override => 1,
+ -default => 'ddperformModify');
+
+ } else {
+ showInitial ($q, $fm->localise('ERROR_ON_EXTRA_DATABASE',
+ {domainName => $domain }));
+ return;
+ }
+
+ print $q->endform;
+ esmith::cgi::genFooter ($q);
+ return;
+}
+
+#------------------------------------------------------------
+#
+#------------------------------------------------------------
+
+sub ddperformModifyDomain ($)
+{
+ my ($q) = @_;
+
+ #------------------------------------------------------------
+ # Validate parameters and untaint them
+ #------------------------------------------------------------
+
+ my $domainName = $q->param ('domainName');
+ if ($domainName =~ /^([a-zA-Z0-9\-\.]+)$/) {
+ $domainName = $1;
+ } else {
+ showInitial ($q, $fm->localise('DOMAIN_NAME_VALIDATION_ERROR',
+ {domainName => $domainName}));
+ return;
+ }
+
+ my $domainLogin = $q->param ('login');
+ if ($domainLogin =~ /^([\-\'\w][\-\'\w\s\.]*)$/) {
+ $domainLogin = $1;
+ } else {
+ showInitial ($q, $fm->localise('DOMAIN_LOGIN_VALIDATION_ERROR',
+ {domainLogin => $domainLogin}));
+ return;
+ }
+
+ my $domainPassword = $q->param ('password');
+ if ($domainPassword =~ /^(.*)$/) {
+ $domainPassword = $1;
+ } else {
+ showInitial ($q, $fm->localise('DOMAIN_PASSWORD_VALIDATION_ERROR',
+ {domainPassword => $domainPassword}));
+ return;
+ }
+
+ my $domainMX = $q->param ('mx');
+ my $desc = $q->param ('desc');
+ my $customDNS = $q->param('customdns');
+ my $customPROTOCOL = $q->param('customprotocol');
+
+ my $dns = $q->param ('dns');
+
+ if ($dns eq 'CUSTOMDNS')
+ {
+ if ($customDNS =~ /^([a-zA-Z0-9\-\.]+)$/)
+ {
+ $customDNS = $1;
+ }
+ else
+
+ {
+ showInitial ($q, $fm->localise('CUSTOMDNS_VALIDATION_ERROR',
+ {domainName => $domainName}));
+ return;
+ }
+ }
+ #------------------------------------------------------------
+ # Looks good. Find out if this domain has been taken
+ # or if the domain is a reserved to provide a secured webserver
+ # for a previous domain
+ #------------------------------------------------------------
+# my $dns = $q->param ('dns');
+
+ my $dom=$edb->get($domainName);
+
+ $dom->set_prop('desc' => $desc);
+ $dom->set_prop('dns' => $dns);
+ $dom->set_prop('login' => $domainLogin);
+ $dom->set_prop('password' => $domainPassword);
+ $dom->set_prop('mx' => $domainMX);
+ $dom->set_prop('customdns' => $customDNS);
+ $dom->set_prop('customprotocol' => $customPROTOCOL);
+
+ $edb->reload();
+
+ system ("/sbin/e-smith/signal-event", "ddclient");
+
+ showInitial ($q, $fm->localise('SUCCESSFULLY_MODIFIED',
+ {domainName => $domainName,dns => $fm->localise($dns)}));
+}
+
+#------------------------------------------------------------
+#
+#------------------------------------------------------------
+
+sub dddeleteDomain ($)
+{
+ my ($q) = @_;
+
+ esmith::cgi::genHeaderNonCacheable ($q, \%conf, $fm->localise('REMOVE_TITLE'));
+
+ print $q->startform (-method => 'POST', -action => $q->url (-absolute => 1));
+
+ my $domain = $q->param ('domain');
+ my $evalue = $edb->get($domain);
+
+ if (defined $evalue)
+ {
+ my %eprops = $evalue->props;
+ my $domainDesc = $eprops{'desc'};
+ my $dns = $fm->localise($eprops{'dns'});
+
+ print $q->p($fm->localise('REMOVE_DESCRIPTION',
+ {domain => $domain,
+ domainDesc => $domainDesc,
+ dns => $dns } ));
+
+ print $q->submit (-name => 'action', -value => $fm->localise('REMOVE'));
+ print $q->hidden (-name => 'domain', -override => 1, -default => $domain);
+
+ print $q->hidden (-name => 'state',
+ -override => 1,
+ -default => 'ddperformDelete');
+ } else {
+ showInitial ($q, $fm->localise('ERROR_ON_EXTRA_DATABASE',
+ {domainName => $domain }));
+ return;
+ }
+
+ print $q->endform;
+ esmith::cgi::genFooter ($q);
+ return;
+}
+
+#------------------------------------------------------------
+#
+#------------------------------------------------------------
+
+sub ddperformDeleteDomain ($)
+{
+ my ($q) = @_;
+
+ #------------------------------------------------------------
+ # Attempt to delete domain
+ #------------------------------------------------------------
+
+ my $domain = $q->param ('domain');
+
+ if ($domain =~ /^([a-zA-Z0-9\-\.]+)$/) {
+ $domain = $1;
+ } else {
+ showInitial ($q, $fm->localise('ERROR_WHILE_REMOVING_DOMAIN',
+ {domain => $domain}));
+ return;
+ }
+
+ my $evalue = $edb->get($domain);
+ unless ($evalue)
+ {
+ showInitial ($q, $fm->localise('NONEXISTENT_DOMAIN_ERROR',
+ {domainName => $domain}));
+ return;
+ }
+
+ my %properties = $evalue->props;
+ my $type = $properties{'type'};
+ my $dns = $fm->localise($properties{'dns'});
+
+ if ($type ne 'ddhost')
+ {
+ showInitial ($q, $fm->localise('NONEXISTENT_DOMAIN_ERROR',
+ {domainName => $domain}));
+ return;
+ }
+
+# $evalue = $edb->get($domain);
+ $evalue->delete;
+ $edb->reload();
+
+ system ("/sbin/e-smith/signal-event", "ddclient");
+
+ showInitial ($q, $fm->localise('SUCCESSFULLY_DELETED',
+ {domain => $domain, dns => $dns}));
+}
+
#################################################################################################
__DATA__