/[smecontribs]/rpms/smeserver-ddclient/contribs10/smeserver-ddclient-1.3.0-Update-SM2-code-for-new-services-and-protocols.patch
ViewVC logotype

Annotation of /rpms/smeserver-ddclient/contribs10/smeserver-ddclient-1.3.0-Update-SM2-code-for-new-services-and-protocols.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (hide annotations) (download)
Mon Dec 18 13:53:48 2023 UTC (10 months, 2 weeks ago) by brianr
Branch: MAIN
CVS Tags: smeserver-ddclient-1_3_0-31_el7_sme, smeserver-ddclient-1_3_0-32_el7_sme, smeserver-ddclient-1_3_0-34_el7_sme, smeserver-ddclient-1_3_0-33_el7_sme, smeserver-ddclient-1_3_0-30_el7_sme, smeserver-ddclient-1_3_0-29_el7_sme, smeserver-ddclient-1_3_0-28_el7_sme, HEAD
Changes since 1.9: +13 -0 lines
* Fri Nov 10 2023 Brian Read <brianr@koozali.org> 1.3.0-28.sme
- Update template for deprecated commands and v3.11.1 ddclient [SME: 12427 ]
- Update SM2 code to show all new protocols etc

1 brianr 1.7 diff -urN smeserver-ddclient-1.3.0.old/createlinks smeserver-ddclient-1.3.0/createlinks
2     --- smeserver-ddclient-1.3.0.old/createlinks 2023-11-10 16:11:05.855271810 +0000
3 brianr 1.8 +++ smeserver-ddclient-1.3.0/createlinks 2023-12-18 10:52:53.495714627 +0000
4 brianr 1.7 @@ -48,3 +48,6 @@
5     $event = 'post-upgrade';
6     templates2events("/etc/ddclient/ddclient.conf", $event);
7     templates2events("/etc/ppp/ip-up.local", $event);
8     +
9     +# and create an empty cache
10 brianr 1.8 +# safe_touch("/var/cache/ddclient/ddclient.cache")
11 brianr 1.3 diff -urN smeserver-ddclient-1.3.0.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers smeserver-ddclient-1.3.0/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers
12     --- smeserver-ddclient-1.3.0.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers 2023-11-10 16:11:05.911271972 +0000
13 brianr 1.6 +++ smeserver-ddclient-1.3.0/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/10Headers 2023-12-14 11:40:00.000000000 +0000
14     @@ -52,15 +52,16 @@
15     } elsif ( $method eq 'ip') {
16     # we want to force manually
17     $OUT.="usev4=ipv4, ipv4=$ForceIP \n";
18     - } elsif ( $method eq 'cmd') {
19     - $OUT .="usev4=cmd, cmdv4='$cmd'\n";
20     + } elsif ( $method eq 'cmdv4') {
21     + $OUT .="usev4=cmdv4, cmdv4='$cmd'\n";
22 brianr 1.3 } else {
23     # fw method
24     my $fwaddress = $ddclient{'fwaddress'}||'';
25     + my $fwdevice = $ddclient{'Extinterface'}||'';
26     my $fwlogin = $ddclient{'fwlogin'}||'';
27     my $fwpassword = $ddclient{'fwpassword'}||'';
28     my $fwskip = $ddclient{'fwskip'}||'';
29     - $OUT .= "usev4=$method, fwv4=$fwaddress";
30     + $OUT .= "usev4=$fwdevice, fwv4=$fwaddress";
31     $OUT .= ", fw-login=$fwlogin " if ( $fwlogin ne '' );
32     $OUT .= ", fw-password=$fwpassword " if ( $fwpassword ne '' );
33     $OUT .= ", fwv4-skip='$fwskip' " if ( $fwskip ne '' );
34 brianr 1.10 diff -urN smeserver-ddclient-1.3.0.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/30FreeHosts smeserver-ddclient-1.3.0/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/30FreeHosts
35     --- smeserver-ddclient-1.3.0.old/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/30FreeHosts 2023-11-10 16:11:05.913271977 +0000
36     +++ smeserver-ddclient-1.3.0/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/30FreeHosts 2023-12-18 13:45:00.000000000 +0000
37     @@ -93,5 +93,9 @@
38     }
39     }
40     }
41     + my $file = '/var/cache/ddclient/ddclient.cache';
42     + # Execute the shell command to clear the file
43     + system("rm -f '' > $file");
44     +
45     }
46    
47 brianr 1.7 diff -urN smeserver-ddclient-1.3.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/ddclient.service.d/50koozali.conf/20Service smeserver-ddclient-1.3.0/root/etc/e-smith/templates/usr/lib/systemd/system/ddclient.service.d/50koozali.conf/20Service
48     --- smeserver-ddclient-1.3.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/ddclient.service.d/50koozali.conf/20Service 2023-11-10 16:11:05.857271816 +0000
49     +++ smeserver-ddclient-1.3.0/root/etc/e-smith/templates/usr/lib/systemd/system/ddclient.service.d/50koozali.conf/20Service 2023-12-16 10:40:00.000000000 +0000
50     @@ -1,7 +1,7 @@
51     {
52     $debug = (($ddclient{'debug'} eq 'enabled') ? "debug" : "nodebug");
53     $verbose = (($ddclient{'verbose'} eq 'enabled') ? "verbose" : "noverbose");
54     -$quiet = (($ddclient{'quiet'} eq 'enabled') ? "quiet" : "noquiet");
55     +$quiet = (($ddclient{'quiet'} eq 'disabled') ? "noquiet" : "quiet");
56     $syslog = (($ddclient{'syslog'} eq "enabled") ? "syslog" : "nosyslog");
57     $OUT .= "\n";
58     $OUT .= "[Service]\n";
59     diff -urN smeserver-ddclient-1.3.0.old/root/etc/e-smith/templates.metadata/etc/ddclient/ddclient.conf smeserver-ddclient-1.3.0/root/etc/e-smith/templates.metadata/etc/ddclient/ddclient.conf
60     --- smeserver-ddclient-1.3.0.old/root/etc/e-smith/templates.metadata/etc/ddclient/ddclient.conf 2023-11-10 16:11:05.785271609 +0000
61     +++ smeserver-ddclient-1.3.0/root/etc/e-smith/templates.metadata/etc/ddclient/ddclient.conf 2023-12-15 11:54:47.841967164 +0000
62     @@ -1,3 +1,3 @@
63     UID="ddclient"
64     GID="ddclient"
65     -PERMS=0644
66     +PERMS=0600
67 brianr 1.1 diff -urN smeserver-ddclient-1.3.0.old/root/usr/share/smanager/lib/SrvMngr/Controller/Ddclient.pm smeserver-ddclient-1.3.0/root/usr/share/smanager/lib/SrvMngr/Controller/Ddclient.pm
68     --- smeserver-ddclient-1.3.0.old/root/usr/share/smanager/lib/SrvMngr/Controller/Ddclient.pm 2023-11-10 16:11:05.915271983 +0000
69 brianr 1.6 +++ smeserver-ddclient-1.3.0/root/usr/share/smanager/lib/SrvMngr/Controller/Ddclient.pm 2023-12-14 11:33:00.000000000 +0000
70 brianr 1.3 @@ -114,90 +114,164 @@
71 brianr 1.1
72     my %ddc_datas = ();
73    
74     +sub get_devices_names {
75     + #
76 brianr 1.3 + # Router/Firewall devices from which it can get ip address
77 brianr 1.1 + #
78     + my $devices = ( [
79 brianr 1.4 + [ '2Wire 1701HG Gateway' => '2wire' ],
80     + [ '3com 3c886a 56k Lan Modem' => '3com-3c886a' ],
81     + [ '3com OfficeConnect Remote 812' => '3com-oc-remote812' ],
82     + [ 'Alcatel Speed Touch 510' => 'alcatel-510' ],
83     + [ 'Alcatel/Thomson SpeedTouch 530' => 'alcatel-530' ],
84     + [ 'Alcatel Speed Touch Pro' => 'alcatel-stp' ],
85     + [ 'Allnet 1298' => 'allnet-1298' ],
86     + [ 'Cayman 3220-H DSL' => 'cayman-3220h' ],
87     + [ 'D-Link DI-524' => 'dlink-524' ],
88     + [ 'D-Link DI-604' => 'dlink-604' ],
89     + [ 'dlink-614' => 'D-Link DI-614+' ],
90     + [ 'e-tech' => 'E-tech Router' ],
91     + [ 'elsa-lancom-dsl10' => 'ELSA LanCom DSL/10 DSL FW' ],
92     + [ 'elsa-lancom-dsl10-ch01' => 'ELSA LanCom DSL/10 DSL FW (isdn ch01)' ],
93     + [ 'elsa-lancom-dsl10-ch02' => 'ELSA LanCom DSL/10 DSL FW (isdn ch01)' ],
94     + [ 'linksys' => 'Linksys FW' ],
95     + [ 'linksys-rv042-wan1' => 'Linksys RV042 Dual Homed Router WAN Port 2' ],
96     + [ 'linksys-rv042-wan2' => 'Linksys RV042 Dual Homed Router WAN Port 2' ],
97     + [ 'linksys-ver2' => 'Linksys FW version 2' ],
98     + [ 'linksys-ver3' => 'Linksys FW version 3' ],
99     + [ 'linksys-wcg200' => 'Linksys WCG200 FW' ],
100     + [ 'linksys-wrt854g' => 'Linksys WRT854G FW' ],
101     + [ 'maxgate-ugate3x00' => 'MaxGate UGATE-3x00 FW' ],
102     + [ 'netcomm-nb3' => 'NetComm NB3' ],
103 brianr 1.2 + [ 'netgear-dg834g' => 'netgear-dg834g' ],
104 brianr 1.4 + [ 'netgear-rp614' => 'Netgear RP614 FW' ],
105     + [ 'netgear-rt3xx' => 'Netgear FW' ],
106     + [ 'netgear-wgt624' => 'Netgear WGT624' ],
107     + [ 'netgear-wpn824' => 'Netgear WPN824 FW' ],
108     + [ 'netopia-r910' => 'Netopia R910 FW' ],
109 brianr 1.2 + [ 'olitec-SX200' => 'olitec-SX200' ],
110 brianr 1.4 + [ 'rtp300' => 'Linksys RTP300' ],
111     + [ 'siemens-ss4200' => 'Siemens SpeedStream 4200' ],
112     + [ 'sitecom-dc202' => 'Sitecom DC-202 FW' ],
113     + [ 'smc-barricade' => 'SMC Barricade FW' ],
114     + [ 'smc-barricade-7004vbr' => 'SMC Barricade FW (7004VBR model config)' ],
115     + [ 'smc-barricade-7401bra' => 'SMC Barricade 7401BRA FW' ],
116     + [ 'smc-barricade-alt' => 'SMC Barricade FW (alternate config)' ],
117     + [ 'sohoware-nbg800' => 'SOHOWare BroadGuard NBG800' ],
118     + [ 'sveasoft' => 'Sveasoft WRT54G/WRT54GS' ],
119     + [ 'thomson-st536v6' => 'Thomson SpeedTouch 536v6' ],
120     + [ 'thomson-tg782' => 'Thomson/Technicolor TG782' ],
121     + [ 'vigor-2200usb' => 'Vigor 2200 USB' ],
122     + [ 'watchguard-edge-x' => 'Watchguard Edge X FW' ],
123     + [ 'watchguard-soho' => 'Watchguard SOHO FW' ],
124     + [ 'westell-6100' => 'Westell C90-610015-06 DSL Router' ],
125     + [ 'xsense-aero' => 'Xsense Aero' ]
126 brianr 1.1 + ] );
127     + return $devices;
128     +
129     +
130     + # Automatic loading of the devices from the ddclient program - I can't get this to pass the results successfully to the template
131     + #my $output = `ddclient -list-devices`; # Run ddclient command to get devices output
132     + #my @lines;
133     + #foreach my $line (split /\n/, $output) {
134     + #$line =~ s/\s+//; # Remove leading whitespace
135     + #my ($field1, $field2) = split(' ', $line, 2);
136     + #push @lines, [$field2, $field1];
137     + #}
138     + #return \@lines; # Return a reference to the lines array
139     +}
140     +
141     +sub get_web_services_names {
142     + #
143     + # Web Services from which it can get ip address
144     + #
145     + my $webservices = ( [
146 brianr 1.5 + [ 'dyndns-http://checkip.dyndns.org/' => 'dyndns' ],
147     + [ 'freedns-https://freedns.afraid.org/dynamic/check.php' => 'freedns' ],
148     + [ 'googledomains-https://domains.google.com/checkip' => 'googledomains' ],
149     + [ 'he-https://checkip.dns.he.net/' => 'he' ],
150     + [ 'ip4only.me-https://ip4only.me/api/' => 'ip4only.me' ],
151     + [ 'ip6only.me-https://ip6only.me/api/' => 'ip6only.me' ],
152     + [ 'ipify-ipv4-https://api.ipify.org/' => 'ipify-ipv4' ],
153     + [ 'ipify-ipv6-https://api6.ipify.org/' => 'ipify-ipv6' ],
154     + [ 'loopia:-https://dns.loopia.se/checkip/checkip.php' => 'loopia' ],
155     + [ 'myonlineportal-https://myonlineportal.net/checkip' => 'myonlineportal' ],
156     + [ 'noip-ipv4-http://ip1.dynupdate.no-ip.com/' => 'noip-ipv4' ],
157     + [ 'noip-ipv6-http://ip1.dynupdate6.no-ip.com/' => 'noip-ipv6' ],
158     + [ 'nsupdate.info-ipv4-https://ipv4.nsupdate.info/myip' => 'nsupdate.info-ipv4' ],
159     + [ 'nsupdate.info-ipv6-https://ipv6.nsupdate.info/myip' => 'nsupdate.info-ipv6' ],
160     + [ 'zoneedit-https://dynamic.zoneedit.com/checkip.html' => 'zoneedit' ]
161 brianr 1.1 + ] );
162     + return $webservices
163     +
164     + #my $output = `ddclient -list-web-services`; # Run ddclient command to get web services output
165     + #my @lines;
166     + #foreach my $line (split /\n/, $output) {
167     + #$line =~ s/\s+//; # Remove leading whitespace
168     + #my ($field1, $field2) = split(' ', $line, 2);
169     + #push @lines, [$field2, $field1];
170     + #}
171     + #return \@lines; # Return a reference to the lines array
172     +}
173     +
174     sub get_dns_labels {
175     #
176     # dns service names
177     + # Return array with translated results as well.
178     + #
179     + # Note that "new" ones willl not have any description / translation, this can be added to /usr/share/smanager/lib/SrvMngr/I18N/Modules/Ddclient
180     #
181     my $c = shift;
182     - my $Labels = (
183 brianr 1.3 -
184     - # v3.11.1 labels
185     - [
186     - [$c->l('1984') '1984'],
187     - [$c->l('changeip') 'changeip'],
188     - [$c->l('cloudflare') 'cloudflare'],
189     - [$c->l('cloudns') 'cloudns'],,
190     - [$c->l('digitalocean') 'digitalocean'],
191     - [$c->l('dinahosting') 'dinahosting'],
192     - [$c->l('dnsexit2') 'dnsexit2'],
193     - [$c->l('dnsmadeeasy') 'dnsmadeeasy'],
194     - [$c->l('domeneshop') 'domeneshop'],
195     - [$c->l('dondominio') 'dondominio'],
196     - [$c->l('dslreports1') 'dslreports1'],
197     - [$c->l('duckdns') 'duckdns'],
198     - [$c->l('dyndns1') 'dyndns1'],
199     - [$c->l('dyndns2') 'dyndns2'],
200     - [$c->l('easydns') 'easydns'],
201     - [$c->l('enom') 'enom'],
202     - [$c->l('freedns') 'freedns'],
203     - [$c->l('freemyip') 'freemyip'],
204     - [$c->l('gandi') 'gandi'],
205     - [$c->l('godaddy') 'godaddy'],
206     - [$c->l('googledomains') 'googledomains'],
207     - [$c->l('hetzner') 'hetzner'],
208     - [$c->l('infomaniak') 'infomaniak'],
209     - [$c->l('keysystems') 'keysystems'],
210     - [$c->l('mythicdyn') 'mythicdyn'],
211     - [$c->l('namecheap') 'namecheap'],
212     - [$c->l('nfsn') 'nfsn'],
213     - [$c->l('njalla') 'njalla'],
214     - [$c->l('noip') 'noip'],
215     - [$c->l('nsupdate') 'nsupdate'],
216     - [$c->l('ovh') 'ovh'],
217     - [$c->l('porkbun') 'porkbun'],
218     - [$c->l('regfishde') 'regfishde'],
219     - [$c->l('sitelutions') 'sitelutions'],
220     - [$c->l('woima') 'woima'],
221     - [$c->l('yandex') 'yandex'],
222     - [$c->l('zoneedit1') 'zoneedit1']
223     - ]
224     - # end of v3.11.1 labels
225 brianr 1.2 + my $dnsservices = ( [
226     + [ $c->l('1984') => '1984' ],
227     + [ $c->l('changeip') => 'changeip' ],
228     + [ $c->l('cloudflare') => 'cloudflare' ],
229     + [ $c->l('cloudns') => 'cloudns' ],
230     + [ $c->l('digitalocean') => 'digitalocean' ],
231     + [ $c->l('dinahosting') => 'dinahosting' ],
232     + [ $c->l('dnsexit') => 'dnsexit' ],
233     + [ $c->l('dnsmadeeasy') => 'dnsmadeeasy' ],
234     + [ $c->l('domeneshop') => 'domeneshop' ],
235     + [ $c->l('dondominio') => 'dondominio' ],
236     + [ $c->l('dslreports') => 'dslreports' ],
237     + [ $c->l('duckdns') => 'duckdns' ],
238     + [ $c->l('dyndns1') => 'dyndns1' ],
239     + [ $c->l('dyndns2') => 'dyndns2' ],
240     + [ $c->l('easydns') => 'easydns' ],
241     + [ $c->l('enom') => 'enom' ],
242     + [ $c->l('freedns') => 'freedns' ],
243     + [ $c->l('freemyip') => 'freemyip' ],
244     + [ $c->l('gandi') => 'gandi' ],
245     + [ $c->l('godaddy') => 'godaddy' ],
246     + [ $c->l('googledomains') => 'googledomains' ],
247     + [ $c->l('hetzner') => 'hetzner' ],
248     + [ $c->l('infomaniak') => 'infomaniak' ],
249     + [ $c->l('keysystems') => 'keysystems' ],
250     + [ $c->l('mythicdyn') => 'mythicdyn' ],
251     + [ $c->l('namecheap') => 'namecheap' ],
252     + [ $c->l('nfsn') => 'nfsn' ],
253     + [ $c->l('njalla') => 'njalla' ],
254     + [ $c->l('noip') => 'noip' ],
255     + [ $c->l('nsupdate') => 'nsupdate' ],
256     + [ $c->l('ovh') => 'ovh' ],
257     + [ $c->l('porkbun') => 'porkbun' ],
258     + [ $c->l('regfishde') => 'regfishde' ],
259     + [ $c->l('sitelutions') => 'sitelutions' ],
260     + [ $c->l('woima') => 'woima' ],
261     + [ $c->l('yandex') => 'yandex' ],
262     + [ $c->l('zoneedit') => 'zoneedit' ]
263     + ] );
264     + return $dnsservices;
265    
266     -
267 brianr 1.1 - #[ [ $c->l('CUSTOMDNS'), 'CUSTOMDNS' ],
268 brianr 1.3 - #[ $c->l('DYNDNS1'), 'DYNDNS1' ],
269     - #[ $c->l('DYNDNS2'), 'DYNDNS2' ],
270     - #[ $c->l('DYNDNS3'), 'DYNDNS3' ],
271     - #[ $c->l('ZONEDIT'), 'ZONEDIT' ],
272     - #[ $c->l('EASYDNS'), 'EASYDNS' ],
273     - #[ $c->l('HAMMER'), 'HAMMER' ],
274     - #[ $c->l('DSLREPORTS'), 'DSLREPORTS' ],
275     - #[ $c->l('EURODYNDNS'), 'EURODYNDNS' ],
276     - #[ $c->l('DTDNS'), 'DTDNS' ],
277     - #[ $c->l('LOOPIA'), 'LOOPIA' ],
278     - #[ $c->l('DNSPARK'), 'DNSPARK' ],
279     - #[ $c->l('DYNHOST'), 'DYNHOST' ],
280     - #[ $c->l('NOIP'), 'NOIP' ],
281     - #[ $c->l('CHANGEIP'), 'CHANGEIP' ],
282     - #[ $c->l('NAMECHEAP'), 'NAMECHEAP' ],
283     - #[ $c->l('SPDNS'), 'SPDNS' ],
284     - #[ $c->l('SITELUTIONS'), 'SITELUTIONS' ],
285     - #[ $c->l('FREEDNS'), 'FREEDNS' ],
286     - #[ $c->l('NSUPDATE'), 'NSUPDATE' ],
287     - #[ $c->l('CLOUDFLARE'), 'CLOUDFLARE' ],
288     - #[ $c->l('GOOGLEDOMAINS'), 'GOOGLEDOMAINS' ],
289     - #[ $c->l('DUCKDNS'), 'DUCKDNS' ],
290     - #[ $c->l('FREEMYIP'), 'FREEMYIP' ],
291     - #[ $c->l('WOIMA'), 'WOIMA' ],
292     - #[ $c->l('YANDEX'), 'YANDEX' ],
293     - #[ $c->l('DNSMADEEASY'), 'DNSMADEEASY' ],
294     - #[ $c->l('DONDOMINIO'), 'DONDOMINIO' ],
295     - #[ $c->l('NEARLYFREESPEECH'), 'NFSN' ],
296     - #[ $c->l('OVH'), 'OVH' ],
297     - #[ $c->l('CLOUDNS'), 'CLOUDNS' ]
298     - #]
299     - );
300     - return $Labels;
301 brianr 1.1 + #my $output = `ddclient -list-protocols`; # Run ddclient command and capture the output
302     + #my @protocols;
303     + #foreach my $line (split /\n/, $output) {
304     + #my ($protocol) = $line =~ /\s*(\S+)/;
305     + #next unless $protocol; # Skip if protocol is empty or contains only whitespace
306     + #my $custom_value = "$protocol.$c->l($protocol)"; # Additional column value using $c->l(protocol)
307     + #push @protocols, [$custom_value, $protocol];
308     + #}
309     + #return \@protocols; # Return a reference to the protocols array
310 brianr 1.3 }
311 brianr 1.1
312     sub main {
313 brianr 1.3 @@ -230,13 +304,15 @@
314 brianr 1.2 my $emptycust = ( scalar @FreeDomains == 0 );
315 brianr 1.1
316     my $Labels = (
317 brianr 1.2 - [ [ $c->l('SME external Interface'), "smeIF" ],
318 brianr 1.1 - [ $c->l('SME configuration DB'), "smeCMD" ],
319 brianr 1.2 - [ $c->l('web'), "web" ],
320     - [ $c->l('Interface'), "if" ],
321     - [ $c->l('IP'), "ip" ],
322     - [ $c->l('Command'), "cmd" ]
323     - ]
324     + [
325     + [ $c->l('SME external Interface') => "smeIF" ],
326     + [ $c->l('SME configuration DB') => 'smeCMD' ],
327     + [ $c->l('web') => 'web' ],
328 brianr 1.3 + [ $c->l('Router/Firewall') => 'router' ],
329 brianr 1.2 + [ $c->l('Interface') => 'if' ],
330     + [ $c->l('IP') => 'ip' ],
331 brianr 1.6 + [ $c->l('Command') => 'cmdv4' ]
332 brianr 1.2 + ]
333     );
334    
335     $c->stash(
336 brianr 1.3 @@ -246,6 +322,9 @@
337 brianr 1.1 domains => \@domains,
338     freedomains => \@FreeDomains,
339     methodlabels => $Labels,
340 brianr 1.2 + dnslabels => get_dns_labels($c),
341 brianr 1.1 + devices => get_devices_names($c),
342     + webservices => get_web_services_names($c),
343     emptydom => $emptydom,
344     emptycust => $emptycust
345     );
346 brianr 1.3 @@ -260,6 +339,7 @@
347 brianr 1.2 # Called to update the parameters relating to the Ip address of the server
348     #
349     my $c = shift;
350     + $ddc_datas{"first"} = '';
351     $ddc_datas{"success"} = pushParams($c);
352     do_display($c);
353     }
354 brianr 1.3 @@ -269,6 +349,7 @@
355 brianr 1.1 #Called to update/delete the ddclient for a specific inbuilt domain
356     #
357     my $c = shift;
358     + my $title = $c->l("MODIFY_TITLE");
359     my $retmsg;
360     if ( $c->param("Route") eq "ddclient2" ) { #Route is hidden field
361     $retmsg = performModifyCustom($c);
362 brianr 1.3 @@ -276,10 +357,11 @@
363 brianr 1.2 else {
364     $retmsg = performModifyDomain($c);
365     }
366     + $ddc_datas{"first"} = '';
367 brianr 1.1 if ( $retmsg eq "ok" ) {
368     my $dns = $c->param('dns');
369     my $domain = $c->param('domainname');
370     - $ddc_datas{"success"} = $c->l( "ddc_SUCCESSFULLY_MODIFIED", $domain,
371     + $ddc_datas{"success"} = $c->l( "SUCCESSFULLY_MODIFIED", $domain,
372     $c->l( '' . $dns ) );
373     do_display( $c, %ddc_datas );
374     }
375 brianr 1.3 @@ -296,7 +378,7 @@
376 brianr 1.1 # Create custom domain
377     #
378     my $c = shift;
379     - my $title = $c->l("ddc_CREATE_TITLE");
380     + my $title = $c->l("CREATE_TITLE");
381     my $modul = '';
382     my $trt = "NEW";
383    
384 brianr 1.3 @@ -305,18 +387,21 @@
385 brianr 1.1 title => $title,
386     modul => $modul,
387     ddc_datas => \%ddc_datas,
388     - dnslabels => get_dns_labels($c)
389     + dnslabels => get_dns_labels($c),
390     + devices => get_devices_names($c),
391     + webservices => get_web_services_names($c)
392     );
393     $c->render( template => 'ddclient' );
394     }
395 brianr 1.2
396     sub do_create_custom_actual {
397     my $c = shift;
398     + $ddc_datas{"first"} = '';
399     my $retmsg = performCreateCustom($c);
400 brianr 1.1 if ( $retmsg eq "ok" ) {
401     my $dns = $c->param('dns');
402     my $domain = $c->param('domainname');
403     - $ddc_datas{"success"} = $c->l( "ddc_SUCCESSFULLY_DELETED", $domain,
404     + $ddc_datas{"success"} = $c->l( "SUCCESSFULLY_DELETED", $domain,
405     $c->l( '' . $dns ) );
406     do_display( $c, %ddc_datas );
407     }
408 brianr 1.3 @@ -334,7 +419,7 @@
409 brianr 1.1 # Display delete or modify panel for custom domain
410     #
411     my $c = shift;
412     - my $title = $c->l("ddc_MODIFY_TITLE");
413     + my $title = $c->l("MODIFY_TITLE");
414     my $modul = '';
415     my $trt = $c->param("trt");
416    
417 brianr 1.3 @@ -349,7 +434,9 @@
418 brianr 1.1 title => $title,
419     modul => $modul,
420     ddc_datas => \%ddc_datas,
421     - dnslabels => get_dns_labels($c)
422     + dnslabels => get_dns_labels($c),
423     + devices => get_devices_names($c),
424     + webservices => get_web_services_names($c)
425     );
426     $c->render( template => 'ddclient' );
427     }
428 brianr 1.3 @@ -360,21 +447,23 @@
429 brianr 1.1 # param trt = MOD or DEL
430     #
431     my $c = shift;
432     - my $title = $c->l("ddc_MODIFY_TITLE");
433     + my $title = $c->l("MODIFY_TITLE");
434     my $modul = '';
435     my $trt = $c->param("trt");
436    
437     #Extract domain stuff from DB
438     my @results
439     = get_domain_table( $c, $c->param("Domain") ); #Returns just one row
440     - $ddc_datas{"Domain_details"} = $results[0];
441    
442     + $ddc_datas{"Domain_details"} = $results[0];
443     $ddc_datas{'trt'} = $trt;
444     $c->stash(
445     title => $title,
446     modul => $modul,
447     ddc_datas => \%ddc_datas,
448     - dnslabels => get_dns_labels($c)
449     + dnslabels => get_dns_labels($c),
450     + devices => get_devices_names($c),
451     + webservices => get_web_services_names($c)
452     );
453     $c->render( template => 'ddclient' );
454     }
455 brianr 1.3 @@ -386,10 +475,11 @@
456 brianr 1.1 #
457     my $c = shift;
458     my $route = $c->current_route;
459     - my $title = $c->l("ddc_REMOVE_TITLE");
460     + my $title = $c->l("REMOVE_TITLE");
461     my $modul = '';
462     my $retmsg = "";
463     my $domain = $c->param("Domain");
464 brianr 1.2 + $ddc_datas{"first"} = '';
465    
466     #Delete it and return to front summary panel - depends on route domain or custom
467     if ( $c->param("Route") eq "ddclient2" ) { #Route is hidden field
468 brianr 1.3 @@ -400,7 +490,7 @@
469 brianr 1.1 }
470    
471     if ( $retmsg eq "ok" ) {
472     - $ddc_datas{"success"} = $c->l( "ddc_SUCCESSFULLY_DELETED", $domain,
473     + $ddc_datas{"success"} = $c->l( "SUCCESSFULLY_DELETED", $domain,
474     $c->l( '' . $c->param("dns") ) );
475     }
476     else { $ddc_datas{"error"} = $retmsg; }
477 brianr 1.3 @@ -415,15 +505,16 @@
478 brianr 1.1 #
479     my $c = shift;
480     my $route = $c->current_route;
481     - my $title = $c->l("ddc_REMOVE_TITLE");
482     + my $title = $c->l("REMOVE_TITLE");
483     my $modul = '';
484     my $retmsg = "";
485     my $domain = $c->param("Domain");
486 brianr 1.2 + $ddc_datas{"first"} = '';
487    
488 brianr 1.1 #Delete it and return to front summary panel - depends on route domain or custom
489     $retmsg = performDeleteCustom( $c, $domain );
490     if ( $retmsg eq "ok" ) {
491     - $ddc_datas{"success"} = $c->l( "ddc_SUCCESSFULLY_DELETED", $domain );
492     + $ddc_datas{"success"} = $c->l( "SUCCESSFULLY_DELETED", $domain );
493     }
494     else { $ddc_datas{"error"} = $retmsg; }
495     do_display( $c, %ddc_datas );
496 brianr 1.4 @@ -450,7 +541,7 @@
497    
498     foreach $domain ( sort @virtualDomains ) {
499     my %properties = $domaindb->get($domain)->props;
500     - my $test = $domaindb->get_prop( $domain, "dns" ) || '';
501     + my $test = $domaindb->get($domain) || '';
502     my %extraprops;
503     if ( $test ne '' ) {
504     %extraprops = $domaindb->get($domain)->props;
505 brianr 1.3 @@ -567,6 +658,8 @@
506     my $Extinterface = $ddretrieve->prop('Extinterface') || '';
507     my $cmd = $ddretrieve->prop('cmd') || '';
508     my $forceIP = $ddretrieve->prop('ForceIP') || '';
509     + my $fwlogin = $ddretrieve->prop('fwlogin') || '';
510     + my $fwpassword = $ddretrieve->prop('fwpassword') || '';
511     my $res = {
512     "ssl" => $ssl,
513     "DeamonUpdate" => $DeamonUpdate,
514     @@ -574,29 +667,43 @@
515     "Extinterface" => $Extinterface,
516     "cmd" => $cmd,
517     "ForceIP" => $forceIP,
518     - "urlcheckip" => $urlcheckip
519     + "urlcheckip" => $urlcheckip,
520     + "FWlogin" => $fwlogin,
521     + "FWpassword" => $fwpassword
522     };
523     return $res;
524     }
525    
526     sub pushParams {
527     my $c = shift;
528     - my $DeamonUpdate = $c->param('retrievedeamonupdate');
529     - my $urlcheckip = $c->param('retrieveurlcheckip');
530     - my $ssl = $c->param('retrievessl');
531     + my $retrievedeamonupdate = $c->param('retrievedeamonupdate');
532     + my $retrieverouter = $c->param('retrieverouter');
533     + my $retrievewebservice = $c->param('retrievewebservice');
534     + my $retrieveurlcheckip = $c->param('retrieveurlcheckip');
535     + my $retrievessl = $c->param('retrievessl');
536     my $retrievemethod = $c->param('retrievemethod');
537 brianr 1.2 my $retrieveinterface = $c->param('retrieveinterface');
538     my $retrievecmd = $c->param('retrievecmd');
539     my $retrieveip = $c->param('retrieveip');
540 brianr 1.3 + my $retrievefwlogin = $c->param('retrieverouterlogin');
541     + my $retrievefwpassword = $c->param('retrieverouterpassword');
542 brianr 1.2 +
543     + #print 1 / 0; #Crash
544    
545     my $ddclient = $db->get('ddclient');
546 brianr 1.3 - $ddclient->set_prop( 'urlcheckip' => $urlcheckip );
547     - $ddclient->set_prop( 'DeamonUpdate' => $DeamonUpdate );
548     - $ddclient->set_prop( 'SSL' => $ssl );
549     + $ddclient->set_prop( 'urlcheckip' => $retrievewebservice || $retrieveurlcheckip );
550     + $ddclient->set_prop( 'DeamonUpdate' => $retrievedeamonupdate );
551     + $ddclient->set_prop( 'SSL' => $retrievessl );
552     $ddclient->set_prop( 'method' => $retrievemethod );
553     - $ddclient->set_prop( 'Extinterface' => $retrieveinterface );
554     + if ($retrievemethod eq 'router') {
555     + $ddclient->set_prop( 'Extinterface' => $retrieverouter );
556     + } else {
557     + $ddclient->set_prop( 'Extinterface' => $retrieveinterface );
558     + }
559     $ddclient->set_prop( 'cmd' => $retrievecmd );
560     $ddclient->set_prop( 'ForceIP' => $retrieveip );
561     + $ddclient->set_prop( 'fwlogin' => $retrievefwlogin );
562     + $ddclient->set_prop( 'fwpassword' => $retrievefwpassword );
563    
564     $domaindb->reload();
565    
566     @@ -616,7 +723,7 @@
567 brianr 1.1 #------------------------------------------------------------
568    
569     my $domainName = $c->param('domainName');
570     - if ( $domainName =~ /^([a-zA-Z0-9\-\.]+)$/ ) {
571     + if ( $domainName =~ /([a-zA-Z0-9\-\.]+)$/ ) {
572     $domainName = $1;
573     }
574     else {
575 brianr 1.3 @@ -624,7 +731,7 @@
576 brianr 1.1 }
577    
578     my $domainLogin = $c->param('login');
579     - if ( $domainLogin =~ /^([\-\'\w][\-\'\w\s\.\@]*)$/ ) {
580     + if ( $domainLogin =~ /([\-\'\w][\-\'\w\s\.\@]*)$/ ) {
581     $domainLogin = $1;
582     }
583     else {
584 brianr 1.3 @@ -632,7 +739,7 @@
585 brianr 1.1 }
586    
587     my $domainPassword = $c->param('password');
588     - if ( $domainPassword =~ /^(.*)$/ ) {
589     + if ( $domainPassword =~ /(.*)$/ ) {
590     $domainPassword = $1;
591     }
592     else {
593 brianr 1.3 @@ -646,7 +753,7 @@
594 brianr 1.1
595     my $dns = $c->param('dns');
596     if ( $dns eq 'CUSTOMDNS' ) {
597     - if ( $customDNS =~ /^([a-zA-Z0-9\-\.]+)$/ ) {
598     + if ( $customDNS =~ /([a-zA-Z0-9\-\.]+)$/ ) {
599     $customDNS = $1;
600     }
601     else
602 brianr 1.3 @@ -685,7 +792,7 @@
603 brianr 1.1 # Attempt to delete domain
604     #------------------------------------------------------------
605    
606     - if ( $domain =~ /^([a-zA-Z0-9\-\.]+)$/ ) {
607     + if ( $domain =~ /([a-zA-Z0-9\-\.]+)$/ ) {
608     $domain = $1;
609     }
610     else {
611 brianr 1.3 @@ -726,7 +833,7 @@
612 brianr 1.1 #------------------------------------------------------------
613    
614     my $domainName = $c->param('domainName');
615     - if ( $domainName =~ /^([a-zA-Z0-9\-\.]+)$/ ) {
616     + if ( $domainName =~ /([a-zA-Z0-9\-\.]+)$/ ) {
617     $domainName = $1;
618     }
619     else {
620 brianr 1.3 @@ -749,7 +856,7 @@
621 brianr 1.1
622     my $domainDesc = $c->param('desc');
623     my $domainLogin = $c->param('login');
624     - if ( $domainLogin =~ /^([\-\'\w][\-\'\w\s\.\@]*)$/ ) {
625     + if ( $domainLogin =~ /([\-\'\w][\-\'\w\s\.\@]*)$/ ) {
626     $domainLogin = $1;
627     }
628     else {
629 brianr 1.3 @@ -757,7 +864,7 @@
630 brianr 1.1 }
631    
632     my $domainPassword = $c->param('password');
633     - if ( $domainPassword =~ /^(.*)$/ ) {
634     + if ( $domainPassword =~ /(.*)$/ ) {
635     $domainPassword = $1;
636     }
637     else {
638 brianr 1.3 @@ -771,7 +878,7 @@
639 brianr 1.1
640     my $dns = $c->param('dns');
641     if ( $dns eq 'CUSTOMDNS' ) {
642     - if ( $customDNS =~ /^([a-zA-Z0-9\-\.]+)$/ ) {
643     + if ( $customDNS =~ /([a-zA-Z0-9\-\.]+)$/ ) {
644     $customDNS = $1;
645     }
646     else {
647 brianr 1.3 @@ -809,7 +916,7 @@
648 brianr 1.1 #------------------------------------------------------------
649    
650     my $domainName = $c->param('domainName');
651     - if ( $domainName =~ /^([a-zA-Z0-9\-\.]+)$/ ) {
652     + if ( $domainName =~ /([a-zA-Z0-9\-\.]+)$/ ) {
653     $domainName = $1;
654     }
655     else {
656 brianr 1.3 @@ -817,7 +924,7 @@
657 brianr 1.1 }
658    
659     my $domainLogin = $c->param('login');
660     - if ( $domainLogin =~ /^([\-\'\w][\-\'\w\s\.\@]*)$/ ) {
661     + if ( $domainLogin =~ /([\-\'\w][\-\'\w\s\.\@]*)$/ ) {
662     $domainLogin = $1;
663     }
664     else {
665 brianr 1.3 @@ -825,7 +932,7 @@
666 brianr 1.1 }
667    
668     my $domainPassword = $c->param('password');
669     - if ( $domainPassword =~ /^(.*)$/ ) {
670     + if ( $domainPassword =~ /(.*)$/ ) {
671     $domainPassword = $1;
672     }
673     else {
674 brianr 1.3 @@ -839,7 +946,7 @@
675 brianr 1.1
676     my $dns = $c->param('dns');
677     if ( $dns eq 'CUSTOMDNS' ) {
678     - if ( $customDNS =~ /^([a-zA-Z0-9\-\.]+)$/ ) {
679     + if ( $customDNS =~ /([a-zA-Z0-9\-\.]+)$/ ) {
680     $customDNS = $1;
681     }
682     else
683 brianr 1.3 @@ -878,7 +985,7 @@
684 brianr 1.1 # Attempt to delete domain
685     #------------------------------------------------------------
686    
687     - if ( $domain =~ /^([a-zA-Z0-9\-\.]+)$/ ) {
688     + if ( $domain =~ /([a-zA-Z0-9\-\.]+)$/ ) {
689     $domain = $1;
690     }
691     else {
692     diff -urN smeserver-ddclient-1.3.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Ddclient/en.pm smeserver-ddclient-1.3.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Ddclient/en.pm
693     --- smeserver-ddclient-1.3.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Ddclient/en.pm 2023-11-10 16:11:05.916271986 +0000
694 brianr 1.7 +++ smeserver-ddclient-1.3.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Ddclient/en.pm 2023-12-18 09:29:00.000000000 +0000
695     @@ -80,46 +80,48 @@
696 brianr 1.2 'CLOUDNS'=>'CLOUDNS www.cloudns.net',
697     # End of Service descriptions
698    
699     -# v3.11.1 Service descriptions:
700 brianr 1.7 -"1984" => "https://kb.1984hosting.com/doku.php?id=freedns",
701     -"changeip" => "https://changeip.com",
702     -"cloudflare" => "https://cloudflare.com",
703     -"cloudns" => "https://cloudns.com",
704     -"digitalocean" => "https://digitalocean.com",
705     -"dinahosting" => "https://dinahosting.com",
706     -"dnsexit" => "https://dnsexit.com/",
707     -"dnsmadeeasy" => "https://dnsmadeeasy.com",
708     -"domeneshop" => "https://domeneshop.com",
709     -"dondominio" => "https://dondominio.com",
710     -"dslreports" => "https://www.dslreports.com/",
711     -"duckdns" => "https://duckdns.com",
712     -"dyndns1" => "https://account.dyn.com/",
713     -"dyndns2" => "https://account.dyn.com/",
714     -"easydns" => "https://easydns.com",
715     -"enom" => "https://enom.com",
716     -"freedns" => "http://freedns.com",
717     -"freemyip" => "https://freemyip.com",
718     -"gandi" => "https://gandi.com",
719     -"godaddy" => "https://godaddy.com",
720     -"googledomains" => "https://googledomains.com",
721     -"hetzner" => "https://hetzner.com",
722     -"infomaniak" => "https://infomaniak.com",
723     -"keysystems" => "https://keysystems.com",
724     -"mythicdyn" => "https://www.mythic-beasts.com/support/api/dnsv2/dynamic-dns",
725     -"namecheap" => "https://namecheap.com",
726     -"nfsn" => "http://nfsn.com",
727     -"njalla" => "https://njalla.com",
728     -"noip" => "https://noip.com",
729     -"nsupdate" => "http://nsupdate.com",
730     -"ovh" => "https://ovh.com",
731     -"porkbun" => "https://porkbun.com",
732     -"regfishde" => "regfishde",
733     -"sitelutions" => "https://sitelutions.com",
734     -"woima" => "http://woima.com",
735     -"yandex" => "https://yandex.com",
736     -"zoneedit" => "https://www.zoneedit.com/dynamic-dns/",
737     -# end of v3.11.1 Service descriptions:
738 brianr 1.2 +# v3.11.x Service descriptions:
739 brianr 1.7 +"1984" => "1984-https://kb.1984hosting.com/doku.php?id=freedns",
740     +"changeip" => "changeip-https://changeip.com",
741     +"cloudflare" => "cloudflare-https://cloudflare.com",
742     +"cloudns" => "cloudns-https://cloudns.com",
743     +"digitalocean" => "digitalocean-https://digitalocean.com",
744     +"dinahosting" => "dinahosting-https://dinahosting.com",
745     +"dnsexit" => "dnsexit-https://dnsexit.com/",
746     +"dnsmadeeasy" => "dnsmadeeasy-https://dnsmadeeasy.com",
747     +"domeneshop" => "domeneshop-https://domeneshop.com",
748     +"dondominio" => "dondominio-https://dondominio.com",
749     +"dslreports" => "dslreports-https://www.dslreports.com/",
750     +"duckdns" => "duckdns-https://duckdns.com",
751     +"dyndns1" => "dyndns1-https://account.dyn.com/",
752     +"dyndns2" => "dyndns2-https://account.dyn.com/",
753     +"easydns" => "easydns-https://easydns.com",
754     +"enom" => "enom-https://enom.com",
755     +"freedns" => "freedns-http://freedns.com",
756     +"freemyip" => "freemyip-https://freemyip.com",
757     +"gandi" => "gandi-https://gandi.com",
758     +"godaddy" => "godaddy-https://godaddy.com",
759     +"googledomains" => "googledomains-https://googledomains.com",
760     +"hetzner" => "hetzner-https://hetzner.com",
761     +"infomaniak" => "infomaniak-https://infomaniak.com",
762     +"keysystems" => "keysystems-https://keysystems.com",
763     +"mythicdyn" => "mythicdyn-https://www.mythic-beasts.com/support/api/dnsv2/dynamic-dns",
764     +"namecheap" => "namecheap-https://namecheap.com",
765     +"nfsn" => "nfsn-http://nfsn.com",
766     +"njalla" => "njalla-https://njalla.com",
767     +"noip" => "noip-https://noip.com",
768     +"nsupdate" => "nsupdate-http://nsupdate.com",
769     +"ovh" => "ovh-https://ovh.com",
770     +"porkbun" => "porkbun-https://porkbun.com",
771     +"regfishde" => "regfishde-regfishde",
772     +"sitelutions" => "sitelutions-https://sitelutions.com",
773     +"woima" => "woima-http://woima.com",
774     +"yandex" => "yandex-https://yandex.com",
775     +"zoneedit" => "zoneedit-https://www.zoneedit.com/dynamic-dns/",
776 brianr 1.2 +# end of v3.11.x Service descriptions:
777    
778 brianr 1.7 +'MODIFY_DESCRIPTION' => "You can modify the Dynamic DNS Service that you use and change the username and password",
779     +'CREATE_DESCRIPTION' => "You can create a domain to use for the Dynamic DNS Service that you use and set or change the username and password",
780 brianr 1.2 'CUSTOMDNS' => 'Custom Dynamic DNS Provider',
781     'CUSTOMDNS_LABEL' => 'Custom server Address',
782 brianr 1.7 'CUSTOM_PROTOCOL_LABEL' => 'Custom ddclient Protocol',
783     @@ -136,8 +138,8 @@
784 brianr 1.1 'DESCRIPTION_LABEL' => 'Domain description',
785     'SUCCESSFULLY_MODIFIED_RETRIEVE_IP' => 'You have successfully modified the retrieve IP options.',
786     'RETRIEVE_METHOD' => 'Method to retrieve new IP:',
787     -'RETRIEVE_IF' => 'Local interface to get new IP, if selected interface method',
788     -'RETRIEVE_CMD' => 'Command to execute to get IP, if selected command method',
789     +'RETRIEVE_IF' => 'Local interface to get new IP',
790     +'RETRIEVE_CMD' => 'Command to execute to get IP',
791     'SME external Interface' => 'SME external interface',
792     'SME configuration DB' => 'SME configuration DB',
793     'web' => 'Web query',
794     diff -urN smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_create_cust.html.ep smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_create_cust.html.ep
795     --- smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_create_cust.html.ep 2020-06-28 09:57:52.000000000 +0100
796 brianr 1.7 +++ smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_create_cust.html.ep 2023-12-18 09:35:00.000000000 +0000
797     @@ -1,41 +1,43 @@
798     -<div id='ddc_createcustom'>
799     +<div id='createcustom'>
800 brianr 1.1 <h2>
801     - %= l 'ddc_CUSTOM_DESCRIPTION'
802 brianr 1.7 + %= l 'CREATE_DESCRIPTION'
803 brianr 1.1 </h2><br>
804 brianr 1.7 - % my $btn = l('ddc_APPLY');
805     + % my $btn = l('APPLY');
806 brianr 1.1 %= form_for '/ddclient7' => (method => 'POST') => begin
807 brianr 1.7 <span class=label>
808     - %=l 'ddc_DOMAIN_NAME_LABEL'
809     + %=l 'DOMAIN_NAME_LABEL'
810     </span><span class=data>
811     %=text_field 'domainName'
812     </span><br>
813     <span class=label>
814     - %=l 'ddc_DESCRIPTION_LABEL'
815     + %=l 'DESCRIPTION_LABEL'
816     </span><span class=data>
817     %=text_field 'desc'
818     </span><br>
819     <span class=label>
820     - %=l 'ddc_SERVERS_LABEL'
821     + %=l 'SERVERS_LABEL'
822     </span><span class=data>
823     %=select_field dns=>$dnslabels
824     </span><br>
825     +<!--
826     <span class=label>
827     - %=l 'ddc_CUSTOMDNS_LABEL'
828     + %=l 'CUSTOMDNS_LABEL'
829     </span><span class=data>
830     %=text_field 'customdns'
831     </span><br>
832     <span class=label>
833     - %=l 'ddc_CUSTOM_PROTOCOL_LABEL'
834     + %=l 'CUSTOM_PROTOCOL_LABEL'
835     </span><span class=data>
836     %=text_field 'customprotocol'
837     </span><br>
838     +-->
839     <span class=label>
840     - %=l 'ddc_NAME_LABEL'
841     + %=l 'NAME_LABEL'
842     </span><span class=data>
843     %=text_field 'login'
844     </span><br>
845     <span class=label>
846     - %=l 'ddc_PASSWORD_LABEL'
847     + %=l 'PASSWORD_LABEL'
848     </span><span class=data>
849     %=password_field 'password',id=>"ddcPass"
850     %=label_for show=>"Show"
851     @@ -52,7 +54,7 @@
852     % end
853     </span><br>
854     <span class=label>
855     - %=l 'ddc_MX'
856     + %=l 'MX'
857     </span><span class=data>
858     %=text_field 'mx'
859     </span><br>
860 brianr 1.9 diff -urN smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_del.html.ep smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_del.html.ep
861     --- smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_del.html.ep 2023-11-10 16:11:05.900271940 +0000
862     +++ smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_del.html.ep 2023-12-18 11:14:00.000000000 +0000
863     @@ -2,7 +2,7 @@
864     % my $btn = l('REMOVE');
865     %= form_for '/ddclient4' => (method => 'POST') => begin
866     <p>
867     - %= $c->render_to_string(inline =>l("ddc_REMOVE_DESCRIPTION",$ddc_datas->{"Domain_details"}->{"Domain"},$ddc_datas->{"Domain_details"}->{"Description"},$c->l($ddc_datas->{"Domain_details"}->{"Publication"})))
868     + %= $c->render_to_string(inline =>l("REMOVE_DESCRIPTION",$ddc_datas->{"Domain_details"}->{"Domain"},$ddc_datas->{"Domain_details"}->{"Description"},$c->l($ddc_datas->{"Domain_details"}->{"Publication"})))
869     </p>
870     % param Domain=>$ddc_datas->{"Domain_details"}->{"Domain"};
871     %= hidden_field Domain=>$ddc_datas->{"Domain_details"}->{"Domain"}
872     diff -urN smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_domainlist.html.ep smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_domainlist.html.ep
873     --- smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_domainlist.html.ep 2023-11-10 16:11:05.900271940 +0000
874     +++ smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_domainlist.html.ep 2023-12-18 11:46:00.000000000 +0000
875     @@ -36,9 +36,12 @@
876     %= t td => (class => 'sme-border') => $Domain->{"Publication"}
877     <td class = 'sme-border'>
878     <a href="/smanager/ddclient1?trt=MOD&Domain=<%= $Domain->{"Domain"}%>"><%=l 'MODIFY'%></a>
879     - </td><td class = 'sme-border'>
880     - <a href="/smanager/ddclient1?trt=DEL&Domain=<%= $Domain->{"Domain"}%>"><%=l 'REMOVE'%></a>
881     - </td>
882     + </td>
883     + % if ($Domain->{"Publication"} ne ""){
884     + <td class = 'sme-border'>
885     + <a href="/smanager/ddclient1?trt=DEL&Domain=<%= $Domain->{"Domain"}%>"><%=l 'REMOVE'%></a>
886     + </td>
887     + % }
888     </tr>
889     %}
890     </tbody>
891 brianr 1.1 diff -urN smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_modify_domain.html.ep smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_modify_domain.html.ep
892     --- smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_modify_domain.html.ep 2023-11-10 16:11:05.901271943 +0000
893 brianr 1.9 +++ smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_modify_domain.html.ep 2023-12-18 11:13:00.000000000 +0000
894     @@ -1,6 +1,11 @@
895 brianr 1.1 <div id='modifydomain'>
896     + <script>
897     + window.onload = function() {
898     + SelectInput();
899     + };
900     + </script>
901     <h2>
902 brianr 1.9 - %= l 'CUSTOM_DESCRIPTION'
903     + %= l 'MODIFY_DESCRIPTION'
904 brianr 1.1 </h2><br>
905 brianr 1.9 % my $btn = l('APPLY');
906     %= form_for '/ddclient8' => (method => 'POST') => begin
907     @@ -10,34 +15,60 @@
908     %= hidden_field domainName => $ddc_datas->{"Domain_details"}->{"Domain"}
909     %= $ddc_datas->{"Domain_details"}->{"Domain"}
910     </span><br><br>
911     +
912     <span class=label>
913     %=l 'DESCRIPTION_LABEL'
914     </span><span class=data>
915     %= $ddc_datas->{"Domain_details"}->{"Description"}
916     </span><br><br>
917     +
918     + % if ($ddc_datas->{"Domain_details"}->{"Content"} ne ""){
919     <span class=label>
920     %= $ddc_datas->{"Domain_details"}->{"Content"}
921     </span><span class=data>
922     %= $ddc_datas->{"Domain_details"}->{"Content"}
923     </span><br><br>
924     + % }
925     +
926     <span class=label>
927 brianr 1.1 %=l 'SERVERS_LABEL'
928     </span><span class=data>
929     % param dns=>$ddc_datas->{"Domain_details"}->{"dns"};
930     - %=select_field dns=>$dnslabels
931     + %=select_field dns=>$dnslabels,id=>"dns",onchange=>"SelectInput()",onload=>"SelectInput()"
932     + %= javascript begin
933     + function SelectInput() {
934     + var method = document.querySelector("#dns");
935     + const types=['custom'];
936     + types.forEach((type)=>{
937     + var service = document.querySelector(`.${type}`);
938     + if (service != null) {
939     + if (method.value == type) {
940     + service.style.display = 'block';
941     + } else {
942     + service.style.display = 'none';
943     + }
944     + }
945     + })
946     + }
947     + %end
948     </span><br>
949     - <span class=label>
950     +
951     + %# Dependant on the custom choice from above
952     + <div class=custom>
953     + <span class=label custom>
954     %=l 'CUSTOMDNS_LABEL'
955     - </span><span class=data>
956     + </span><span class=data custom>
957     % param customdns=>$ddc_datas->{"Domain_details"}->{"customdns"};
958     %=text_field 'customdns'
959     </span><br>
960     - <span class=label>
961     + <span class=label custom>
962     %=l 'CUSTOM_PROTOCOL_LABEL'
963     - </span><span class=data>
964     + </span><span class=data custom>
965     % param customprotocol=>$ddc_datas->{"Domain_details"}->{"customprotocol"};
966     %=text_field 'customprotocol'
967     </span><br>
968     + </div>
969     +
970     <span class=label>
971     %=l 'NAME_LABEL'
972     </span><span class=data>
973     diff -urN smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_paramlist.html.ep smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_paramlist.html.ep
974     --- smeserver-ddclient-1.3.0.old/root/usr/share/smanager/themes/default/templates/partials/_ddc_paramlist.html.ep 2023-11-10 16:11:05.902271946 +0000
975 brianr 1.9 +++ smeserver-ddclient-1.3.0/root/usr/share/smanager/themes/default/templates/partials/_ddc_paramlist.html.ep 2023-12-16 08:19:00.000000000 +0000
976 brianr 1.1 @@ -1,4 +1,9 @@
977     <div id='paramlist'>
978     + <script>
979     + window.onload = function() {
980     + SelectInput();
981     + };
982     + </script>
983     <h2>
984     %= l 'Params_for_IP_Retrieval'
985     </h2>
986 brianr 1.2 @@ -7,11 +12,11 @@
987     <span class=label>
988     %=l 'RETRIEVE_SSL'
989     </span><span class=data>
990     - % param retrievessl=>$ddc_datas->{"params"}->{"ssl"};
991     + % param retrievessl=>$ddc_datas->{"params"}->{"ssl"} unless param 'retrievessl';
992 brianr 1.1 %=select_field retrievessl=>[['Yes'=>'yes'],['No'=>'no']]
993     </span><br>
994     <span class=label>
995     - %=l 'RETRIEVE_DEAMONUPDATE'
996     + %=l 'RETRIEVE_DEAMONUPDATE'
997     </span><span class=data>
998     % param retrievedeamonupdate=>$ddc_datas->{"params"}->{"DeamonUpdate"};
999     %=number_field 'retrievedeamonupdate',min=>0
1000 brianr 1.3 @@ -19,33 +24,112 @@
1001 brianr 1.2 <span class=label>
1002 brianr 1.1 %=l 'RETRIEVE_METHOD'
1003     </span><span class=data>
1004 brianr 1.2 - % param retrievemethod=>$ddc_datas->{"params"}->{"method"};
1005 brianr 1.1 - %=select_field retrievemethod=>$methodlabels
1006     - </span><br>
1007     - <span class=label>
1008 brianr 1.3 - %=l 'RETRIEVE_IF'
1009     - </span><span class=data>
1010     - % param retrieveinterface=>$ddc_datas->{"params"}->{"Extinterface"};
1011     - %=text_field 'retrieveinterface'
1012     - </span><br>
1013     - <span class=label>
1014     - %=l 'RETRIEVE_CMD'
1015     - </span><span class=data>
1016     - % param retrievecmd=>$ddc_datas->{"params"}->{"cmd"};
1017     - %=text_field 'retrievecmd'
1018     - </span><br>
1019     - <span class=label>
1020     - %=l 'RETRIEVE_IP'
1021     - </span><span class=data>
1022     - % param retrieveip=>$ddc_datas->{"params"}->{"ForceIP"};
1023     - %=text_field 'retrieveip'
1024     - </span><br>
1025     - <span class=label>
1026     - %=l 'RETRIEVE_URLCHECKIP'
1027     - </span><span class=data>
1028     - % param retrieveurlcheckip=>$ddc_datas->{"params"}->{"urlcheckip"};
1029     - %=text_field 'retrieveurlcheckip'
1030     - </span><br>
1031 brianr 1.2 + % param retrievemethod=>$ddc_datas->{"params"}->{"method"} unless param 'retrievemethod';
1032 brianr 1.1 + %=select_field retrievemethod=>$methodlabels,id=>"retrievemethod",onchange=>"SelectInput()"
1033     + %= javascript begin
1034     + function SelectInput() {
1035     + var method = document.querySelector("#retrievemethod");
1036 brianr 1.6 + const types=['smeIF','smeCMD','web','router','if','ip','cmdv4','custom'];
1037 brianr 1.1 + types.forEach((type)=>{
1038     + var service = document.querySelector(`.${type}`);
1039     + if (service != null) {
1040     + if (method.value == type) {
1041     + service.style.display = 'block';
1042     + } else {
1043     + service.style.display = 'none';
1044     + }
1045     + }
1046     + })
1047     + }
1048     + % end
1049     + </span><br>
1050     + %#
1051     + %# From here the one that is shown depends on the choice above
1052     + %#
1053     + %# Only if "router" is chosen
1054     + <div class = router>
1055 brianr 1.3 + <span class=label>
1056     + %=l 'Router type'
1057     + </span><span class=data>
1058     + % param retrieverouter=>$ddc_datas->{"params"}->{"Extinterface"} unless param 'retrieverouter';
1059     + %=select_field retrieverouter=>$devices
1060     + </span><br>
1061     + %# Need login and password for router
1062     + <span class=label>
1063     + %=l 'Router login'
1064     + </span><span class=data>
1065     + % param retrieverouterlogin=>$ddc_datas->{"params"}->{"FWLogin"} unless param 'retrieverouter';
1066     + %=text_field 'retrieverouterlogin'
1067     + </span><br>
1068     + <span class=label>
1069     + %=l 'Router password'
1070     + </span><span class=data>
1071     + % param retrieverouterpassword=>$ddc_datas->{"params"}->{"FWPassword"} unless param 'retrieverouterpassword';
1072     + %=password_field 'retrieverouterpassword', id=>'ddcPass'
1073     + %=label_for show=>"Show"
1074     + %=check_box show=>1,onclick=>"showPass()",style=>"vertical-align:middle;"
1075     + %= javascript begin
1076     + function showPass() {
1077     + var x = document.getElementById("ddcPass");
1078     + if (x.type === "password") {
1079     + x.type = "text";
1080     + } else {
1081     + x.type = "password";
1082     + }
1083     + }
1084     + % end
1085     + </span><br>
1086 brianr 1.1 + </div>
1087     +
1088     + %# Only if "web" is chosen"
1089     + <div class = web>
1090 brianr 1.3 + <span class=label>
1091     + %=l 'Web service'
1092     + </span><span class=data>
1093     + % param retrievewebservice=>$ddc_datas->{"params"}->{"urlcheckip"} unless param 'retrievewebservice';
1094 brianr 1.5 + %=select_field retrievewebservice=>$webservices
1095 brianr 1.3 + </span><br />
1096 brianr 1.1 + </div>
1097     +
1098     + %# Only if "Interface" is chosen
1099     + <div class=if>
1100 brianr 1.3 + <span class=label Interface>
1101     + %=l 'RETRIEVE_IF'
1102     + </span><span class=data Interface>
1103     + % param retrieveinterface=>$ddc_datas->{"params"}->{"Extinterface"} unless param 'retrieveinterface';
1104     + %=text_field 'retrieveinterface'
1105     + </span><br>
1106 brianr 1.1 + </div>
1107     +
1108     + %# Only if "cmd" is chosen
1109 brianr 1.6 + <div class=cmdv4>
1110 brianr 1.3 + <span class=label cmd>
1111     + %=l 'RETRIEVE_CMD'
1112     + </span><span class=data cmd>
1113 brianr 1.6 + % param retrievecmd=>$ddc_datas->{"params"}->{"cmdv4"} unless param 'retrievecmd';
1114 brianr 1.3 + %=text_field 'retrievecmd'
1115     + </span><br>
1116 brianr 1.1 + </div>
1117     +
1118     + %# Only if "ip" is chosen
1119     + <div class=ip>
1120 brianr 1.3 + <span class=label ip>
1121     + %=l 'RETRIEVE_IP'
1122     + </span><span class=data ip>
1123     + % param retrieveip=>$ddc_datas->{"params"}->{"ForceIP"} unless param 'retrieveip';
1124     + %=text_field 'retrieveip'
1125     + </span><br>
1126 brianr 1.1 + </div>
1127     +
1128     + %# Only if "custom web service"
1129     + <div class=custom>
1130 brianr 1.3 + <span class=label customweb>
1131     + %=l 'RETRIEVE_URLCHECKIP'
1132     + </span><span class=data customweb>
1133     + % param retrieveurlcheckip=>$ddc_datas->{"params"}->{"urlcheckip"} unless param 'retrieveurlcheckip';
1134     + %=text_field 'retrieveurlcheckip'
1135     + </span><br>
1136 brianr 1.1 + </div>
1137    
1138     %= submit_button "$btn", class => 'action'
1139     % end

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed