display a nice error message when accessing this file with a browser

This commit is contained in:
Lars Kneschke 2006-03-18 08:06:10 +00:00
parent 0f4c6ed22b
commit f7c82895f5

View File

@ -26,7 +26,7 @@ include('./header.inc.php');
// SyncML works currently only with PHP sessions
if($GLOBALS['egw_info']['server']['sessions_type'] == 'db')
{
error_log('SyncML support is currently not available with DB sessions. Please switch to PHP4 sessions in header.inc.php.');
error_log('SyncML support is currently not available with DB sessions. Please switch to PHP sessions in header.inc.php.');
exit;
}
@ -61,6 +61,10 @@ if (!empty($_SERVER['CONTENT_TYPE'])) {
$serverType = 'soap';
}
if($serverType != 'syncml' && $serverType != 'syncml_wbxml') {
die('You can access this URL only with a SyncML enabled device.');
}
if ($serverType == 'soap' &&
(!isset($_SERVER['REQUEST_METHOD']) ||
$_SERVER['REQUEST_METHOD'] != 'POST')) {