Exemple #1
0
    $Server = array('TemplateID' => 'EmailClient', 'IsActive' => TRUE, 'IsDefault' => TRUE, 'Protocol' => isset($CheckEmail['UseSSL']) ? $CheckEmail['UseSSL'] ? 'ssl' : 'tcp' : 'ssl', 'Address' => isset($CheckEmail['CheckEmailServer']) ? $CheckEmail['CheckEmailServer'] : 'pop.yandex.ru', 'Port' => 110, 'Login' => isset($CheckEmail['CheckEmailLogin']) ? $CheckEmail['CheckEmailLogin'] : '', 'Password' => isset($CheckEmail['CheckEmailPassword']) ? $CheckEmail['CheckEmailPassword'] : '', 'Params' => array('Method' => isset($CheckEmail['CheckEmailProtocol']) ? $CheckEmail['CheckEmailProtocol'] : 'pop3'), 'AdminNotice' => 'Используется учётная запись от которой шлёт сообщения биллинг (пользователь с идентификатором 100)', 'SortID' => 100000, 'Monitoring' => "POP3=110\nPOP3S=995\nIMAP4=143\nIMAP4S=993");
    #-------------------------------------------------------------------------------
    $IsInsert = DB_Insert('Servers', $Server);
    if (Is_Error($IsInsert)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    unset($Config['Tasks']['Types']['CheckEmail']['UseSSL']);
    unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailServer']);
    unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailLogin']);
    unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailPassword']);
    unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailProtocol']);
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$File = IO_Write($ConfigPath, To_XML_String($Config), TRUE);
if (Is_Error($File)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$IsFlush = CacheManager::flush();
if (!$IsFlush) {
    @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
    foreach ($Courses as $Course) {
        #-------------------------------------------------------------------------------
        if (isset($PaymentSystems[$PaymentSystemID]) && @$Course['CharCode'] == $PaymentSystem['Valute'] && $PaymentSystem['IsCourseUpdate']) {
            #-------------------------------------------------------------------------------
            $Current = (string) SPrintF('%01.6g', FloatVal(Str_Replace(',', '.', @$Course['Value'])) / @$Course['Nominal']);
            #-------------------------------------------------------------------------------
            $PaymentSystems[$PaymentSystemID]['Course'] = $Current;
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$Path = System_Element('config/Config.xml');
if (Is_Error($Path)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$IsWrite = IO_Write($Path, To_XML_String($Config), TRUE);
if (Is_Error($IsWrite)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$IsFlush = CacheManager::flush();
if (!$IsFlush) {
    @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
return TRUE;
#-------------------------------------------------------------------------------
Exemple #3
0
function To_XML_String($Value, $Name = 'XML', $Level = 0)
{
    /******************************************************************************/
    $__args_types = array('array,string,integer,double,boolean,NULL', 'string,integer', 'integer');
    #-------------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /******************************************************************************/
    $Result = SPrintF('%s<%s', $Tab = $Level ? Str_Pad("\t", $Level, "\t") : '', $Name);
    #-------------------------------------------------------------------------------
    if (Is_Array($Value)) {
        #-------------------------------------------------------------------------------
        if (Count($Value) > 0) {
            #-------------------------------------------------------------------------------
            $Result = SPrintF("%s>\n", $Result);
            #-------------------------------------------------------------------------------
            foreach (Array_Keys($Value) as $Key) {
                $Result = SPrintF('%s%s', $Result, To_XML_String($Value[$Key], $Key, $Level + 1));
            }
            #-------------------------------------------------------------------------------
            $Result = SPrintF('%s%s', $Result, $Tab);
            #-------------------------------------------------------------------------------
        } else {
            #-------------------------------------------------------------------------------
            return SPrintF("%s type=\"array\" />\n", $Result);
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
    } else {
        #-------------------------------------------------------------------------------
        $Type = GetType($Value);
        #-------------------------------------------------------------------------------
        if ($Type != 'string') {
            $Result = SPrintF('%s type="%s"', $Result, $Type);
        }
        #-------------------------------------------------------------------------------
        if (StrLen($Value) > 0) {
            #-------------------------------------------------------------------------------
            $Value = HtmlSpecialChars((string) $Value);
            #-------------------------------------------------------------------------------
            $Result = SPrintF('%s>%s', $Result, $Value);
            #-------------------------------------------------------------------------------
        } else {
            #-------------------------------------------------------------------------------
            return SPrintF("%s />\n", $Result);
            #-------------------------------------------------------------------------------
        }
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
    return SPrintF("%s</%s>\n", $Result, $Name);
    #-------------------------------------------------------------------------------
}
Exemple #4
0
    #-----------------------------------------------------------------------------
    if ($Code['IP'] == $_SERVER['REMOTE_ADDR']) {
        #---------------------------------------------------------------------------
        $IsExists = TRUE;
        #---------------------------------------------------------------------------
        $Secret = $Code['Secret'];
        #---------------------------------------------------------------------------
        break;
    }
}
#-------------------------------------------------------------------------------
if (!$IsExists) {
    $Codes[UniqID('ID')] = array('IP' => $_SERVER['REMOTE_ADDR'], 'Secret' => $Secret = Rand(100000, 900000), 'Date' => Time());
}
#-------------------------------------------------------------------------------
$XML = To_XML_String($Codes);
if (Is_Error($XML)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$IsWrite = IO_Write(SPrintF('%s/protect.xml', $Tmp), $XML, TRUE);
if (Is_Error($IsWrite)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Path = Styles_Element('Images/ProtectBg.png');