extranet/www/tools/checkip.php

55 lines
1.8 KiB
PHP
Raw Normal View History

<?
2009-07-21 07:17:54 +00:00
require_once 'common/curl.php';
/** Etape de connexion
**/
$postData=array('action'=>'login',
'domain'=>'',
'login'=>'scoresdeci',
'pw'=>'catsysyo92',
);
$page=getUrl("http://www.online.net/administration/identification.html", '', $postData, '', false, '', '',0);
$cookies=$page['header']['Set-Cookie'];
2009-07-21 07:17:54 +00:00
/** Etape de liste de la zone S&D
**/
$postData=array('action'=>'select_domain',
'domain_id'=>'173991',
);
$page=getUrl("http://www.online.net/dns.pl", $cookies, $postData, 'http://www.online.net/dns.pl', false, '', '',0);
/** Suppression de la zone DNS **/
if (preg_match('/<form action="\/dns\.pl" method="POST">.*<input type="hidden" name="action" value="delete_entry">.*<input type="hidden" name="entry_id" value="(.*)">.*<input type="hidden" name="domain_id" value="173991">.*<tr>.*<td>ws2<\/td>.*<\/form>/Uis',$page['body'],$matches)) {
$postData=array('action'=>'delete_entry',
'entry_id'=>$matches[1],
'domain_id'=>'173991',
);
$page=getUrl("http://www.online.net/dns.pl", $cookies, $postData, 'http://www.online.net/dns.pl', false, '', '',0);
}
2009-07-21 07:17:54 +00:00
/** Ajout de la zone DNS **/
$postData=array('action'=>'add_entry',
'entry'=>'ws2',
'type'=>'A',
'priority'=>'',
'value'=>$_SERVER['REMOTE_ADDR'],
'domain_id'=>'173991',
);
$page=getUrl("http://www.online.net/dns.pl", $cookies, $postData, 'http://www.online.net/dns.pl', false, '', '',0);
2009-07-21 07:17:54 +00:00
die();
2009-07-21 07:17:54 +00:00
if ($_REQUEST['orange']=='lk65gqsdg657g68sqgdg686d7g9q87g') {
$str="<?php
define('WEBSERVICE_URL', 'http://".$_SERVER['REMOTE_ADDR']."/ws/');
define('WEBSERVICE_URI', 'http://".$_SERVER['REMOTE_ADDR']."/');
?>";
2009-07-21 07:17:54 +00:00
//TODO : Fichier n'existe plus
$fp=fopen(realpath(dirname(__FILE__)) . '/../../config/serveur.orange.php', 'w');
fwrite($fp, $str);
fclose($fp);
}
?>