Exemplo n.º 1
0
             } else {
                 $arWeekDays = array(0, 2, 4, 6);
             }
             break;
         case 3:
             $arWeekDays = array($w, ($w + 3) % 7);
             sort($arWeekDays);
             break;
         default:
             // 7
             $arWeekDays = array($w);
     }
     $strMessage = GetMessage("MAIN_DUMP_SHED_CLOSEST_TIME_" . $day) . FormatDate('FULL', strtotime(date('Y-m-d ' . sprintf('%02d:%02d', floor($t / 60), $t % 60), $start_time))) . ' ' . GetMessage('DUMP_LOCAL_TIME');
     if ($dump_auto_set == 2) {
         $backup_secret_key = randString(16);
         CPasswordStorage::Set('backup_secret_key', $backup_secret_key);
         $strError = CBitrixCloudBackup::getInstance()->addBackupJob($backup_secret_key, $url, $sec, $arWeekDays);
         $strMessage .= '<br>' . GetMessage('DUMP_CHECK_BITRIXCLOUD', array('#LINK#' => '/bitrix/admin/bitrixcloud_backup_job.php?lang=' . LANGUAGE_ID));
     }
 } elseif ($_REQUEST['dump_auto_green_button']) {
     $strError = GetMessage('DUMP_WARN_NO_BITRIXCLOUD');
 } else {
     $strMessage = GetMessage('DUMP_SAVED_DISABLED');
 }
 if (!$strError) {
     IntOptionSet("dump_auto_enable", $dump_auto_set);
     $dump_auto_enable = $dump_auto_set;
 }
 IntOptionSet("dump_delete_old", $_REQUEST['dump_delete_old']);
 IntOptionSet("dump_old_time", $_REQUEST['dump_old_time']);
 IntOptionSet("dump_old_cnt", $_REQUEST['dump_old_cnt']);
Exemplo n.º 2
0
$APPLICATION->SetTitle(GetMessage("MAIN_DUMP_AUTO_PAGE_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/prolog_admin_after.php";
$arAllBucket = CBackup::GetBucketList();
$strError = '';
if ($_REQUEST['save']) {
    if (!check_bitrix_sessid()) {
        CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("MAIN_DUMP_ERROR"), "DETAILS" => GetMessage("DUMP_MAIN_SESISON_ERROR"), "TYPE" => "ERROR", "HTML" => true));
    } else {
        $BUCKET_ID = $_REQUEST['dump_bucket_id'];
        if (!$bMcrypt) {
            $_REQUEST['dump_encrypt_key'] = '';
            if ($BUCKET_ID == -1) {
                $BUCKET_ID = 0;
            }
        }
        CPasswordStorage::Set('dump_temporary_cache', $_REQUEST['dump_encrypt_key']);
        IntOptionSet("dump_bucket_id", $BUCKET_ID);
        IntOptionSet("dump_auto_enable", $dump_auto_enable = $_REQUEST['dump_auto_enable'] == 'Y');
        if ($dump_auto_enable) {
            $t = preg_match('#^([0-9]{2}):([0-9]{2})$#', $_REQUEST['dump_auto_time'], $regs) ? $regs[1] * 60 + $regs[2] : 0;
            IntOptionSet("dump_auto_time", $t);
            $i = intval($_REQUEST['dump_auto_interval']);
            if (!$i) {
                $i = 1;
            }
            IntOptionSet("dump_auto_interval", $i);
            COption::SetOptionInt('main', 'last_backup_end_time', 0);
            $start_time = time();
            $min_left = $t - date('H') * 60 - date('i');
            if ($min_left < -60) {
                $start_time += 86400;