par Riric » 25 Mars 2003 16:53
Salut,
<BR>alors, aprés quelques tests, voici la version qui fonctionne (presque) chez moi.
<BR>Bon, il y a encore quelques soucis, mais c'est ça va plus loin.
<BR>
<BR>dans en.pl :
<BR>....
<BR>'ssshutdown' => 'shutdown',
<BR>'sstime server' => 'Time Server',
<BR>....
<BR>
<BR>dans fr.pl :
<BR>...
<BR>'ssshutdown' => 'arrêter',
<BR>'sstime server' => 'Serveur de Temps',
<BR>...
<BR>
<BR>dans header.pl (noter le 0 de ssshutdown et le 1 de time server, c'est pour avoir le caractère | de séparation) :
<BR>...
<BR> &subsectiontab('/cgi-bin/shutdown.cgi', $tr{'ssshutdown'}, 0);
<BR> &subsectiontab('/cgi-bin/ntpd.cgi', $tr{'sstime server'}, 1);
<BR>...
<BR>
<BR>ntpd.cgi : (en fait tous les étaient de trop)
<BR>
<BR>#!/usr/bin/perl
<BR>#
<BR># IPCop CGIs
<BR>#
<BR># This code is distributed under the terms of the GPL
<BR>#
<BR># (c) The IPCop Team
<BR>#
<BR># $Id: ntpd.cgi,v 1.3.2.2 2002/06/29 04:55:32 esjatharvee Exp $
<BR>#
<BR>
<BR>require '/var/ipcop/header.pl';
<BR>
<BR>my (%ntpdsettings, %checked, $errormessage);
<BR>
<BR>&showhttpheaders();
<BR>
<BR>$ntpdsettings{'ENABLE_NTPD'} = 'off';
<BR>$ntpdsettings{'ACTION'} = '';
<BR>&getcgihash(%ntpdsettings);
<BR>
<BR>$errormessage = '';
<BR>if ($ntpdsettings{'ACTION'} eq $tr{'save'})
<BR>{
<BR>&writehash("${swroot}/ntpd/settings", %ntpdsettings);
<BR>if ($ntpdsettings{'ENABLE_NTPD'} eq 'on')
<BR>{
<BR>&log($tr{'ntpd is enabled'});
<BR>system ('/bin/touch', "${swroot}/ntpd/enablentpd");
<BR>}
<BR>else
<BR>{
<BR>&log($tr{'ntpd is disabled'});
<BR>unlink "${swroot}/ntpd/enablentpd";
<BR>}
<BR>
<BR>system('/usr/sbin/ntpd', '-A', '-p', '/var/run/ntpd.pid');
<BR>}
<BR>
<BR>&readhash("${swroot}/ntpd/settings", %ntpdsettings);
<BR>
<BR>$checked{'ENABLE_NTPD'}{'off'} = '';
<BR>$checked{'ENABLE_NTPD'}{'on'} = '';
<BR>$checked{'ENABLE_NTPD'}{$ntpdsettings{'ENABLE_NTPD'}} = 'CHECKED';
<BR>&openpage($tr{'time server'}, 1, '');
<BR>
<BR>&showsystemsection();
<BR>
<BR>&openbigbox('100%', 'LEFT');
<BR>
<BR>print "<FORM METHOD='POST'>n";
<BR>
<BR>&openbox('100%', 'LEFT', $tr{'time server2'});
<BR>print <<END
<BR><TABLE WIDTH='100%'>
<BR><TR>
<BR><TD WIDTH='25%' CLASS='base'>NTPD:</TD>
<BR><TD WIDTH='25%'><INPUT TYPE='checkbox' NAME='ENABLE_NTPD' $checked{'ENABLE_NTPD'}{'on'}></TD>
<BR><TD WIDTH='25%' ALIGN='CENTER'><INPUT TYPE='submit' NAME='ACTION' VALUE='$tr{'save'}'></TD>
<BR><TD WIDTH='25%'> </TD>
<BR></TR>
<BR></TABLE>
<BR>END
<BR>;
<BR>
<BR>&closebox();
<BR>
<BR>&openbox('100%', 'LEFT', $tr{'error messages'});
<BR>print "<CLASS NAME='base'>$errormessage";
<BR>print " </CLASS>";
<BR>&closebox();
<BR>
<BR>print "</FORM>n";
<BR>
<BR>&closebigbox();
<BR>
<BR>&closepage();
<BR>