• Модуль: cluster
  • Путь к файлу: ~/bitrix/modules/cluster/classes/general/webnode.php
  • Класс: CClusterWebnode
  • Вызов: CClusterWebnode::CheckFields
function CheckFields(&$arFields, $ID)
{
	global $APPLICATION;
	$aMsg = array();

	$bHost = false;
	if(isset($arFields["HOST"]))
	{
		if(preg_match("/^([0-9a-zA-Z-_.]+)$/", $arFields["HOST"]))
			$bHost = true;

		if(!$bHost)
			$aMsg[] = array("id" => "HOST", "text" => GetMessage("CLU_WEBNODE_WRONG_IP"));
	}

	$bStatus = true;
	if($bHost && isset($arFields["PORT"]))
	{
		if($arFields["STATUS_URL"] <> '')
		{
			$arStatus = $this->GetStatus($arFields["HOST"], $arFields["PORT"], $arFields["STATUS_URL"]);
			$bStatus = is_array($arStatus);
		}
	}

	if(!$bStatus)
	{
		//$aMsg[] = array("id" => "STATUS_URL", "text" => GetMessage("CLU_WEBNODE_WRONG_STATUS_URL"));
	}

	if(!empty($aMsg))
	{
		$e = new CAdminException($aMsg);
		$APPLICATION->ThrowException($e);
		return false;
	}
	return true;
}