Beispiel #1
0
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
$Settings = $Config['Interface']['Edesks']['DenyFoulLanguage'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$EnCharMap = array("jo", "j", "c", "u", "k", "e", "n", "g", "sh", "sh", "z", "h", "'", "f", "u", "v", "a", "p", "r", "o", "l", "d", "zh", "je", "ja", "ch", "s", "m", "i", "t", "'", "b", "ju");
#-------------------------------------------------------------------------------
# For transliteration russian char map
$RuCharMap = array("ё", "й", "ц", "у", "к", "е", "н", "г", "ш", "щ", "з", "х", "ъ", "ф", "ы", "в", "а", "п", "р", "о", "л", "д", "ж", "э", "я", "ч", "с", "м", "и", "т", "ь", "б", "ю");
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
foreach (Preg_Split('/[\\s,]+/', $Text) as $Word) {
    #Debug(SPrintF('[comp/Formats/Edesk/Message/CheckFoul]: Word = "%s"',print_r($Word,true)));
    #-------------------------------------------------------------------------------
    $Word = Trim(Str_Replace($EnCharMap, $RuCharMap, Mb_StrToLower($Word, 'UTF-8')));
    #-------------------------------------------------------------------------------
    if (Mb_StrLen($Word) > $Settings['FoulMaxLength']) {
        continue;
    }
    #-------------------------------------------------------------------------------
    foreach (Preg_Split('/\\s+/', $Regulars['Fouls']) as $Foul) {
        #-------------------------------------------------------------------------------
        $Foul = Trim($Foul);
        #Debug(SPrintF('[comp/Formats/Edesk/Message/CheckFoul]: Foul = "%s"',print_r($Foul,true)));
        #-------------------------------------------------------------------------------
        if (Preg_Match($Foul, $Word)) {
            #-------------------------------------------------------------------------------
            Debug(SPrintF('[comp/Formats/Edesk/Message/CheckFoul]: Foul found: "%s"', $Word));
            return array('Word' => $Word);
            # нецензурщина детектед
#-------------------------------------------------------------------------------
if ($Ns2IP && !Preg_Match($Regulars['IP'], $Ns2IP)) {
    return new gException('WRONG_IP_NS2', 'Неверный IP адрес второго сервера имен');
}
#-------------------------------------------------------------------------------
$Ns3Name = Trim(Mb_StrToLower($Ns3Name, 'UTF-8'), '.');
#-------------------------------------------------------------------------------
if ($Ns3Name && !Preg_Match($Regulars['Domain'], $Ns3Name)) {
    return new gException('WRONG_NAME_NS3', 'Неверное имя дополнительного сервера имен');
}
#-------------------------------------------------------------------------------
if ($Ns3IP && !Preg_Match($Regulars['IP'], $Ns3IP)) {
    return new gException('WRONG_IP_NS3', 'Неверный IP адрес дополнительного сервера имен');
}
#-------------------------------------------------------------------------------
$Ns4Name = Trim(Mb_StrToLower($Ns4Name, 'UTF-8'), '.');
#-------------------------------------------------------------------------------
if ($Ns4Name && !Preg_Match($Regulars['Domain'], $Ns4Name)) {
    return new gException('WRONG_NAME_NS3', 'Неверное имя расширенного сервера имен');
}
#-------------------------------------------------------------------------------
if ($Ns4IP && !Preg_Match($Regulars['IP'], $Ns4IP)) {
    return new gException('WRONG_IP_NS3', 'Неверный IP адрес расширенного сервера имен');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$UDomainOrder = array('DomainName' => $DomainName, 'SchemeID' => $SchemeID, 'ExpirationDate' => $ExpirationDate, 'PersonID' => $PersonID, 'Ns1Name' => $Ns1Name, 'Ns1IP' => $Ns1IP, 'Ns2Name' => $Ns2Name, 'Ns2IP' => $Ns2IP, 'Ns3Name' => $Ns3Name, 'Ns3IP' => $Ns3IP, 'Ns4Name' => $Ns4Name, 'Ns4IP' => $Ns4IP);
#-------------------------------------------------------------------------------
$IsUpdate = DB_Update('DomainOrders', $UDomainOrder, array('ID' => $DomainOrderID));
if (Is_Error($IsUpdate)) {
    return ERROR | @Trigger_Error(500);
Beispiel #3
0
#-------------------------------------------------------------------------------
$Args = isset($Args) ? $Args : Args();
#-------------------------------------------------------------------------------
$DomainName = (string) @$Args['DomainName'];
$JSON = (bool) @$Args['JSON'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$DomainName = Trim($DomainName);
#-------------------------------------------------------------------------------
$Regulars = Regulars();
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($DomainName) {
    $DomainName = Preg_Replace('/[^a-zа-я0-9-\\.]/u', '-', Mb_StrToLower($DomainName, 'UTF-8'));
}
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/www/DomainWhoIs]: DomainName = %s', $DomainName));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$DOM = new DOM();
#-------------------------------------------------------------------------------
$Links =& Links();
# Коллекция ссылок
$Links['DOM'] =& $DOM;
#-------------------------------------------------------------------------------
if (Is_Error($DOM->Load('Base'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
Beispiel #4
0
     #-------------------------------------------------------------------------------
     $DOM->AddChild('Into', $Form);
     $Out = $DOM->Build(FALSE);
     #-------------------------------------------------------------------------------
     if (Is_Error($Out)) {
         return ERROR | @Trigger_Error(500);
     }
     #-------------------------------------------------------------------------------
     #-------------------------------------------------------------------------------
     return array('Status' => 'Ok', 'DOM' => $DOM->Object);
 }
 #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 $Regulars = Regulars();
 #-------------------------------------------------------------------------------
 $Domain = Mb_StrToLower($Domain, 'UTF-8');
 #-------------------------------------------------------------------------------
 if (Preg_Match('/^www\\.(.+)$/', $Domain, $Mathces)) {
     $Domain = Next($Mathces);
 }
 #-------------------------------------------------------------------------------
 if (!Preg_Match($Regulars['Domain'], $Domain)) {
     return new gException('WRONG_DOMAIN', 'Неверный домен');
 }
 #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 $Table = array(array('Тарифный план', $HostingScheme['Name']));
 #-------------------------------------------------------------------------------
 $Comp = Comp_Load('Form/Input', array('name' => 'HostingSchemeID', 'type' => 'hidden', 'value' => $HostingScheme['ID']));
 if (Is_Error($Comp)) {
     return ERROR | @Trigger_Error(500);
        #return new gException('IP_NS4_CAN_NOT_FILL','IP адрес расширенного сервера имен не может быть указан');
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    if ($Ns4IP) {
        $Ns4IP = '';
    }
    #-------------------------------------------------------------------------------
    #return new gException('NAME_NS4_NOT_FILL','Укажите имя расширенного сервера имен');
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (Mb_StrToLower($Ns1Name, 'UTF-8') == $Domain || Mb_StrToLower($Ns2Name, 'UTF-8') == $Domain || Mb_StrToLower($Ns3Name, 'UTF-8') == $Domain || Mb_StrToLower($Ns4Name, 'UTF-8') == $Domain) {
    return new gException('NS_HOSTNAME_CANT_BE_EQUAL_TO_DOMAIN', 'Имя DNS сервера не может совпадать с именем домена');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (Implode(';', array($DomainOrder['Ns1Name'], $DomainOrder['Ns1IP'], $DomainOrder['Ns2Name'], $DomainOrder['Ns2IP'], $DomainOrder['Ns3Name'], $DomainOrder['Ns3IP'], $DomainOrder['Ns4Name'], $DomainOrder['Ns4IP'])) == Implode(';', array($Ns1Name, $Ns1IP, $Ns2Name, $Ns2IP, $Ns3Name, $Ns3IP, $Ns4Name, $Ns4IP))) {
    return new gException('NO_DATA_FOR_CHANGE', 'Нет данных для изменения');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$UDomainOrder = array('Ns1Name' => $Ns1Name, 'Ns1IP' => $Ns1IP, 'Ns2Name' => $Ns2Name, 'Ns2IP' => $Ns2IP, 'Ns3Name' => $Ns3Name, 'Ns3IP' => $Ns3IP, 'Ns4Name' => $Ns4Name, 'Ns4IP' => $Ns4IP);
#-------------------------------------------------------------------------------
$IsUpdate = DB_Update('DomainOrders', $UDomainOrder, array('ID' => $DomainOrderID));
if (Is_Error($IsUpdate)) {
    return ERROR | @Trigger_Error(500);
}
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------TRANSACTION-------------------------------------------
if (Is_Error(DB_Transaction($TransactionID = UniqID('DomainTransfer')))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$OrderID = DB_Insert('Orders', array('ContractID' => $Contract['ID'], 'ServiceID' => 20000, 'IsPayed' => TRUE, 'ServerID' => $DomainScheme['ServerID']));
if (Is_Error($OrderID)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$IDomainOrder = array('OrderID' => $OrderID, 'DomainName' => Mb_StrToLower($DomainName, 'UTF-8'), 'SchemeID' => $DomainScheme['ID'], 'PersonID' => $PersonID, 'WhoIs' => $WhoIs['Info'], 'AuthInfo' => $AuthInfo ? $AuthInfo : NULL, 'UpdateDate' => Time());
#-------------------------------------------------------------------------------
$IDomainOrder['ExpirationDate'] = Max($WhoIs['ExpirationDate'], Time());
#-------------------------------------------------------------------------------
$Domain = SPrintF('%s.%s', $DomainName, $DomainScheme['Name']);
#-------------------------------------------------------------------------------
for ($i = 1; $i < 5; $i++) {
    #-------------------------------------------------------------------------------
    $NsName = isset($WhoIs[SPrintF('Ns%uName', $i)]) ? $WhoIs[SPrintF('Ns%uName', $i)] : '';
    #-------------------------------------------------------------------------------
    $IDomainOrder[SPrintF('Ns%uName', $i)] = $NsName;
    #-------------------------------------------------------------------------------
    $NsIP = isset($WhoIs[SPrintF('Ns%uIP', $i)]) ? $WhoIs[SPrintF('Ns%uIP', $i)] : '';
    #-------------------------------------------------------------------------------
    $IDomainOrder[SPrintF('Ns%uIP', $i)] = $NsIP;
    #-------------------------------------------------------------------------------
Beispiel #7
0
     return ERROR | @Trigger_Error(500);
 case 'exception':
     #-------------------------------------------------------------------------------
     # No more...
     Debug("[comp/Tasks/GC/DomainFindOddg]: Нет доменов");
     #-------------------------------------------------------------------------------
     break;
     #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 case 'array':
     #-------------------------------------------------------------------------------
     # строим массив доменов из биллинга
     $BillDomains = array();
     #-------------------------------------------------------------------------------
     foreach ($Domains as $Domain) {
         $BillDomains[] = Mb_StrToLower($Domain['Domain'], 'UTF-8');
     }
     #-------------------------------------------------------------------------------
     Debug(SPrintF('[comp/Tasks/GC/DomainFindOddg]: [%s] доменов у регистратора %s, в биллинге %s', $NowReg['Params']['Name'], SizeOf($RegDomains['Domains']), SizeOf($BillDomains)));
     #-------------------------------------------------------------------------------
     # сортируем массивы
     ASort($RegDomains['Domains']);
     ASort($BillDomains);
     #-------------------------------------------------------------------------------
     # лишние у регистратора
     $DomainsOdd = Array_Diff($RegDomains['Domains'], $BillDomains);
     #-------------------------------------------------------------------------------
     if (SizeOf($DomainsOdd) > 0) {
         #-------------------------------------------------------------------------------
         foreach ($DomainsOdd as $DomainOdd) {
             #-------------------------------------------------------------------------------
Beispiel #8
0
if (!$Count) {
    return new gException('OWNER_NOT_FOUND', 'Владелец не найден');
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Params = $User['Params'];
#-------------------------------------------------------------------------------
$NotificationMethods = $User['Params']['NotificationMethods'];
#-------------------------------------------------------------------------------
foreach (Array_Keys($NotificationMethods) as $MethodID) {
    #-------------------------------------------------------------------------------
    if (!isset($Config['Notifies']['Methods'][$MethodID])) {
        continue;
    }
    #-------------------------------------------------------------------------------
    $Value = Mb_StrToLower(Trim(@$Args[$MethodID]));
    #-------------------------------------------------------------------------------
    if ($Value) {
        if (!Preg_Match($Regulars[$MethodID], $Value)) {
            return new gException('WRONG_CONTACT', SPrintF('Неправильный контактный адрес: %s', $Value));
        }
    }
    #-------------------------------------------------------------------------------
    $Params['NotificationMethods'][$MethodID]['Address'] = $Value;
    #-------------------------------------------------------------------------------
    if ($User['Params']['NotificationMethods'][$MethodID]['Address'] != $Value) {
        $Params['NotificationMethods'][$MethodID]['Confirmed'] = 0;
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# кастыли для почты
$__USER['Params']['NotificationMethods']['Email'] = array('Address' => $__USER['Email'], 'Confirmed' => $__USER['EmailConfirmed']);
#-------------------------------------------------------------------------------
$Methods = $Config['Notifies']['Methods'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
foreach (Array_Keys($Methods) as $Key) {
    #-------------------------------------------------------------------------------
    $Method = $Methods[$Key];
    #-------------------------------------------------------------------------------
    $NotificationMethod = $__USER['Params']['NotificationMethods'][$Key];
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    $Value = Mb_StrToLower(Trim(@$Args[$Key]));
    #-------------------------------------------------------------------------------
    if ($Value) {
        #-------------------------------------------------------------------------------
        #Debug(SPrintF('[comp/www/API/UserPersonalDataChange]: Key = %s; value = %s',$Key,$Value));
        #-------------------------------------------------------------------------------
        if (!Preg_Match($Regulars[$Key], $Value)) {
            return new gException('WRONG_CONTACT', SPrintF('Неверно указан адрес: %s', $Value));
        }
        #-------------------------------------------------------------------------------
        if ($Value != $NotificationMethod['Address']) {
            #-------------------------------------------------------------------------------
            $Message = $NotificationMethod['Address'] ? SPrintF('Смена контактного адреса %s -> %s (%s)', $NotificationMethod['Address'], $Value, $Method['Name']) : SPrintF('Добавлен контактный адрес (%s) для %s', $Value, $Method['Name']);
            #-------------------------------------------------------------------------------
            if ($Key == 'Email') {
                #-------------------------------------------------------------------------------
Beispiel #10
0
$Config = Config();
#-------------------------------------------------------------------------------
$Settings = $Config['Interface']['User']['Orders']['Domain'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($StepID) {
    #-------------------------------------------------------------------------------
    $Comp = Comp_Load('Form/Input', array('name' => 'ContractID', 'type' => 'hidden', 'value' => $ContractID));
    if (Is_Error($Comp)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $Form->AddChild($Comp);
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    $DomainName = Mb_StrToLower($DomainName, 'UTF-8');
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    $Regulars = Regulars();
    #-------------------------------------------------------------------------------
    if (!Preg_Match($Regulars[$Settings['Transfer']['IsSelectRegistrator'] ? 'DomainName' : 'Domain'], $DomainName)) {
        return new gException('WRONG_DOMAIN_NAME', 'Неверное доменное имя');
    }
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    if (!$Settings['Transfer']['IsSelectRegistrator']) {
        #-------------------------------------------------------------------------------
        $DomainZone = SubStr($DomainName, StrPos($DomainName, '.') + 1, StrLen($DomainName));
        #-------------------------------------------------------------------------------
        $UniqID = UniqID('DomainSchemes');
        #-------------------------------------------------------------------------------
Beispiel #11
0
function RegRu_Domain_GetPrice($Settings, $DomainName, $DomainZone)
{
    /******************************************************************************/
    $__args_types = array('array', 'string', 'string');
    #-------------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /******************************************************************************/
    return array();
    $HTTP = RegRu_Build_HTTP($Settings);
    #-------------------------------------------------------------------------------
    $Query = array('username' => $Settings['Login'], 'password' => $Settings['Password'], 'tld' => $DomainZone, 'cat' => '', 'limit' => 100500);
    #-------------------------------------------------------------------------------
    $Settings['PrefixAPI'] = SprintF("https://api.reg.ru/api/regru2/%s", "domain/get_premium");
    #-------------------------------------------------------------------------------
    $Result = HTTP_Send($Settings['PrefixAPI'], $HTTP, array(), $Query);
    if (Is_Error($Result)) {
        return ERROR | @Trigger_Error('[RegRu_Domain_GetPrice]: не удалось выполнить запрос к серверу');
    }
    #-------------------------------------------------------------------------------
    $Result = Trim($Result['Body']);
    #-------------------------------------------------------------------------------
    $Result = Json_Decode($Result, TRUE);
    #-------------------------------------------------------------------------------
    if ($Result['result'] != 'success') {
        return new gException('REGISTRATOR_ERROR', 'Регистратор вернул ошибку');
    }
    #-------------------------------------------------------------------------------
    #Debug(SPrintF('[RegRu_Domain_PriceList]: %s',print_r($Result,true)));
    #-------------------------------------------------------------------------------
    $Domain = SPrintF('%s.%s', $DomainName, $DomainZone);
    #-------------------------------------------------------------------------------
    # перебираем массив, ищщем домен в нём
    $Out = array();
    #-------------------------------------------------------------------------------
    foreach (Array_Keys($Result['answer']['domains']) as $Key) {
        #-------------------------------------------------------------------------------
        #Debug(SPrintF('[RegRu_Domain_PriceList]: Key = %s; Array = %s',$Key,print_r($Result['answer']['domains'][$Key],true)));
        #-------------------------------------------------------------------------------
        #ebug(SPrintF('[RegRu_Domain_PriceList]: Key = %s; name = %s; price = %s',$Key,$Result['answer']['domains'][$Key]['name'],$Result['answer']['domains'][$Key]['price']));
        #-------------------------------------------------------------------------------
        if ($Domain == Mb_StrToLower($Result['answer']['domains'][$Key]['name'], 'UTF-8')) {
            #-------------------------------------------------------------------------------
            $Out['price'] = $Result['answer']['domains'][$Key]['price'];
            #-------------------------------------------------------------------------------
            $Out['premium'] = 'yes';
            #-------------------------------------------------------------------------------
            break;
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    return $Out;
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
}
Beispiel #12
0
         default:
             return ERROR | @Trigger_Error(101);
     }
     #-------------------------------------------------------------------------------
     # страна должна быть кодом
     if (isset($Profile['Attribs']['pCountry'])) {
         $ProfileCompile['Attribs']['pCountry'] = $Profile['Attribs']['pCountry'];
     }
     if (isset($Profile['Attribs']['PasportCountry'])) {
         $ProfileCompile['Attribs']['PasportCountry'] = $Profile['Attribs']['PasportCountry'];
     }
     if (isset($Profile['Attribs']['jCountry'])) {
         $ProfileCompile['Attribs']['jCountry'] = $Profile['Attribs']['jCountry'];
     }
     #-------------------------------------------------------------------------------
     $DomainRegister = $Server->DomainRegister(Mb_StrToLower($DomainOrder['DomainName'], 'UTF-8'), $DomainOrder['DomainZone'], (int) $DomainOrder['YearsRemainded'], $DomainOrder['Ns1Name'], $DomainOrder['Ns1IP'], $DomainOrder['Ns2Name'], $DomainOrder['Ns2IP'], $DomainOrder['Ns3Name'], $DomainOrder['Ns3IP'], $DomainOrder['Ns4Name'], $DomainOrder['Ns4IP'], $DomainOrder['IsPrivateWhoIs'], '', $Profile['TemplateID'], $ProfileCompile['Attribs']);
     #-------------------------------------------------------------------------------
 }
 #-------------------------------------------------------------------------------
 switch (ValueOf($DomainRegister)) {
     case 'error':
         return ERROR | @Trigger_Error(500);
     case 'exception':
         #-------------------------------------------------------------------------------
         # add ticket to user, about it's exception
         $Clause = DB_Select('Clauses', '*', array('UNIQ', 'Where' => "`Partition` = 'CreateTicket/ERROR_DOMAIN_REGISTER'"));
         #-------------------------------------------------------------------------------
         switch (ValueOf($Clause)) {
             case 'error':
                 return ERROR | @Trigger_Error(500);
             case 'exception':