Posted by:
trashy
(---.pilotpoint.tx.cebridge.net)
<?php
//v1.0 by Romain Bourdon
$httpdfile = "../apache2/conf/httpd.conf";
$wampinifile = "../wampserver.ini";
$online_txt = "# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all";
$offline_txt = "# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1";
$myhttpd = @file_get_contents($httpdfile) or die ("httpd.conf file not found"
;
if ($_SERVER['argv'][1] == 'off')
{
$myhttpd = ereg_replace($online_txt,$offline_txt,$myhttpd);
$fphttpd = fopen($httpdfile,"w"
;
fwrite($fphttpd,$myhttpd);
fclose($fphttpd);
$mywampini = @file_get_contents($wampinifile) or die ("wampserver.ini file not found"
;
$mywampini = ereg_replace('Put Offline','Put Online',$mywampini);
$mywampini = ereg_replace('onlineoffline.php off','onlineoffline.php on',$mywampini);
$mywampini = ereg_replace('server Online','server Offline',$mywampini);
$mywampini = ereg_replace('images_on.bmp','images_off.bmp',$mywampini);
$fpwampini = fopen($wampinifile,"w"
;
fwrite($fpwampini,$mywampini);
fclose($fwampini);
}
if ($_SERVER['argv'][1] == 'on')
{
$myhttpd = ereg_replace($offline_txt,$online_txt,$myhttpd);
$fphttpd = fopen($httpdfile,"w"
;
fwrite($fphttpd,$myhttpd);
fclose($fphttpd);
$mywampini = @file_get_contents($wampinifile) or die ("wampserver.ini file not found"
;
$mywampini = ereg_replace('Put Online','Put Offline',$mywampini);
$mywampini = ereg_replace('onlineoffline.php on','onlineoffline.php off',$mywampini);
$mywampini = ereg_replace('server Offline','server Online',$mywampini);
$mywampini = ereg_replace('images_off.bmp','images_on.bmp',$mywampini);
$fpwampini = fopen($wampinifile,"w"
;
fwrite($fpwampini,$mywampini);
fclose($fwampini);
}
?>