désactivation autoblog (test)

This commit is contained in:
Mitsukarenai 2013-07-13 18:00:32 +02:00
parent edb75a5f4b
commit 7030352d24
2 changed files with 15 additions and 10 deletions

View file

@ -350,16 +350,19 @@ class VroumVroum_Blog
{
if (!$this->mustUpdate())
return false;
try {
$body = file_get_contents($this->config->feed_url, false, $this->_getStreamContext());
}
catch (ErrorException $e)
{
$this->log_update(false, $e->getMessage() . "\n\n" . (!empty($http_response_header) ? implode("\n", $http_response_header) : ''));
throw new VroumVroum_Feed_Exception("Can't retrieve feed: ".$e->getMessage());
}
if(isset($this->config->off)) {
throw new VroumVroum_Feed_Exception('This autoblog has been turned off');
}
else {
try {
$body = file_get_contents($this->config->feed_url, false, $this->_getStreamContext());
}
catch (ErrorException $e)
{
$this->log_update(false, $e->getMessage() . "\n\n" . (!empty($http_response_header) ? implode("\n", $http_response_header) : ''));
throw new VroumVroum_Feed_Exception("Can't retrieve feed: ".$e->getMessage());
}
}
libxml_use_internal_errors(true);
$xml = @simplexml_load_string($body);

View file

@ -236,6 +236,7 @@ function svg_status($fill, $text, $back)
}
$svg_ok=svg_status('#008000', 'ok', '');
$svg_off=svg_status('#00158F', 'off', '');
$svg_mv=svg_status('#0000ff', 'mv', '<rect width="100%" height="100%" fill="#ffd800"/>');
$svg_err=svg_status('#000000', 'err', '<rect width="100%" height="100%" fill="#ff0000"/>');
@ -253,6 +254,7 @@ function svg_status($fill, $text, $back)
else /* ..sinon, lancer la procédure de contrôle */
{
$ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die;
if(isset($ini['OFF'])) { die($svg_off); }
$headers = get_headers($ini['FEED_URL']);
if(!empty($headers))