Make it easier to disable the service when needed.

This commit is contained in:
robert%accettura.com 2006-01-21 03:06:36 +00:00
Родитель 7ee81b930c
Коммит b36c8becb7
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -44,6 +44,9 @@
// Debug
$config['debug'] = false;
// Service Active
$config['service_active'] = true; // true=on | false=off
// Paths
$config['base_url'] = 'http://reporter.server.tld'; // no trailing slash
$config['base_path'] = '/path/to/reporter'; // no trailing slash

Просмотреть файл

@ -41,7 +41,7 @@ require_once($config['base_path'].'/includes/iolib.inc.php');
require_once($config['base_path'].'/includes/contrib/adodb/adodb.inc.php');
require_once($config['base_path'].'/includes/contrib/nusoap/lib/nusoap.php');
// Turn off Error Reporting
// Turn off Error Reporting because it breaks xml formatting and causes errors
error_reporting(0);
// Create the server instance
@ -84,6 +84,10 @@ $server->register(
function submitReport($rmoVers, $url, $problem_type, $description, $behind_login, $platform, $oscpu, $gecko, $product, $useragent, $buildconfig, $language, $email, $sysid) {
global $config;
if ($config['service_active'] == false){
return new soap_fault('SERVER', '', 'The service is currently unavailable. Please try again in a few minutes.');
}
// Remove any HTML tags and whitespace
$rmoVers = trim(strip_all_tags($rmoVers));
$url = trim(strip_all_tags($url));