output some usefull error messages

This commit is contained in:
Lars Kneschke 2006-04-09 10:08:13 +00:00
parent 0205b0bf64
commit 99f56b1af9

27
rpc.php
View File

@ -23,21 +23,22 @@ $GLOBALS['egw_info']['flags'] = array(
); );
include('./header.inc.php'); include('./header.inc.php');
$errors = array();
// SyncML works currently only with PHP sessions // SyncML works currently only with PHP sessions
if($GLOBALS['egw_info']['server']['sessions_type'] == 'db') if($GLOBALS['egw_info']['server']['sessions_type'] == 'db')
{ {
error_log('SyncML support is currently not available with DB sessions. Please switch to PHP sessions in header.inc.php.'); $errors[] = 'SyncML support is currently not available with DB sessions. Please switch to PHP sessions in header.inc.php.';
exit;
} }
// SyncML does not support func_overload
if(ini_get('mbstring.func_overload') != 0) { if(ini_get('mbstring.func_overload') != 0) {
error_log('You need to set mbstring.func_overload to 0 for rpc.php.'); $errors[] = 'You need to set mbstring.func_overload to 0 for rpc.php.';
exit;
} }
// SyncML requires PHP version 5.0.x
if(version_compare(PHP_VERSION, '5.0.0') < 0) { if(version_compare(PHP_VERSION, '5.0.0') < 0) {
error_log('eGroupWare\'s SyncML server requires PHP5. Please update to PHP5 if you want to make use of SyncML.'); $errors[] = 'eGroupWare\'s SyncML server requires PHP5. Please update to PHP 5.0.x if you want to use SyncML.';
exit;
} }
$config =& CreateObject('phpgwapi.config','syncml'); $config =& CreateObject('phpgwapi.config','syncml');
@ -72,15 +73,15 @@ if (!empty($_SERVER['CONTENT_TYPE'])) {
} }
if($serverType != 'syncml' && $serverType != 'syncml_wbxml') { if($serverType != 'syncml' && $serverType != 'syncml_wbxml') {
if(ini_get('mbstring.func_overload') != 0) { foreach($errors as $error) {
echo 'You need to set mbstring.func_overload to 0 for rpc.php.<br>'; echo "$error<br>";
} }
if(version_compare(PHP_VERSION, '5.0.0') < 0) {
echo 'eGroupWare\'s SyncML server requires PHP5. Please update to PHP5 if you want to make use of SyncML.<br>';
}
die('You should access this URL only with a SyncML enabled device.'); die('You should access this URL only with a SyncML enabled device.');
} elseif (count($errors) > 0) {
foreach($errors as $error) {
error_log($error);
}
exit;
} }
if ($serverType == 'soap' && if ($serverType == 'soap' &&