function RuCenter_Domain_Register($Settings, $DomainName, $DomainZone, $Years, $Ns1Name, $Ns1IP, $Ns2Name, $Ns2IP, $Ns3Name, $Ns3IP, $Ns4Name, $Ns4IP, $IsPrivateWhoIs, $ContractID = '') { /****************************************************************************/ $__args_types = array('array', 'string', 'string', 'integer', 'string', 'string', 'string', 'string', 'string', 'string', 'string', 'string', 'boolean', 'string'); #----------------------------------------------------------------------------- $__args__ = Func_Get_Args(); eval(FUNCTION_INIT); /****************************************************************************/ $HTTP = array('Address' => $Settings['Address'], 'Port' => $Settings['Port'], 'Host' => $Settings['Address'], 'Protocol' => $Settings['Protocol'], 'Charset' => 'KOI8-R', 'IsLogging' => $Settings['Params']['IsLogging']); #----------------------------------------------------------------------------- $Domain = SPrintF('%s.%s', $DomainName, $DomainZone); #----------------------------------------------------------------------------- $ContractItem = Explode(':', $ContractID); #----------------------------------------------------------------------------- $ContractID = Current($ContractItem); #----------------------------------------------------------------------------- $Query = array(); #----------------------------------------------------------------------------- $RequestID = UniqID('ID'); #----------------------------------------------------------------------------- $Query[] = 'lang: ru'; $Query[] = 'request: order'; $Query[] = 'operation: create'; $Query[] = SPrintF('login: %s', $Settings['Login']); $Query[] = SPrintF('password: %s', $Settings['Password']); $Query[] = SPrintF('subject-contract: %s', $ContractID); $Query[] = SPrintF('request-id: %s', $RequestID); #----------------------------------------------------------------------------- $Query[] = ''; #----------------------------------------------------------------------------- $Query[] = '[order-item]'; $Query[] = 'check-ns: off'; #----------------------------------------------------------------------------- switch ($DomainZone) { case 'ru': $Query[] = 'service: domain_ru'; $Query[] = 'template: client_ru'; break; case 'su': $Query[] = 'service: domain_su'; $Query[] = 'template: client_ru'; break; case 'рф': $Query[] = 'service: domain_rf'; $Query[] = 'template: domain_rf'; // Convert the domain $IDNAConverter = new IDNAConvert(); $Domain = $IDNAConverter->encode($Domain); break; case 'msk.ru': $Query[] = 'service: domain_msk_ru'; $Query[] = 'template: client_ru'; break; case 'msk.su': $Query[] = 'service: domain_msk_su'; $Query[] = 'template: client_ru'; break; case 'spb.ru': $Query[] = 'service: domain_spb_ru'; $Query[] = 'template: client_ru'; break; case 'spb.su': $Query[] = 'service: domain_spb_su'; $Query[] = 'template: client_ru'; break; default: #------------------------------------------------------------------------- if (Count($ContractItem) < 2) { #----------------------------------------------------------------------- $Query = array(); #----------------------------------------------------------------------- $RequestID = UniqID('ID'); #----------------------------------------------------------------------- $Query[] = 'lang: ru'; $Query[] = 'request: contract'; $Query[] = 'operation: get'; $Query[] = SPrintF('login: %s', $Settings['Login']); $Query[] = SPrintF('password: %s', $Settings['Password']); $Query[] = SPrintF('subject-contract: %s', $ContractID); $Query[] = SPrintF('request-id: %s', $RequestID); #----------------------------------------------------------------------- $Result = HTTP_Send('/dns/dealer', $HTTP, array(), array('SimpleRequest' => Implode("\n", $Query))); if (Is_Error($Result)) { return ERROR | @Trigger_Error('[RuCenter_Domain_Register]: не удалось выполнить запрос к серверу'); } #----------------------------------------------------------------------- if (Preg_Match('/HTTP\\/1.0\\s502/i', $Result['Heads'])) { return false; } #----------------------------------------------------------------------- $Result = Trim($Result['Body']); #----------------------------------------------------------------------- if (Preg_Match('/State:\\s([0-9]+)\\s/', $Result, $CodeID)) { #--------------------------------------------------------------------- $CodeID = Next($CodeID); #--------------------------------------------------------------------- switch ($CodeID) { case '200': #----------------------------------------------------------------- if (Preg_Match_All('/([a-z\\-])+\\:(.+)/', $Result, $Matches)) { #--------------------------------------------------------------- Debug(Print_R($Matches, 1)); #--------------------------------------------------------------- return new gException('NOT_SUPPORTED_YET', 'Пока не поддерживается'); } #----------------------------------------------------------------- break; case '500': return FALSE; default: return new gException('WRONG_ERROR', SPrintF('Неизвестный статус ошибки (%s)', $Result)); } } } else { $NicHDL = Next($ContractItem); } #------------------------------------------------------------------------- $Query[] = 'service: domain_rrp'; $Query[] = 'template: client_rrp'; $Query[] = SPrintF('period: %d', $Years); $Query[] = SPrintF('admin-c: %s', $NicHDL); $Query[] = SPrintF('bill-c: %s', $NicHDL); $Query[] = SPrintF('tech-c: %s', $NicHDL); $Query[] = 'lang-tag: RUS'; } #----------------------------------------------------------------------------- $Query[] = 'action: new'; $Query[] = SPrintF('domain: %s', $Domain); $Query[] = SPrintF('private-person: %s', $IsPrivateWhoIs ? 'ON' : 'OFF'); #----------------------------------------------------------------------------- if ($Ns1Name) { $Query[] = $Ns1IP ? SPrintF('nserver: %s %s', $Ns1Name, $Ns1IP) : SPrintF('nserver: %s', $Ns1Name); } #----------------------------------------------------------------------------- if ($Ns2Name) { $Query[] = $Ns2IP ? SPrintF('nserver: %s %s', $Ns2Name, $Ns2IP) : SPrintF('nserver: %s', $Ns2Name); } #----------------------------------------------------------------------------- if ($Ns3Name) { $Query[] = $Ns3IP ? SPrintF('nserver: %s %s', $Ns3Name, $Ns3IP) : SPrintF('nserver: %s', $Ns3Name); } #----------------------------------------------------------------------------- if ($Ns4Name) { $Query[] = $Ns4IP ? SPrintF('nserver: %s %s', $Ns4Name, $Ns4IP) : SPrintF('nserver: %s', $Ns4Name); } #----------------------------------------------------------------------------- $Query[] = 'type: CORPORATE'; #----------------------------------------------------------------------------- $Result = HTTP_Send('/dns/dealer', $HTTP, array(), array('SimpleRequest' => Implode("\n", $Query))); if (Is_Error($Result)) { return ERROR | @Trigger_Error('[RuCenter_Domain_Register]: не удалось выполнить запрос к серверу'); } #----------------------------------------------------------------------------- if (Preg_Match('/HTTP\\/1.0\\s502/i', $Result['Heads'])) { return false; } #----------------------------------------------------------------------------- $Result = Trim($Result['Body']); #----------------------------------------------------------------------------- if (Preg_Match('/State:\\s([0-9]+)\\s/', $Result, $CodeID)) { #--------------------------------------------------------------------------- $CodeID = Next($CodeID); #--------------------------------------------------------------------------- switch ($CodeID) { case '200': #----------------------------------------------------------------------- if (Preg_Match('/order_id:([0-9]+)/', $Result, $TicketID)) { return array('TicketID' => Next($TicketID)); } case '500': return FALSE; default: return new gException('WRONG_ERROR', SPrintF('Неизвестный статус ошибки (%s)', $Result)); } } #----------------------------------------------------------------------------- return new gException('WRONG_ANSWER', $Result); }
function LogicBoxes_Contract_Register($Settings, $PepsonID, $Person, $DomainZone) { /****************************************************************************/ $__args_types = array('array', 'string', 'array', 'string'); #----------------------------------------------------------------------------- $__args__ = Func_Get_Args(); eval(FUNCTION_INIT); /****************************************************************************/ $Wsdl = System_Element('config/Wsdl/Customer.wsdl'); if (Is_Error($Wsdl)) { return ERROR | @Trigger_Error(500); } #----------------------------------------------------------------------------- $AddCustomer = new SoapClient($Wsdl, array('exceptions' => 0)); #----------------------------------------------------------------------------- $Params = array('SERVICE_USERNAME' => $Settings['Login'], 'SERVICE_PASSWORD' => $Settings['Password'], 'SERVICE_ROLE' => 'reseller', 'SERVICE_LANGPREF' => 'ru', 'SERVICE_PARENTID' => $Settings['ParentID'], 'customerUserName' => $Person['Email'], 'customerPassword' => UniqID()); #----------------------------------------------------------------------------- switch ($PepsonID) { case 'Natural': #------------------------------------------------------------------------- $Params['name'] = SPrintF('%s %s %s', Translit($Person['Name']), Mb_SubStr(Translit($Person['Lastname']), 0, 1), Translit($Person['Sourname'])); $Params['company'] = 'N/A'; $Params['address1'] = Translit(SPrintF('%s %s', $Person['pType'], $Person['pAddress'])); $Params['address2'] = Translit(SPrintF('%s %s', $Person['pType'], $Person['pAddress'])); $Params['address3'] = Translit(SPrintF('%s %s', $Person['pType'], $Person['pAddress'])); $Params['city'] = Translit($Person['pCity']); $Params['state'] = Translit($Person['pState']); $Params['country'] = isset($Person['PasportCountry']) ? $Person['PasportCountry'] : $Person['pCountry']; $Params['zip'] = $Person['pIndex']; break; case 'Juridical': #------------------------------------------------------------------------- $Params['name'] = SPrintF('%s %s %s', Translit($Person['dName']), Translit($Person['dLastname']), Translit($Person['dSourname'])); $Params['company'] = SPrintF('%s %s', Translit($Person['CompanyName']), Translit($Person['CompanyFormFull'])); $Params['address1'] = Translit(SPrintF('%s %s', $Person['jType'], $Person['jAddress'])); $Params['address2'] = Translit(SPrintF('%s %s', $Person['pType'], $Person['pAddress'])); $Params['address3'] = Translit(SPrintF('%s %s', $Person['pType'], $Person['pAddress'])); $Params['city'] = Translit($Person['jCity']); $Params['state'] = Translit($Person['jState']); $Params['country'] = Translit($Person['jCountry']); $Params['zip'] = $Person['jIndex']; break; default: return ERROR | @Trigger_Error(400); } #----------------------------------------------------------------------------- $Phone = $Person['Phone']; #----------------------------------------------------------------------------- if ($Phone) { #--------------------------------------------------------------------------- $Phone = Preg_Split('/\\s+/', $Phone); #--------------------------------------------------------------------------- $Params['telNoCc'] = Trim(Current($Phone), '+'); $Params['telNo'] = SPrintF('%s%s', Next($Phone), Next($Phone)); #--------------------------------------------------------------------------- Reset($Phone); #--------------------------------------------------------------------------- $Params['altTelNoCc'] = Trim(Current($Phone), '+'); $Params['altTelNo'] = SPrintF('%s%s', Next($Phone), Next($Phone)); } else { #--------------------------------------------------------------------------- $Params['telNoCc'] = ''; $Params['telNo'] = ''; $Params['altTelNoCc'] = ''; $Params['altTelNo'] = ''; } #----------------------------------------------------------------------------- $Fax = $Person['Fax']; #----------------------------------------------------------------------------- if ($Fax) { #--------------------------------------------------------------------------- $Fax = Preg_Split('/\\s+/', $Fax); #--------------------------------------------------------------------------- $Params['faxNoCc'] = Trim(Current($Fax), '+'); $Params['faxNo'] = SPrintF('%s%s', Next($Fax), Next($Fax)); } else { #--------------------------------------------------------------------------- $Params['faxNoCc'] = ''; $Params['faxNo'] = ''; } #----------------------------------------------------------------------------- $Params['customerLangPref'] = 'ru'; #----------------------------------------------------------------------------- Debug(Print_R($Params, TRUE)); #----------------------------------------------------------------------------- $Response = $AddCustomer->__SoapCall('addCustomer', $Params); #----------------------------------------------------------------------------- if (Is_SOAP_Fault($Response)) { #--------------------------------------------------------------------------- Debug($Response->faultstring); #--------------------------------------------------------------------------- return new gException('ANSWER_ERROR', 'Ошибка обращения к регистратору'); } #----------------------------------------------------------------------------- $CustomerID = $Response; #----------------------------------------------------------------------------- $Wsdl = System_Element('config/Wsdl/DomContact.wsdl'); if (Is_Error($Wsdl)) { return ERROR | @Trigger_Error(500); } #----------------------------------------------------------------------------- $DefaultContact = new SoapClient($Wsdl, array('exceptions' => 0)); #----------------------------------------------------------------------------- $Response = $DefaultContact->addDefaultContact($Settings['Login'], $Settings['Password'], 'reseller', 'ru', $Settings['ParentID'], $CustomerID); #----------------------------------------------------------------------------- if (Is_SOAP_Fault($Response)) { #--------------------------------------------------------------------------- Debug($Response->faultstring); #--------------------------------------------------------------------------- return new gException('ANSWER_ERROR', 'Ошибка обращения к регистратору'); } #----------------------------------------------------------------------------- return array('TicketID' => $CustomerID); }
public function ReceiveMessage($senderJId, array $arMessage, CXMPPClient $senderClient) { if ($senderClient->IsAuthenticated() && !array_key_exists("stream:stream", $arMessage)) { return false; } $server = CXMPPServer::GetServer(); $arResult = true; if (array_key_exists("stream:stream", $arMessage)) { if ($senderClient->IsAuthenticated()) { $senderClient->SetStreamId("bx" . rand(1000, 9999)); $message = sprintf('<' . '?xml version="1.0" encoding="UTF-8"?' . '><stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" id="%s" from="%s" version="1.0"><stream:features><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/><ping xmlns="urn:xmpp:ping"/></stream:features>', $senderClient->GetStreamId(), htmlspecialcharsbx($senderClient->GetClientDomain())); $senderClient->__Send($message); } else { $version = ""; if (is_array($arMessage["stream:stream"]["."]) && array_key_exists("version", $arMessage["stream:stream"]["."])) { $version = $arMessage["stream:stream"]["."]["version"]; } $to = ""; if (is_array($arMessage["stream:stream"]["."]) && array_key_exists("to", $arMessage["stream:stream"]["."])) { $to = $arMessage["stream:stream"]["."]["to"]; } if (CXMPPUtility::IsBitrix24Mode()) { $senderClient->SetClientDomain($to); } else { $senderClient->SetClientDomain(CXMPPServer::GetDomain()); } if (CXMPPUtility::SelectDatabase($senderClient->GetClientDomain())) { $bAllowSasl = false; if (strlen($version) > 0) { $ar = explode(".", $version); $majorV = intval($ar[0]); if ($majorV >= 1) { $bAllowSasl = true; } } if ($bAllowSasl) { $senderClient->SetAuthenticationType("SASL"); } else { $senderClient->SetAuthenticationType("NON-SASL"); } if ($bAllowSasl) { $message = sprintf('<?xml version="1.0"?><stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" id="%s" from="%s" version="1.0"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism></mechanisms><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>', rand(1000, 9999), htmlspecialcharsbx($senderClient->GetClientDomain())); } else { $message = sprintf('<?xml version="1.0"?><stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" id="%s" from="%s">', rand(1000, 9999), htmlspecialcharsbx($senderClient->GetClientDomain())); } $senderClient->__Send($message); } else { $senderClient->Disconnect(); } } } elseif (array_key_exists("auth", $arMessage) && $senderClient->GetAuthenticationType() == "SASL") { $mechanism = "PLAIN"; if (array_key_exists("mechanism", $arMessage["auth"]["."])) { $mechanism = strtoupper($arMessage["auth"]["."]["mechanism"]); } $message = ''; if ($mechanism == "PLAIN") { $r = base64_decode($arMessage["auth"]["#"]); if (strlen($r) > 0) { if (substr($r, 0, 1) == "") { $r = "z" . $r; } $arResp = explode("", $r); $jid = $arResp[0]; $login = $arResp[1]; $pwd = $arResp[2]; if (strlen($login) > 0) { $authResult = $GLOBALS["USER"]->Login($login, $pwd, "N"); CXMPPUtility::Show("!S " . $login . ": " . (is_array($authResult) ? Print_R($authResult, true) : $authResult), 0); if ($authResult === true) { $message = '<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>'; $senderClient->_Authenticate($GLOBALS["USER"]->GetID(), $login, CXMPPUtility::GetJId(array("LOGIN" => $login), $senderClient->GetClientDomain()), false, $arMessage['iq']['query']['resource']['#']); } else { $message = '<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure></stream:stream>'; } } else { $message = '<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><temporary-auth-failure/></failure></stream:stream>'; } } else { $message = '<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><temporary-auth-failure/></failure></stream:stream>'; } } else { $message = '<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><invalid-mechanism/></failure></stream:stream>'; } $senderClient->__Send($message); } elseif (array_key_exists("iq", $arMessage) && $senderClient->GetAuthenticationType() == "NON-SASL") { $message = ''; if ($arMessage['iq']['query']['.']['xmlns'] == 'jabber:iq:auth') { $type = $arMessage['iq']['.']['type']; if (!in_array($type, array("get", "set"))) { return; } if ($type == 'get') { $message = sprintf('<iq type="result" id="%s" from="%s"><query xmlns="%s"><username>%s</username><password/><resource/></query></iq>', htmlspecialcharsbx($arMessage['iq']['.']['id']), htmlspecialcharsbx($senderClient->GetClientDomain()), htmlspecialcharsbx($arMessage['iq']['query']['.']['xmlns']), htmlspecialcharsbx($arMessage['iq']['query']['username']['#'])); } elseif ($type == 'set') { $username = $arMessage['iq']['query']['username']['#']; $password = $arMessage['iq']['query']['password']['#']; $authResult = $GLOBALS["USER"]->Login($username, $password, "N"); CXMPPUtility::Show("!N " . $username . ": " . (is_array($authResult) ? print_r($authResult, true) : $authResult), 0); if ($authResult === true) { $message = sprintf('<iq type="result" id="%s" from="%s"/>', htmlspecialcharsbx($arMessage['iq']['.']['id']), htmlspecialcharsbx($senderClient->GetClientDomain())); $senderClient->_Authenticate($GLOBALS["USER"]->GetID(), $username, CXMPPUtility::GetJId(array("LOGIN" => $username), $senderClient->GetClientDomain()), false, $arMessage['iq']['query']['resource']['#']); } else { $message = sprintf('<iq type="error" id="%s" from="%s"><error code="401" type="auth"><not-authorized xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>', htmlspecialcharsbx($arMessage['iq']['.']['id']), htmlspecialcharsbx($senderClient->GetClientDomain())); } } } else { $message = '<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><invalid-mechanism/></failure></stream:stream>'; } $senderClient->__Send($message); } return $arResult; }
function R01_Contract_Register($Settings, $PepsonID, $Person, $DomainZone) { /****************************************************************************/ $__args_types = array('array', 'string', 'array', 'string'); #----------------------------------------------------------------------------- $__args__ = Func_Get_Args(); eval(FUNCTION_INIT); /****************************************************************************/ $AddCustomer = new SoapClient(null, array('location' => SPrintF('https://%s:%d/%s', $Settings['Address'], $Settings['Port'], $Settings['Params']['PrefixAPI']), 'uri' => 'urn:RegbaseSoapInterface', 'exceptions' => 1, 'user_agent' => 'RegbaseSoapInterfaceClient', 'trace' => 1)); #----------------------------------------------------------------------------- if (Is_SOAP_Fault($AddCustomer)) { #--------------------------------------------------------------------------- $Msg = SPrintF('Ошибка обращения к регистратору: %s', $AddCustomer->faultstring); #--------------------------------------------------------------------------- return new gException('REQUEST_ERROR', $Msg); } #----------------------------------------------------------------------------- $loginResult = $AddCustomer->logIn($Settings['Login'], $Settings['Password']); #----------------------------------------------------------------------------- if (Is_SOAP_Fault($loginResult)) { #--------------------------------------------------------------------------- $Msg = SPrintF('Ошибка при авторизации: %s', $loginResult->faultstring); #--------------------------------------------------------------------------- return new gException('REQUEST_ERROR', $Msg); } #----------------------------------------------------------------------------- if ($loginResult->status->code == '0') { #--------------------------------------------------------------------------- $Msg = SPrintF('Ошибка авторизации [name=%s, message=%s]', $loginResult->status->name, $loginResult->status->message); #--------------------------------------------------------------------------- return new gException('AUTHORIZATION_FAILED', $Msg); } #----------------------------------------------------------------------------- $AddCustomer->__setCookie('SOAPClient', $loginResult->status->message); #----------------------------------------------------------------------------- switch ($PepsonID) { case 'Natural': #------------------------------------------------------------------------- $Params = array(); #------------------------------------------------------------------------- $Params['NICHDL'] = SprintF('%s%s_%s-GPT', Mb_SubStr(Translit($Person['Name']), 0, 1), Translit($Person['Sourname']), Mb_SubStr(UniqID(), 0, 5)); #------------------------------------------------------------------------- Debug(Print_R($Params, TRUE)); #------------------------------------------------------------------------- $Response = $AddCustomer->addDadminPerson($Params['NICHDL'], SPrintF('%s %s %s', $Person['Sourname'], $Person['Name'], $Person['Lastname']), SPrintF('%s %s %s', Translit($Person['Name']), Mb_SubStr(Translit($Person['Lastname']), 0, 1), Translit($Person['Sourname'])), SPrintF('%s %s, %s, %s', $Person['PasportLine'], $Person['PasportNum'], $Person['PasportWhom'], $Person['PasportDate']), $Person['BornDate'], SPrintF('%d, %s, %s, %s, %s %s', $Person['pIndex'], $Person['pCountry'], $Person['pState'], $Person['pCity'], $Person['pType'], $Person['pAddress']), $Person['Phone'], $Person['Fax'], $Person['Email'], 1, 1); break; case 'Juridical': #------------------------------------------------------------------------- $Params['NICHDL'] = SprintF('%s_%s-ORG-GPT', Translit($Person['CompanyName']), Mb_SubStr(UniqID(), 0, 5)); #------------------------------------------------------------------------- $Response = $AddCustomer->addDadminOrg($Params['NICHDL'], SPrintF('%s %s', $Person['CompanyFormFull'], $Person['CompanyName']), SPrintF('%s %s', Translit($Person['CompanyFormFull']), Translit($Person['CompanyName'])), $Person['Inn'], $Person['Ogrn'], SPrintF('%d, %s, %s, %s, %s %s', $Person['jIndex'], $Person['jCountry'], $Person['jState'], $Person['jCity'], $Person['jType'], $Person['jAddress']), SPrintF('%d, %s, %s, %s, %s %s', $Person['jIndex'], $Person['jCountry'], $Person['jState'], $Person['jCity'], $Person['pType'], $Person['pAddress']), $Person['Phone'], $Person['Fax'], $Person['Email'], SPrintF('%s %s %s', $Person['dSourname'], $Person['dName'], $Person['dLastname']), $Person['BankName'], $Person['BankAccount'], $Person['Kor'], $Person['Bik'], 1); break; default: return ERROR | @Trigger_Error(400); } #----------------------------------------------------------------------------- Debug(Print_R($Response, TRUE)); #----------------------------------------------------------------------------- if (Is_SOAP_Fault($Response)) { #--------------------------------------------------------------------------- $Msg = SPrintF('Ошибка при выполнении запроса: %s', $Response->faultstring); #--------------------------------------------------------------------------- return new gException('REQUEST_ERROR', $Msg); } #----------------------------------------------------------------------------- if ($Response->status->code == '0') { #--------------------------------------------------------------------------- $Msg = SPrintF('Ошибка регистрации домена [name=%s, message=%s]', $Response->status->name, $Response->status->message); #--------------------------------------------------------------------------- return new gException('ADD_DOMAIN_FAILED', $Msg); } #----------------------------------------------------------------------------- $CustomerID = $Response->nic_hdl; #----------------------------------------------------------------------------- Debug($CustomerID); #----------------------------------------------------------------------------- $logoutResult = $AddCustomer->logOut(); #----------------------------------------------------------------------------- if (Is_SOAP_Fault($logoutResult)) { #--------------------------------------------------------------------------- $Msg = SPrintF('Ошибка закрытия сессии: %s', $logoutResult->faultstring); #--------------------------------------------------------------------------- return new gException('REQUEST_ERROR', $Msg); } #----------------------------------------------------------------------------- return array('TicketID' => $CustomerID); }
<?php $name= $_POST['name']; $email= $_POST['email']; $message= $_POST['message']; $error = array('Není vyplněné jméno!','Není vyplněný email!','Není vyplněná zpráva!'); $host = $_SERVER['HTTP_HOST']; $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); $extra = 'uspesne-odeslano'; $chyb=0; Print_R ($_SERVER); if ($name==""){ echo $error[0].'<br />'; $chyb=1; } elseif ($email==""){ echo $error[1]; $chyb=1; } elseif ($message==""){ echo $error[2]; $chyb=1; } if ($chyb==0) { require_once "./class.phpmailer.php"; $mail = new PHPMailer(); //$mail->IsSMTP(); // k odeslání e-mailu použijeme SMTP server