Protect the webservices...

SVN:trunk[2382]
This commit is contained in:
Denis Flaven
2012-10-26 13:11:02 +00:00
parent d894ec0a9f
commit 39d8888890
2 changed files with 11 additions and 4 deletions

View File

@@ -107,6 +107,13 @@ class BasicServices extends WebServicesBase
}
UserRights::Login($sLogin);
if (!class_exists('Incident'))
{
$oRes = new WebServiceResult();
$oRes->LogError("The class Incident does not exist. Did you install the Incident Management (ITIL) module ?");
return $oRes;
}
$aCallerDesc = self::SoapStructToExternalKeySearch($oCallerDesc);
$aCustomerDesc = self::SoapStructToExternalKeySearch($oCustomerDesc);
$aServiceDesc = self::SoapStructToExternalKeySearch($oServiceDesc);

View File

@@ -284,10 +284,10 @@ abstract class WebServicesBase
$oLog->Set('userinfo', UserRights::GetUser());
$oLog->Set('verb', $sVerb);
$oLog->Set('result', $oRes->IsOk());
$this->TrimAndSetValue($oLog, 'log_info', $oRes->GetInfoAsText());
$this->TrimAndSetValue($oLog, 'log_warning', $oRes->GetWarningsAsText());
$this->TrimAndSetValue($oLog, 'log_error', $oRes->GetErrorsAsText());
$this->TrimAndSetValue($oLog, 'data', $oRes->GetReturnedDataAsText());
$this->TrimAndSetValue($oLog, 'log_info', (string)$oRes->GetInfoAsText());
$this->TrimAndSetValue($oLog, 'log_warning', (string)$oRes->GetWarningsAsText());
$this->TrimAndSetValue($oLog, 'log_error', (string)$oRes->GetErrorsAsText());
$this->TrimAndSetValue($oLog, 'data', (string)$oRes->GetReturnedDataAsText());
$oLog->DBInsertNoReload();
}