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