- Модуль: clouds
- Путь к файлу: ~/bitrix/modules/clouds/classes/general/storage_service_amazon.php
- Класс: CCloudStorageService_AmazonS3
- Вызов: CCloudStorageService_AmazonS3::CheckSettings
function CheckSettings($arBucket, &$arSettings)
{
global $APPLICATION;
$aMsg =/*.(array[int][string]string).*/array();
$result = array(
"ACCESS_KEY" => is_array($arSettings)? trim($arSettings["ACCESS_KEY"]): '',
"SECRET_KEY" => is_array($arSettings)? trim($arSettings["SECRET_KEY"]): '',
);
if(is_array($arSettings) && array_key_exists("SESSION_TOKEN", $arSettings))
{
$result["SESSION_TOKEN"] = trim($arSettings["SESSION_TOKEN"]);
}
if($arBucket["READ_ONLY"] !== "Y" && $result["ACCESS_KEY"] === '')
{
$aMsg[] = array(
"id" => $this->GetID()."INP_ACCESS_KEY",
"text" => GetMessage("CLO_STORAGE_AMAZON_EMPTY_ACCESS_KEY"),
);
}
if($arBucket["READ_ONLY"] !== "Y" && $result["SECRET_KEY"] === '')
{
$aMsg[] = array(
"id" => $this->GetID()."INP_SECRET_KEY",
"text" => GetMessage("CLO_STORAGE_AMAZON_EMPTY_SECRET_KEY"),
);
}
if(!empty($aMsg))
{
$e = new CAdminException($aMsg);
$APPLICATION->ThrowException($e);
return false;
}
else
{
$arSettings = $result;
}
return true;
}