immernoch das alte Problem...
[ipfire-2.x.git] / html / cgi-bin / ddns.cgi
CommitLineData
cd1a2927
MT
1#!/usr/bin/perl\r
2#\r
3# SmoothWall CGIs\r
4#\r
5# This code is distributed under the terms of the GPL\r
6#\r
7# (c) The SmoothWall Team\r
8#\r
9# $Id: ddns.cgi,v 1.7.2.41 2006/02/07 01:29:47 franck78 Exp $\r
10#\r
11\r
12use strict;\r
13\r
14# enable only the following on debugging purpose\r
15#use warnings;\r
16#use CGI::Carp 'fatalsToBrowser';\r
17\r
18require 'CONFIG_ROOT/general-functions.pl';\r
19require "${General::swroot}/lang.pl";\r
20require "${General::swroot}/header.pl";\r
21\r
22#workaround to suppress a warning when a variable is used only once\r
23my @dummy = ( ${Header::table2colour}, ${Header::colouryellow} );\r
24undef (@dummy);\r
25\r
26my $ddnsprefix = $Lang::tr{'ddns noip prefix'};\r
27$ddnsprefix =~ s/%/$General::noipprefix/;\r
28\r
29# Files used\r
30my $setting = "${General::swroot}/ddns/settings";\r
31our $datafile = "${General::swroot}/ddns/config";\r
32\r
33my %settings=();\r
34#Settings1\r
35$settings{'BEHINDROUTER'} = 'RED_IP';\r
36$settings{'MINIMIZEUPDATES'} = '';\r
37\r
38#Settings2 for editing the multi-line list\r
39#Must not be saved !\r
40$settings{'HOSTNAME'} = '';\r
41$settings{'DOMAIN'} = '';\r
42$settings{'LOGIN'} = '';\r
43$settings{'PASSWORD'} = '';\r
44$settings{'PASSWORD2'} = '';\r
45$settings{'ENABLED'} = '';\r
46$settings{'PROXY'} = '';\r
47$settings{'WILDCARDS'} = '';\r
48$settings{'SERVICE'} = '';\r
49\r
50my @nosaved=('HOSTNAME','DOMAIN','LOGIN','PASSWORD','PASSWORD2',\r
51 'ENABLED','PROXY','WILDCARDS','SERVICE'); # List here ALL setting2 fields. Mandatory\r
52 \r
53$settings{'ACTION'} = ''; # add/edit/remove\r
54$settings{'KEY1'} = ''; # point record for ACTION\r
55$settings{'KEY2'} = ''; # point record for ACTION\r
56\r
57my $errormessage = '';\r
58my $warnmessage = '';\r
59\r
60&Header::showhttpheaders();\r
61\r
62#Get GUI values\r
63&Header::getcgihash(\%settings);\r
64\r
65# Load multiline data\r
66our @current = ();\r
67if (open(FILE, "$datafile")) {\r
68 @current = <FILE>;\r
69 close (FILE);\r
70}\r
71\r
72#\r
73# Check Settings1 first because they are needed before working on @current\r
74#\r
75if ($settings{'ACTION'} eq $Lang::tr{'save'}) {\r
76 # No user input to check. !\r
77 #unless ($errormessage) { # Everything is ok, save settings\r
78 $settings{'BEHINDROUTERWAITLOOP'} = '-1'; # init & will update on next setddns.pl call\r
79 map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1','KEY2'));# Must never be saved \r
80 &General::writehash($setting, \%settings); # Save good settings\r
81 $settings{'ACTION'} = $Lang::tr{'save'}; # Recreate 'ACTION'\r
82 map ($settings{$_}= '',(@nosaved,'KEY1','KEY2')); # and reinit var to empty\r
83 #}\r
84} else {\r
85 &General::readhash($setting, \%settings); # Get saved settings and reset to good if needed\r
86}\r
87\r
88#\r
89# Now manipulate the multi-line list with Settings2\r
90#\r
91# Toggle enable/disable field. Field is in second position\r
92if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) {\r
93 #move out new line\r
94 chomp(@current[$settings{'KEY1'}]);\r
95 my @temp = split(/\,/,@current[$settings{'KEY1'}]);\r
96 my $K2=$settings{'KEY2'};\r
97 $temp[ $K2 ] = ( $temp[ $K2 ] eq 'on') ? '' : 'on'; # Toggle the field\r
98 @current[$settings{'KEY1'}] = join (',',@temp)."\n";\r
99 $settings{'KEY1'} = ''; # End edit mode\r
100 &General::log($Lang::tr{'ddns hostname modified'});\r
101\r
102 # Write changes to config file.\r
103 &WriteDataFile; # sort newly added/modified entry\r
104}\r
105\r
106if ($settings{'ACTION'} eq $Lang::tr{'add'}) {\r
107 # Validate inputs\r
108\r
109 unless ($settings{'LOGIN'} ne '') {\r
110 $errormessage = $Lang::tr{'username not set'};\r
111 }\r
112\r
113 # list box returns 'service optional synonyms'\r
114 # keep only first name\r
115 $settings{'SERVICE'} =~ s/ .*$//;\r
116 \r
117 # for freedns.afraid.org, only 'connect string' is mandatory\r
118 if ($settings{'SERVICE'} ne 'freedns.afraid.org') {\r
119 unless ($settings{'SERVICE'} eq 'regfish.com' || $settings{'PASSWORD'} ne '') {\r
120 $errormessage = $Lang::tr{'password not set'};\r
121 }\r
122 unless ($settings{'PASSWORD'} eq $settings{'PASSWORD2'}) {\r
123 $errormessage = $Lang::tr{'passwords do not match'};\r
124 }\r
125 \r
126 # Permit an empty HOSTNAME for the nsupdate, regfish, dyndns, enom, ovh, zoneedit, no-ip, easydns\r
127 unless ($settings{'SERVICE'} eq 'zoneedit.com' || $settings{'SERVICE'} eq 'nsupdate' || \r
128 $settings{'SERVICE'} eq 'dyndns-custom'|| $settings{'SERVICE'} eq 'regfish.com' || \r
129 $settings{'SERVICE'} eq 'enom.com' || $settings{'SERVICE'} eq 'dnspark.com' ||\r
130 $settings{'SERVICE'} eq 'ovh.com' || $settings{'HOSTNAME'} ne '' ||\r
131 $settings{'SERVICE'} eq 'no-ip.com' || $settings{'SERVICE'} eq 'easydns.com' ) {\r
132 $errormessage = $Lang::tr{'hostname not set'};\r
133 }\r
134 unless ($settings{'HOSTNAME'} eq '' || $settings{'HOSTNAME'} =~ /^[a-zA-Z_0-9-]+$/) {\r
135 $errormessage = $Lang::tr{'invalid hostname'};\r
136 }\r
137 unless ($settings{'DOMAIN'} ne '') {\r
138 $errormessage = $Lang::tr{'domain not set'};\r
139 }\r
140 unless ($settings{'DOMAIN'} =~ /^[a-zA-Z_0-9.-]+$/) { \r
141 $errormessage = $Lang::tr{'invalid domain name'};\r
142 }\r
143 unless ($settings{'DOMAIN'} =~ /[.]/) {\r
144 $errormessage = $Lang::tr{'invalid domain name'};\r
145 }\r
146 }\r
147\r
148 # recheck service wich don't need too much fields\r
149 if ($settings{'SERVICE'} eq 'cjb.net') {\r
150 $errormessage = ''; # clear previous error\r
151 unless ($settings{'LOGIN'} ne '') {\r
152 $errormessage = $Lang::tr{'username not set'};\r
153 }\r
154 unless ($settings{'PASSWORD'} ne '') {\r
155 $errormessage = $Lang::tr{'password not set'};\r
156 }\r
157 unless ($settings{'PASSWORD'} eq $settings{'PASSWORD2'}) {\r
158 $errormessage = $Lang::tr{'passwords do not match'};\r
159 }\r
160 }\r
161\r
162 unless ($errormessage) {\r
163 if ($settings{'KEY1'} eq '') { #add or edit ?\r
164 unshift (@current, "$settings{'SERVICE'},$settings{'HOSTNAME'},$settings{'DOMAIN'},$settings{'PROXY'},$settings{'WILDCARDS'},$settings{'LOGIN'},$settings{'PASSWORD'},$settings{'ENABLED'}\n");\r
165 &General::log($Lang::tr{'ddns hostname added'});\r
166 } else {\r
167 @current[$settings{'KEY1'}] = "$settings{'SERVICE'},$settings{'HOSTNAME'},$settings{'DOMAIN'},$settings{'PROXY'},$settings{'WILDCARDS'},$settings{'LOGIN'},$settings{'PASSWORD'},$settings{'ENABLED'}\n";\r
168 $settings{'KEY1'} = ''; # End edit mode\r
169 &General::log($Lang::tr{'ddns hostname modified'});\r
170 }\r
171 map ($settings{$_}='' ,@nosaved); # Clear fields\r
172 # Write changes to config file.\r
173 &WriteDataFile; # sort newly added/modified entry\r
174 }\r
175}\r
176\r
177if ($settings{'ACTION'} eq $Lang::tr{'edit'}) {\r
178 #move out new line\r
179 my $line = @current[$settings{'KEY1'}]; # KEY1 is the index in current\r
180 chomp($line);\r
181 my @temp = split(/\,/, $line);\r
182 $settings{'SERVICE'} = $temp[0];\r
183 $settings{'HOSTNAME'} = $temp[1];\r
184 $settings{'DOMAIN'} = $temp[2];\r
185 $settings{'PROXY'} = $temp[3];\r
186 $settings{'WILDCARDS'} = $temp[4];\r
187 $settings{'LOGIN'} = $temp[5];\r
188 $settings{'PASSWORD'} = $settings{'PASSWORD2'} = $temp[6];\r
189 $settings{'ENABLED'} = $temp[7];\r
190}\r
191\r
192if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {\r
193 splice (@current,$settings{'KEY1'},1); # Delete line \r
194 open(FILE, ">$datafile") or die 'ddns datafile error';\r
195 print FILE @current;\r
196 close(FILE);\r
197 $settings{'KEY1'} = ''; # End remove mode\r
198 &General::log($Lang::tr{'ddns hostname removed'});\r
199 # Write changes to config file.\r
200 &WriteDataFile;\r
201}\r
202\r
203if ($settings{'ACTION'} eq $Lang::tr{'instant update'}) {\r
204 system('/usr/local/bin/setddns.pl', '-f');\r
205}\r
206\r
207\r
208if ($settings{'ACTION'} eq '')\r
209{\r
210 $settings{'SERVICE'} = 'dyndns.org';\r
211 $settings{'ENABLED'} = 'on';\r
212}\r
213\r
214&Header::openpage($Lang::tr{'dynamic dns'}, 1, '');\r
215&Header::openbigbox('100%', 'left', '', $errormessage);\r
216\r
217my %checked =(); # Checkbox manipulations\r
218$checked{'SERVICE'}{'cjb.net'} = '';\r
219$checked{'SERVICE'}{'dhs.org'} = '';\r
220$checked{'SERVICE'}{'dnspark.com'} = '';\r
221$checked{'SERVICE'}{'dtdns.com'} = '';\r
222$checked{'SERVICE'}{'dyndns.org'} = '';\r
223$checked{'SERVICE'}{'dyndns-custom'} = '';\r
224$checked{'SERVICE'}{'dyndns-static'} = '';\r
225$checked{'SERVICE'}{'dyns.cx'} = '';\r
226$checked{'SERVICE'}{'dynu.ca'} = '';\r
227$checked{'SERVICE'}{'easydns.com'} = '';\r
228$checked{'SERVICE'}{'enom.com'} = '';\r
229$checked{'SERVICE'}{'freedns.afraid.org'} = '';\r
230$checked{'SERVICE'}{'hn.org'} = '';\r
231$checked{'SERVICE'}{'no-ip.com'} = '';\r
232$checked{'SERVICE'}{'nsupdate'} = '';\r
233$checked{'SERVICE'}{'ovh.com'} = '';\r
234$checked{'SERVICE'}{'regfish.com'} = '';\r
235$checked{'SERVICE'}{'selfhost.de'} = '';\r
236$checked{'SERVICE'}{'tzo.com'} = '';\r
237$checked{'SERVICE'}{'zoneedit.com'} = '';\r
238$checked{'SERVICE'}{$settings{'SERVICE'}} = "selected='selected'";\r
239\r
240$checked{'BEHINDROUTER'}{'RED_IP'} = '';\r
241$checked{'BEHINDROUTER'}{'FETCH_IP'} = '';\r
242$checked{'BEHINDROUTER'}{$settings{'BEHINDROUTER'}} = "checked='checked'";\r
243$checked{'MINIMIZEUPDATES'} = ($settings{'MINIMIZEUPDATES'} eq '' ) ? '' : "checked='checked'";\r
244\r
245$checked{'PROXY'}{'on'} = ($settings{'PROXY'} eq '') ? '' : "checked='checked'";\r
246$checked{'WILDCARDS'}{'on'} = ($settings{'WILDCARDS'} eq '') ? '' : "checked='checked'";\r
247$checked{'ENABLED'}{'on'} = ($settings{'ENABLED'} eq '' ) ? '' : "checked='checked'";\r
248\r
249if ($errormessage) {\r
250 &Header::openbox('100%', 'left', $Lang::tr{'error messages'});\r
251 print "<font class='base'>$errormessage&nbsp;</font>";\r
252 &Header::closebox();\r
253}\r
254\r
255if ($warnmessage) {\r
256 $warnmessage = "<font color=${Header::colourred}><b>$Lang::tr{'capswarning'}</b></font>: $warnmessage";\r
257}\r
258&Header::openbox('100%', 'left', $Lang::tr{'settings'});\r
259print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>";\r
260print <<END\r
261<table width='100%'>\r
262<tr>\r
263 <td class='base'>$Lang::tr{'dyn dns source choice'}</td>\r
264</tr><tr>\r
265 <td class='base'><input type='radio' name='BEHINDROUTER' value='RED_IP' $checked{'BEHINDROUTER'}{'RED_IP'} />\r
266 $Lang::tr{'use ipcop red ip'}</td>\r
267</tr><tr>\r
268 <td class='base'><input type='radio' name='BEHINDROUTER' value='FETCH_IP' $checked{'BEHINDROUTER'}{'FETCH_IP'} />\r
269 $Lang::tr{'fetch ip from'} <img src='/blob.gif' alt='*' /></td>\r
270</tr>\r
271<tr>\r
272 <td class='base'><input type='checkbox' name='MINIMIZEUPDATES' $checked{'MINIMIZEUPDATES'} />\r
273 $Lang::tr{'ddns minimize updates'}</td>\r
274</tr>\r
275</table>\r
276<br /><hr />\r
277END\r
278;\r
279\r
280print <<END\r
281<table width='100%'>\r
282<tr>\r
283 <td class='base' valign='top'><img src='/blob.gif' alt='*' /></td>\r
284 <td width='70%' class='base'>$Lang::tr{'avoid dod'}</td>\r
285 <td width='30%' align='center' class='base'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>\r
286</tr>\r
287</table>\r
288</form>\r
289END\r
290;\r
291&Header::closebox(); # end of Settings1\r
292\r
293\r
294my $buttontext = $Lang::tr{'add'};\r
295if ($settings{'KEY1'} ne '') {\r
296 $buttontext = $Lang::tr{'update'};\r
297 &Header::openbox('100%', 'left', $Lang::tr{'edit an existing host'});\r
298} else {\r
299 &Header::openbox('100%', 'left', $Lang::tr{'add a host'});\r
300}\r
301\r
302#Edited line number (KEY1) passed until cleared by 'save' or 'remove'\r
303print <<END\r
304<form method='post' action='$ENV{'SCRIPT_NAME'}'>\r
305<input type='hidden' name='KEY1' value='$settings{'KEY1'}' />\r
306<table width='100%'>\r
307<tr>\r
308 <td width='25%' class='base'>$Lang::tr{'service'}:</td>\r
309 <td width='25%'><select size='1' name='SERVICE'>\r
310 <option $checked{'SERVICE'}{'cjb.net'}>cjb.net</option>\r
311 <option $checked{'SERVICE'}{'dhs.org'}>dhs.org</option>\r
312 <option $checked{'SERVICE'}{'dnspark.com'}>dnspark.com</option>\r
313 <option $checked{'SERVICE'}{'dtdns.com'}>dtdns.com</option>\r
314 <option $checked{'SERVICE'}{'dyndns.org'}>dyndns.org</option>\r
315 <option $checked{'SERVICE'}{'dyndns-custom'}>dyndns-custom</option>\r
316 <option $checked{'SERVICE'}{'dyndns-static'}>dyndns-static</option>\r
317 <option $checked{'SERVICE'}{'dyns.cx'}>dyns.cx</option>\r
318 <option $checked{'SERVICE'}{'dynu.ca'}>dynu.ca dyn.ee dynserv.(ca|org|net|com)</option>\r
319 <option $checked{'SERVICE'}{'easydns.com'}>easydns.com</option>\r
320 <option $checked{'SERVICE'}{'enom.com'}>enom.com</option>\r
321 <option $checked{'SERVICE'}{'freedns.afraid.org'}>freedns.afraid.org</option>\r
322 <option $checked{'SERVICE'}{'hn.org'}>hn.org</option>\r
323 <option $checked{'SERVICE'}{'no-ip.com'}>no-ip.com</option>\r
324 <option $checked{'SERVICE'}{'nsupdate'}>nsupdate</option>\r
325 <option $checked{'SERVICE'}{'ovh.com'}>ovh.com</option>\r
326 <option $checked{'SERVICE'}{'regfish.com'}>regfish.com</option>\r
327 <option $checked{'SERVICE'}{'selfhost.de'}>selfhost.de</option>\r
328<!-- <option $checked{'SERVICE'}{'tzo.com'}>tzo.com</option> comment this service out until a working fix is developed -->\r
329 <option $checked{'SERVICE'}{'zoneedit.com'}>zoneedit.com</option>\r
330 </select></td>\r
331 <td width='20%' class='base'>$Lang::tr{'hostname'}:&nbsp;<img src='/blob.gif' alt='*' /></td>\r
332 <td width='30%'><input type='text' name='HOSTNAME' value='$settings{'HOSTNAME'}' /></td>\r
333</tr><tr>\r
334 <td class='base'>$Lang::tr{'behind a proxy'}</td>\r
335 <td><input type='checkbox' name='PROXY' value='on' $checked{'PROXY'}{'on'} /></td>\r
336 <td class='base'>$Lang::tr{'domain'}:</td>\r
337 <td><input type='text' name='DOMAIN' value='$settings{'DOMAIN'}' /></td>\r
338</tr><tr>\r
339 <td class='base'>$Lang::tr{'enable wildcards'}</td>\r
340 <td><input type='checkbox' name='WILDCARDS' value='on' $checked{'WILDCARDS'}{'on'} /></td>\r
341 <td class='base'>$Lang::tr{'username'}</td>\r
342 <td><input type='text' name='LOGIN' value='$settings{'LOGIN'}' /></td>\r
343</tr><tr>\r
344 <td></td>\r
345 <td></td>\r
346 <td class='base'>$Lang::tr{'password'}</td>\r
347 <td><input type='password' name='PASSWORD' value='$settings{'PASSWORD'}' /></td>\r
348</tr><tr>\r
349 <td class='base'>$Lang::tr{'enabled'}</td>\r
350 <td><input type='checkbox' name='ENABLED' value='on' $checked{'ENABLED'}{'on'} /></td>\r
351 <td class='base'>$Lang::tr{'again'}</td>\r
352 <td><input type='password' name='PASSWORD2' value='$settings{'PASSWORD2'}' /></td>\r
353</tr>\r
354</table>\r
355<hr />\r
356<table width='100%'>\r
357<tr>\r
358 <td class='base' valign='top'><img src='/blob.gif' alt='*' /></td>\r
359 <td width='70%' class='base'>$ddnsprefix</td>\r
360 \r
361 <td width='30%' align='center' class='base'>\r
362 <input type='hidden' name='ACTION' value='$Lang::tr{'add'}' />\r
363 <input type='submit' name='SUBMIT' value='$buttontext' /> </td>\r
364</tr>\r
365</table>\r
366</form>\r
367END\r
368;\r
369&Header::closebox();\r
370\r
371#\r
372# Third box shows the list, in columns\r
373#\r
374&Header::openbox('100%', 'left', $Lang::tr{'current hosts'});\r
375print <<END\r
376<table width='100%'>\r
377<tr>\r
378 <td width='15%' align='center' class='boldbase'><b>$Lang::tr{'service'}</b></td>\r
379 <td width='25%' align='center' class='boldbase'><b>$Lang::tr{'hostname'}</b></td>\r
380 <td width='30%' align='center' class='boldbase'><b>$Lang::tr{'domain'}</b></td>\r
381 <td width='10%' align='center' class='boldbase'><b>$Lang::tr{'proxy'}</b></td>\r
382 <td width='10%' align='center' class='boldbase'><b>$Lang::tr{'wildcards'}</b></td>\r
383 <td width='10%' colspan='3' class='boldbase' align='center'><b>$Lang::tr{'action'}</b></td>\r
384</tr>\r
385END\r
386;\r
387my $ip = &General::GetDyndnsRedIP;\r
388my $key = 0;\r
389foreach my $line (@current) {\r
390 chomp($line); # remove newline\r
391 my @temp = split(/\,/,$line);\r
392\r
393 if ($temp[0] eq 'no-ip.com') {\r
394 $temp[1] =~ s!$General::noipprefix(.*)!<b>group:</b>$1 !;\r
395 } \r
396\r
397 #Choose icon for checkbox\r
398\r
399 my $gifproxy='';\r
400 my $descproxy='';\r
401 if ($temp[3] eq "on") {\r
402 $gifproxy = 'on.gif';\r
403 $descproxy = $Lang::tr{'click to disable'};\r
404 } else {\r
405 $gifproxy = 'off.gif';\r
406 $descproxy = $Lang::tr{'click to enable'}; \r
407 }\r
408\r
409 my $gifwildcard='';\r
410 my $descwildcard='';\r
411 if ($temp[4] eq "on") {\r
412 $gifwildcard = 'on.gif';\r
413 $descwildcard = $Lang::tr{'click to disable'};\r
414 } else {\r
415 $gifwildcard = 'off.gif';\r
416 $descwildcard = $Lang::tr{'click to enable'}; \r
417 }\r
418\r
419 my $sync = "<font color='blue'>";\r
420 my $gif = '';\r
421 my $gdesc = '';\r
422 if ($temp[7] eq "on") {\r
423 $gif = 'on.gif';\r
424 $gdesc = $Lang::tr{'click to disable'};\r
425 $sync = (&General::DyndnsServiceSync ($ip,$temp[1], $temp[2]) ? "<font color='green'>": "<font color='red'>") ;\r
426 } else {\r
427 $gif = 'off.gif';\r
428 $gdesc = $Lang::tr{'click to enable'};\r
429 }\r
430 \r
431 #Colorize each line\r
432 if ($settings{'KEY1'} eq $key) {\r
433 print "<tr bgcolor='${Header::colouryellow}'>";\r
434 } elsif ($key % 2) {\r
435 print "<tr bgcolor='${Header::table2colour}'>";\r
436 } else {\r
437 print "<tr bgcolor='${Header::table1colour}'>"; \r
438 }\r
439 \r
440 #if a field is empty, replace it with a '---' to see colorized info!\r
441 $temp[1] = '---' if (!$temp[1]);\r
442 $temp[2] = '---' if (!$temp[2]);\r
443\r
444 print <<END\r
445<td align='center'><a href='http://$temp[0]'>$temp[0]</a></td>\r
446<td align='center'>$sync$temp[1]</td>\r
447<td align='center'>$sync$temp[2]</td>\r
448\r
449<td align='center'>\r
450<form method='post' action='$ENV{'SCRIPT_NAME'}'>\r
451<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />\r
452<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gifproxy' alt='$descproxy' title='$descproxy' />\r
453<input type='hidden' name='KEY1' value='$key' />\r
454<input type='hidden' name='KEY2' value='3' />\r
455</form>\r
456</td>\r
457\r
458<td align='center'>\r
459<form method='post' action='$ENV{'SCRIPT_NAME'}'>\r
460<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />\r
461<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gifwildcard' alt='$descwildcard' title='$descwildcard' />\r
462<input type='hidden' name='KEY1' value='$key' />\r
463<input type='hidden' name='KEY2' value='4' />\r
464</form>\r
465</td>\r
466\r
467<td align='center'>\r
468<form method='post' action='$ENV{'SCRIPT_NAME'}'>\r
469<input type='hidden' name='ACTION' value='$Lang::tr{'toggle enable disable'}' />\r
470<input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif' alt='$gdesc' title='$gdesc' />\r
471<input type='hidden' name='KEY1' value='$key' />\r
472<input type='hidden' name='KEY2' value='7' />\r
473</form>\r
474</td>\r
475\r
476<td align='center'>\r
477<form method='post' action='$ENV{'SCRIPT_NAME'}'>\r
478<input type='hidden' name='ACTION' value='$Lang::tr{'edit'}' />\r
479<input type='image' name='$Lang::tr{'edit'}' src='/images/edit.gif' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />\r
480<input type='hidden' name='KEY1' value='$key' />\r
481</form>\r
482</td>\r
483\r
484<td align='center'>\r
485<form method='post' action='$ENV{'SCRIPT_NAME'}'>\r
486<input type='hidden' name='ACTION' value='$Lang::tr{'remove'}' />\r
487<input type='image' name='$Lang::tr{'remove'}' src='/images/delete.gif' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' />\r
488<input type='hidden' name='KEY1' value='$key' />\r
489</form>\r
490</td>\r
491</tr>\r
492END\r
493;\r
494 $key++;\r
495}\r
496print "</table>";\r
497\r
498# If table contains entries, print 'Key to action icons'\r
499if ($key) {\r
500print <<END\r
501<table width='100%'>\r
502<tr>\r
503 <td class='boldbase'>&nbsp;<b>$Lang::tr{'legend'}:&nbsp;</b></td>\r
504 <td><img src='/images/on.gif' alt='$Lang::tr{'click to disable'}' /></td>\r
505 <td class='base'>$Lang::tr{'click to disable'}</td>\r
506 <td>&nbsp;&nbsp;</td>\r
507 <td><img src='/images/off.gif' alt='$Lang::tr{'click to enable'}' /></td>\r
508 <td class='base'>$Lang::tr{'click to enable'}</td>\r
509 <td>&nbsp;&nbsp;</td>\r
510 <td><img src='/images/edit.gif' alt='$Lang::tr{'edit'}' /></td>\r
511 <td class='base'>$Lang::tr{'edit'}</td>\r
512 <td>&nbsp;&nbsp;</td>\r
513 <td><img src='/images/delete.gif' alt='$Lang::tr{'remove'}' /></td>\r
514 <td class='base'>$Lang::tr{'remove'}</td>\r
515 <form method='post' action='$ENV{'SCRIPT_NAME'}'>\r
516 <td align='center' width='30%'><input type='submit' name='ACTION' value='$Lang::tr{'instant update'}' /></td>\r
517 </form>\r
518</tr>\r
519</table>\r
520END\r
521;\r
522}\r
523\r
524&Header::closebox();\r
525&Header::closebigbox();\r
526&Header::closepage();\r
527\r
528## Ouf it's the end !\r
529\r
530\r
531# write the "current" array\r
532sub WriteDataFile {\r
533 #Save current\r
534 open(FILE, ">$datafile") or die 'ddns datafile error';\r
535 print FILE @current;\r
536 close (FILE);\r
537}\r