コード例 #1
0
	private static function SendCommand($channelId, $message, $method = 'POST', $timeout = 5, $dont_wait_answer = true)
	{
		if (!is_array($channelId))
			$channelId = Array($channelId);

		$channelId = implode('/', array_unique($channelId));

		if (strlen($channelId) <=0 || strlen($message) <= 0)
			return false;

		if (!in_array($method, Array('POST', 'GET')))
			return false;

		$nginx_error = COption::GetOptionString("pull", "nginx_error", "N");
		if ($nginx_error != "N")
		{
			$nginx_error = unserialize($nginx_error);
			if (intval($nginx_error['date'])+120 < time())
			{
				COption::SetOptionString("pull", "nginx_error", "N");
				CAdminNotify::DeleteByTag("PULL_ERROR_SEND");
				$nginx_error = "N";
			}
			else if ($nginx_error['count'] >= 10)
			{
				$ar = Array(
					"MESSAGE" => GetMessage('PULL_ERROR_SEND'),
					"TAG" => "PULL_ERROR_SEND",
					"MODULE_ID" => "pull",
				);
				CAdminNotify::Add($ar);
				return false;
			}
		}

		$postdata = CHTTP::PrepareData($message);

		$CHTTP = new CHTTP();
		$CHTTP->http_timeout = intval($timeout);
		$arUrl = $CHTTP->ParseURL(CPullOptions::GetPublishUrl($channelId), false);
		if ($CHTTP->Query($method, $arUrl['host'], $arUrl['port'], $arUrl['path_query'], $postdata, $arUrl['proto'], 'N', $dont_wait_answer))
		{
			$result = $dont_wait_answer? '{}': $CHTTP->result;
		}
		else
		{
			if ($nginx_error == "N")
			{
				$nginx_error = Array(
					'count' => 1,
					'date' => time(),
					'date_increment' => time(),
				);
			}
			else if (intval($nginx_error['date_increment'])+1 < time())
			{
				$nginx_error['count'] = intval($nginx_error['count'])+1;
				$nginx_error['date_increment'] = time();
			}
			COption::SetOptionString("pull", "nginx_error", serialize($nginx_error));
			$result = false;
		}

		return $result;
	}
コード例 #2
0
} elseif (IsModuleInstalled('intranet')) {
    $strError = GetMessage("MODULE_INTRANET_ERROR");
}
if ($strError != "") {
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
    echo CAdminMessage::ShowMessage(array("DETAILS" => $strError));
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
    die;
}
$aTabs = array(array("DIV" => "main", "TAB" => GetMessage("BCL_MAIN_TAB1"), "ICON" => "main_user_edit", "TITLE" => GetMessage("BCL_MAIN_TAB_TITLE")), array("DIV" => "dirs", "TAB" => GetMessage("BCL_FOLDERS_TAB"), "ICON" => "main_user_edit", "TITLE" => GetMessage("BCL_FOLDERS_TAB_TITLE")), array("DIV" => "sites", "TAB" => GetMessage("BCL_SITES_TAB"), "ICON" => "main_user_edit", "TITLE" => GetMessage("BCL_SITES_TAB_TITLE")), array("DIV" => "ext", "TAB" => GetMessage("BCL_EXTENDED_TAB"), "ICON" => "main_user_edit", "TITLE" => GetMessage("BCL_EXTENDED_TAB_TITLE")));
$tabControl = new CAdminTabControl("tabControl", $aTabs, true, true);
$bVarsFromForm = false;
$message = null;
if ($_SERVER["REQUEST_METHOD"] == "POST" && (isset($_POST["save"]) || isset($_POST["apply"]) || isset($_POST["bitrixcloud_siteb"])) && check_bitrix_sessid()) {
    if (isset($_POST["save"]) || isset($_POST["apply"])) {
        CAdminNotify::DeleteByTag("bitrixcloud_off");
        $server_name = trim($_POST["server_name"]);
        if ($server_name == "") {
            $message = new CAdminMessage(GetMessage("BCL_DOMAIN_ERROR"));
        } elseif (empty($_POST["site"])) {
            $message = new CAdminMessage(GetMessage("BCL_SITES_ERROR"));
        } else {
            $cdn_config = CBitrixCloudCDNConfig::getInstance()->loadFromOptions();
            if ($cdn_config->getDomain() !== $server_name) {
                CBitrixCloudCDN::domainChanged();
            }
            $cdn_config->setSites(array_keys($_POST["site"]));
            $cdn_config->setDomain($server_name);
            $cdn_config->setKernelRewrite($_POST["kernel_folder"] !== "n");
            $cdn_config->setContentRewrite($_POST["content_folders"] === "y");
            $cdn_config->saveToOptions();
コード例 #3
0
 public function setIsAlreadyConverted()
 {
     CAdminNotify::DeleteByTag('webdav_convertor_14_0_2');
     COption::SetOptionString('webdav', '~isAlreadyConvertedDropped', 'Y');
     return $this;
 }
コード例 #4
0
ファイル: cdn.php プロジェクト: DarneoStudio/bitrix
 /**
  *
  * @return bool
  *
  */
 private static function updateConfig()
 {
     if (!self::$config->lock()) {
         return true;
     }
     $delayExpiration = true;
     try {
         try {
             self::$config = CBitrixCloudCDNConfig::getInstance()->loadRemoteXML();
             self::$config->saveToOptions();
             self::$config->unlock();
         } catch (CBitrixCloudException $e) {
             //In case of documented XML error we'll disable CDN
             if ($e->getErrorCode() !== "") {
                 self::SetActive(false);
                 $delayExpiration = false;
             }
             throw $e;
         }
     } catch (exception $e) {
         if ($delayExpiration) {
             self::$config->setExpired(time() + 1800);
         }
         CAdminNotify::Add(array("MESSAGE" => GetMessage("BCL_CDN_NOTIFY", array("#HREF#" => "/bitrix/admin/bitrixcloud_cdn.php?lang=" . LANGUAGE_ID)), "TAG" => "bitrixcloud_off", "MODULE_ID" => "bitrixcloud", "ENABLE_CLOSE" => "Y"));
         self::$config->unlock();
         return false;
     }
     self::$config->unlock();
     //Web service were disabled
     if (!self::$config->isActive()) {
         //By traffic quota
         if (self::$config->getQuota()->getTrafficSize() > self::$config->getQuota()->getAllowedSize()) {
             self::$config->setExpired(time() + 1800);
             CAdminNotify::Add(array("MESSAGE" => GetMessage("BCL_CDN_NOTIFY_QUOTA_LIMIT"), "TAG" => "bitrixcloud_off", "MODULE_ID" => "bitrixcloud", "ENABLE_CLOSE" => "N"));
             self::$config->unlock();
             return false;
         } elseif (self::$config->getQuota()->isExpired()) {
             self::$config->setExpired(time() + 1800);
             CAdminNotify::Add(array("MESSAGE" => GetMessage("BCL_CDN_NOTIFY_QUOTA_EXPIRED"), "TAG" => "bitrixcloud_off", "MODULE_ID" => "bitrixcloud", "ENABLE_CLOSE" => "N"));
             self::$config->unlock();
             return false;
         }
     }
     CAdminNotify::DeleteByTag("bitrixcloud_off");
     return true;
 }
コード例 #5
0
ファイル: migration.php プロジェクト: andy-profi/bxApiDocs
 public static function hideNotifier()
 {
     \CAdminNotify::DeleteByTag(self::NOTIF_TAG);
 }
コード例 #6
0
ファイル: learning_convert.php プロジェクト: Satariall/izurit
		CloseWaitWindow();
	</script>
	<?php 
    if (is_int($processedAtLastStep)) {
        $processedSummary += $processedAtLastStep;
    }
    if ($processedAtLastStep === false) {
        CAdminMessage::ShowMessage(array('MESSAGE' => GetMessage('LEARNING_CONVERT_FAILED'), 'DETAILS' => GetMessage('LEARNING_PROCESSED_SUMMARY') . ' <b>' . $processedSummary . '</b>' . '<div id="learning_convert_finish"></div>', 'HTML' => true, 'TYPE' => 'ERROR'));
        ?>
		<script>
			StopConvert();
		</script>
		<?php 
    } elseif (CLearnInstall201203ConvertDB::_IsAlreadyConverted()) {
        CAdminMessage::ShowMessage(array('MESSAGE' => GetMessage('LEARNING_CONVERT_COMPLETE'), 'DETAILS' => GetMessage('LEARNING_PROCESSED_SUMMARY') . ' <b>' . $processedSummary . '</b>' . '<div id="learning_convert_finish"></div>', 'HTML' => true, 'TYPE' => 'OK'));
        CAdminNotify::DeleteByTag('learning_convert_11_5_0');
        ?>
		<script>
			EndConvert();
		</script>
		<?php 
    } else {
        CAdminMessage::ShowMessage(array('MESSAGE' => GetMessage('LEARNING_CONVERT_IN_PROGRESS'), 'DETAILS' => GetMessage('LEARNING_PROCESSED_SUMMARY') . ' <b>' . $processedSummary . '</b>', 'HTML' => true, 'TYPE' => 'OK'));
        ?>
		<script>
			DoNext(<?php 
        echo $processedSummary;
        ?>
);
		</script>
		<?php 
コード例 #7
0
ファイル: im_convert.php プロジェクト: Satariall/izurit
						CloseWaitWindow();
						StopConvert();
					}
				}
			);
		}

		return false;
	}
	</script>

	<?php 
    $max_messages = CIMConvert::ConvertCount();
    if ($max_messages <= 0) {
        CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("IM_CONVERT_COMPLETE"), "DETAILS" => GetMessage("IM_CONVERT_COMPLETE_ALL_OK"), "HTML" => true, "TYPE" => "OK"));
        CAdminNotify::DeleteByTag("IM_CONVERT");
    }
    ?>
	<div id="convert_result_div" style="margin:0px">
	</div>


	<form method="POST" action="<?php 
    echo $APPLICATION->GetCurPage();
    ?>
?lang=<?php 
    echo htmlspecialcharsbx(LANG);
    ?>
" name="fs1">
	<?php 
    $tabControl->Begin();
コード例 #8
0
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
    ShowError(Loc::getMessage('CAT_SETS_AVAILABLE_ERRORS_FATAL'));
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
    die;
}
if ($_SERVER['REQUEST_METHOD'] == 'GET' && check_bitrix_sessid() && (isset($_REQUEST['operation']) && (string) $_REQUEST['operation'] == 'Y')) {
    CUtil::JSPostUnescape();
    $params = array('sessID' => $_GET['ajaxSessionID'], 'maxExecutionTime' => $_GET['maxExecutionTime'], 'maxOperationCounter' => $_GET['maxOperationCounter'], 'counter' => $_GET['counter'], 'operationCounter' => $_GET['operationCounter'], 'lastID' => $_GET['lastID']);
    $setsAvailable = new CCatalogProductSetAvailable($params['sessID'], $params['maxExecutionTime'], $params['maxOperationCounter']);
    $setsAvailable->initStep($params['counter'], $params['operationCounter'], $params['lastID']);
    $setsAvailable->run();
    $result = $setsAvailable->saveStep();
    if ($result['finishOperation']) {
        $adminNotifyIterator = CAdminNotify::GetList(array(), array('MODULE_ID' => 'catalog', 'TAG' => 'CATALOG_SETS_AVAILABLE'));
        if ($adminNotify = $adminNotifyIterator->Fetch()) {
            CAdminNotify::DeleteByTag('CATALOG_SETS_AVAILABLE');
        }
    }
    echo CUtil::PhpToJSObject($result, false, true);
    die;
} else {
    $APPLICATION->SetTitle(Loc::getMessage('CAT_SETS_AVAILABLE_PAGE_TITLE'));
    $setsCounter = CCatalogProductSetAvailable::getAllCounter();
    $oneStepTime = CCatalogProductSetAvailable::getDefaultExecutionTime();
    require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_after.php';
    $tabList = array(array('DIV' => 'setTab01', 'TAB' => Loc::getMessage('CAT_SETS_AVAILABLE_TAB'), 'ICON' => 'catalog', 'TITLE' => Loc::getMessage('CAT_SETS_AVAILABLE_TAB_TITLE')));
    $tabControl = new CAdminTabControl('sets_available', $tabList, true, true);
    $APPLICATION->AddHeadScript('/bitrix/js/catalog/step_operations.js');
    ?>
<div id="sets_result_div" style="margin:0; display: none;"></div>
	<div id="sets_error_div" style="margin:0; display: none;">
コード例 #9
0
ファイル: converter.php プロジェクト: Satariall/izurit
     }
     if (empty($error)) {
         $message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_UPDATE_BASKET');
         $type = 'PROCESS';
         // SITE_START
         COption::SetOptionString("main", "site_stopped", "N");
         $result['NEXT_STEP'] = ++$ajax_step;
     } else {
         $message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_UPDATE_REPORT');
         $result['ERROR'] = true;
         $type = 'ERROR';
         $message .= "<br>" . $error;
     }
     $result['DATA'] = $message;
     Bitrix\Main\Config\Option::set("main", "~sale_converted_15", 'Y');
     CAdminNotify::DeleteByTag('SALE_ORDER_MASTER_CONVERT');
     break;
 case 22:
     if ($DB->TableExists('b_sale_basket')) {
         if ($DB->type == 'MYSQL') {
             if (!$DB->Query('ALTER TABLE b_sale_basket CHANGE PRICE PRICE DECIMAL(18,4) not null', true)) {
                 $error .= $DB->GetErrorMessage();
             }
             if (!$DB->Query('ALTER TABLE b_sale_basket CHANGE DISCOUNT_PRICE DISCOUNT_PRICE DECIMAL(18,4) not null', true)) {
                 $error .= $DB->GetErrorMessage();
             }
             if (!$DB->Query('ALTER TABLE b_sale_basket CHANGE QUANTITY QUANTITY DECIMAL(18,4) not null', true)) {
                 $error .= $DB->GetErrorMessage();
             }
             if (!$DB->Query("SELECT BASE_PRICE FROM b_sale_basket WHERE 1=0", true)) {
                 if (!$DB->Query("ALTER TABLE b_sale_basket ADD BASE_PRICE decimal(18, 4) null")) {
コード例 #10
0
ファイル: pull_channel.php プロジェクト: Satariall/izurit
 private static function SendCommand($channelId, $message, $options = array())
 {
     if (!is_array($channelId)) {
         $channelId = array($channelId);
     }
     $channelId = implode('/', array_unique($channelId));
     if (strlen($channelId) <= 0 || strlen($message) <= 0) {
         return false;
     }
     $defaultOptions = array("method" => "POST", "timeout" => 5, "dont_wait_answer" => true);
     $options = array_merge($defaultOptions, $options);
     if (!in_array($options["method"], array('POST', 'GET'))) {
         return false;
     }
     $nginx_error = COption::GetOptionString("pull", "nginx_error", "N");
     if ($nginx_error != "N") {
         $nginx_error = unserialize($nginx_error);
         if (intval($nginx_error['date']) + 120 < time()) {
             COption::SetOptionString("pull", "nginx_error", "N");
             CAdminNotify::DeleteByTag("PULL_ERROR_SEND");
             $nginx_error = "N";
         } else {
             if ($nginx_error['count'] >= 10) {
                 $ar = array("MESSAGE" => GetMessage('PULL_ERROR_SEND'), "TAG" => "PULL_ERROR_SEND", "MODULE_ID" => "pull");
                 CAdminNotify::Add($ar);
                 return false;
             }
         }
     }
     $postdata = CHTTP::PrepareData($message);
     $CHTTP = new CHTTP();
     $CHTTP->http_timeout = intval($options["timeout"]);
     if (isset($options["expiry"])) {
         $CHTTP->SetAdditionalHeaders(array("Message-Expiry" => intval($options["expiry"])));
     }
     $arUrl = $CHTTP->ParseURL(CPullOptions::GetPublishUrl($channelId), false);
     try {
         $sendResult = $CHTTP->Query($options["method"], $arUrl['host'], $arUrl['port'], $arUrl['path_query'], $postdata, $arUrl['proto'], 'N', $options["dont_wait_answer"]);
     } catch (Exception $e) {
         $sendResult = false;
     }
     if ($sendResult) {
         $result = $options["dont_wait_answer"] ? '{}' : $CHTTP->result;
     } else {
         if ($nginx_error == "N") {
             $nginx_error = array('count' => 1, 'date' => time(), 'date_increment' => time());
         } else {
             if (intval($nginx_error['date_increment']) + 1 < time()) {
                 $nginx_error['count'] = intval($nginx_error['count']) + 1;
                 $nginx_error['date_increment'] = time();
             }
         }
         COption::SetOptionString("pull", "nginx_error", serialize($nginx_error));
         $result = false;
     }
     return $result;
 }
コード例 #11
0
ファイル: index.php プロジェクト: Satariall/izurit
 protected static function _RemoveConvertDbNotify()
 {
     CAdminNotify::DeleteByTag('learning_convert_11_5_0');
 }
コード例 #12
0
 public static function deleteInformer($informerTag)
 {
     if ((string) $informerTag == '') {
         return;
     }
     $rsAdminNotify = \CAdminNotify::GetList(array(), array('MODULE_ID' => 'sale', 'TAG' => $informerTag));
     if ($arAdminNotify = $rsAdminNotify->Fetch()) {
         \CAdminNotify::DeleteByTag($informerTag);
     }
 }
コード例 #13
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/bitrix.eshop/include.php";
IncludeModuleLangFile(__FILE__);
$arThemes = array("_blue", "_green", "_yellow", "_gray", "_wood", "_red");
foreach ($arThemes as $theme) {
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/bitrix/templates/eshop" . $theme . "/")) {
        CopyDirFiles($_SERVER['DOCUMENT_ROOT'] . "/bitrix/templates/eshop" . $theme . "/components/bitrix/catalog/.default/", $_SERVER['DOCUMENT_ROOT'] . "/bitrix/templates/eshop" . $theme . "/components/bitrix/catalog/.default_old/", $rewrite = true, $recursive = true, $delete_after_copy = true);
    }
}
CAdminNotify::DeleteByTag("ESHOP_RENAME");
$APPLICATION->SetTitle(GetMessage("ESHOP_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
?>

<?php 
echo GetMessage("ESHOP_RENAME_SUCCESS");
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
コード例 #14
0
		}

		return false;
	}
	</script><?php 
    $strChangeFormat = COption::GetOptionString('catalog', 'discount_format', 'N');
    $intCountFormat = CCatalogDiscountConvert::GetCountFormat();
    if (false === $intCountFormat) {
        ShowError(GetMessage('CAT_DISC_FATAL_ERR'));
        require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
        die;
    }
    $intCountFormat = intval($intCountFormat);
    if ('Y' == $strChangeFormat || 0 >= $intCountFormat) {
        CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("CAT_DISC_CONVERT_COMPLETE"), "DETAILS" => GetMessage("ICAT_DISC_CONVERT_COMPLETE_ALL_OK"), "HTML" => true, "TYPE" => "OK"));
        CAdminNotify::DeleteByTag("CATALOG_DISC_FORMAT");
        COption::SetOptionString('catalog', 'discount_format', 'Y');
    }
    ?>
<div id="convert_result_div" style="margin:0;"></div>
	<form method="POST" action="<?php 
    echo $APPLICATION->GetCurPage();
    ?>
" name="fs1"><?php 
    $tabControl->Begin();
    $tabControl->BeginNextTab();
    $max_execution_time = intval(COption::GetOptionString("catalog", "max_execution_time", 10));
    if ($max_execution_time <= 0) {
        $max_execution_time = '';
    }
    ?>
コード例 #15
0
					if(BX('cat_disc_convert_finish') != null)
					{
						BX.closeWait();
						StopConvert();
					}
				}
			);
		}

		return false;
	}
	</script><?php 
    $intCountOld = CSaleDiscountConvert::GetCountOld();
    if (0 >= $intCountOld) {
        CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("SALE_DISC_CONVERT_COMPLETE"), "DETAILS" => GetMessage("SALE_DISC_CONVERT_COMPLETE_ALL_OK"), "HTML" => true, "TYPE" => "OK"));
        CAdminNotify::DeleteByTag("SALE_DISC_CONVERT");
    } elseif (1 < $intCountOld) {
        CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("SALE_DISC_CONVERT_DISABLE"), "DETAILS" => GetMessage("SALE_DISC_CONVERT_DISABLE_ALL"), "HTML" => true, "TYPE" => "OK"));
    }
    ?>
<div id="convert_result_div" style="margin:0;"></div>
	<form method="POST" action="<?php 
    echo $APPLICATION->GetCurPage();
    ?>
" name="fs1"><?php 
    $tabControl->Begin();
    $tabControl->BeginNextTab();
    $max_execution_time = intval(COption::GetOptionString("sale", "max_execution_time", 10));
    if ($max_execution_time <= 0) {
        $max_execution_time = '';
    }
コード例 #16
0
ファイル: index.php プロジェクト: mrdeadmouse/u136006
 function UnInstallDB($arParams = array())
 {
     global $APPLICATION, $DB, $errors;
     $this->errors = false;
     if (!$arParams['savedata']) {
         $this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/im/install/db/" . strtolower($DB->type) . "/uninstall.sql");
     }
     if (is_array($this->errors)) {
         $arSQLErrors = $this->errors;
     }
     if (!empty($arSQLErrors)) {
         $this->errors = $arSQLErrors;
         $APPLICATION->ThrowException(implode("", $arSQLErrors));
         return false;
     }
     CAdminNotify::DeleteByTag("IM_CONVERT");
     CAgent::RemoveAgent("CIMMail::MailNotifyAgent();", "im");
     CAgent::RemoveAgent("CIMMail::MailMessageAgent();", "im");
     CAgent::RemoveAgent("CIMDisk::RemoveTmpFileAgent();", "im");
     UnRegisterModuleDependences("im", "OnGetNotifySchema", "im", "CIMNotifySchema", "OnGetNotifySchema");
     UnRegisterModuleDependences("perfmon", "OnGetTableSchema", "im", "CIMTableSchema", "OnGetTableSchema");
     UnRegisterModuleDependences('main', 'OnAddRatingVote', 'im', 'CIMEvent', 'OnAddRatingVote');
     UnRegisterModuleDependences('main', 'OnUserDelete', 'im', 'CIMEvent', 'OnUserDelete');
     UnRegisterModuleDependences('main', 'OnCancelRatingVote', 'im', 'CIMEvent', 'OnCancelRatingVote');
     UnRegisterModuleDependences('main', 'OnAfterUserUpdate', 'im', 'CIMEvent', 'OnAfterUserUpdate');
     UnRegisterModuleDependences("pull", "OnGetDependentModule", "im", "CIMEvent", "OnGetDependentModule");
     UnRegisterModuleDependences("main", "OnProlog", "main", "", "", "/modules/im/ajax_hit.php");
     UnRegisterModuleDependences("main", "OnApplicationsBuildList", "im", "DesktopApplication", "OnApplicationsBuildList");
     UnRegisterModuleDependences('rest', 'OnRestServiceBuildDescription', 'im', 'CIMRestService', 'OnRestServiceBuildDescription');
     UnRegisterModule("im");
     return true;
 }
コード例 #17
0
ファイル: search.php プロジェクト: DarneoStudio/bitrix
 protected static function performAllTicketsIndexing($startFromId = 0, $timeLimit = 10, $removeOldIndex = false)
 {
     if (!static::CheckModule()) {
         return false;
     }
     $endTime = time() + $timeLimit;
     global $DB;
     $lastId = intval($startFromId);
     while (time() < $endTime) {
         $tickets = array();
         $messages = array();
         $result = $DB->Query($DB->TopSql("\n\t\t\t\tSELECT\n\t\t\t\t\tT.ID, T.SITE_ID, T.TITLE, TM.MESSAGE\n\t\t\t\tFROM\n\t\t\t\t\tb_ticket T,\n\t\t\t\t\tb_ticket_message TM\n\t\t\t\tWHERE\n\t\t\t\t\tTM.TICKET_ID = T.ID AND T.ID > " . $lastId . " AND TM.IS_LOG='N' AND IS_HIDDEN='N'\n\t\t\t\tORDER BY\n\t\t\t\t\tT.ID ASC", 100));
         while ($row = $result->Fetch()) {
             $tickets[$row['ID']] = $row;
             $messages[$row['ID']][] = array('MESSAGE' => $row['MESSAGE']);
             $endTicketId = $row['ID'];
         }
         // empty result
         if (empty($tickets)) {
             // set option allows to use new index
             COption::SetOptionString('support', 'SEARCH_VERSION', '12.0.3');
             // delete updater notification
             CAdminNotify::DeleteByTag('SUPORT_SEARCH_CONVERT_12_0_3');
             return -1;
         }
         // reselect last ticket's messages to complete them because of previous limit in query
         unset($messages[$endTicketId]);
         $result = $DB->Query("SELECT MESSAGE FROM b_ticket_message WHERE TICKET_ID = " . $endTicketId . " AND IS_LOG='N' AND IS_HIDDEN='N'");
         while ($row = $result->Fetch()) {
             $messages[$endTicketId][] = $row;
         }
         // remove old index
         if ($removeOldIndex) {
             $ticketIds = array_keys($tickets);
             $removeFromId = min($ticketIds);
             $removeToId = max($ticketIds);
             $DB->Query("DELETE FROM " . static::TABLE_NAME . " WHERE TICKET_ID >= " . $removeFromId . " AND TICKET_ID <= " . $removeToId);
         }
         // add new index
         foreach ($tickets as $ticket) {
             static::indexTicket($ticket, $messages[$ticket['ID']]);
             $lastId = $ticket['ID'];
         }
     }
     return $lastId;
 }
コード例 #18
0
ファイル: site_checker.php プロジェクト: nycmic/bittest
	function Start()
	{
		$this->test_percent = 100; // by default

		ob_start();
		try
		{
			$this->result = call_user_func(array($this,$this->function));
		}
		catch (Exception $e)
		{
			$this->Result(null, GetMessage("MAIN_SC_TEST_IS_INCORRECT"));
			echo $e->getMessage();
		}
		$this->strError = ob_get_clean();

		if (!$this->strResult)
			$this->Result($this->result);

		if (!$this->fix_mode)
		{
			// write to log
			if (@$this->OpenLog())
			{
				$text = date('Y-M-d H:i:s') . ' ' . $this->strCurrentTestName . ' (' . $this->function . "): " . $this->LogResult . "\n";
				if ($this->test_percent < 100)
					$text .= $this->test_percent.'% done' . "\n";

				if ($this->strError)
				{
					$text .= str_replace('<br>', "\n", $this->strError)."\n";
				}

				if ($this->test_percent >= 100) // test finished
					$text .= preg_replace('#<[^<>]+>#','',$this->strResult)."\n";

				$text = htmlspecialchars_decode($text);

				fwrite($this->LogResourse, $text);
			}
		}

		$this->last_function = $this->function;
		$this->percent = floor(($this->step + $this->test_percent / 100) / count($this->arTest) * 100);

		if ($this->test_percent >= 100) // test finished
		{
			if ($this->step + 1 < count($this->arTest))
			{
				$this->step++;
				$this->test_percent = 0;
				$this->arTestVars['last_value'] = '';
				list($this->function, $this->strNextTestName) = each($this->arTest[$this->step]);
			}
			else // finish
			{
				if (!$this->fix_mode) // if we have a kernel
				{
					COption::SetOptionString('main', 'site_checker_success', $this->arTestVars['site_checker_success']);
					CEventLog::Add(array(
						"SEVERITY" => "WARNING",
						"AUDIT_TYPE_ID" => $this->arTestVars['site_checker_success'] == 'Y' ? 'SITE_CHECKER_SUCCESS' : 'SITE_CHECKER_ERROR',
						"MODULE_ID" => "main",
						"ITEM_ID" => $_SERVER['DOCUMENT_ROOT'],
						"DESCRIPTION" => '',
					));
					if ($this->arTestVars['site_checker_success'] == 'Y')
						CAdminNotify::DeleteByTag('SITE_CHECKER');
				}
			}
		}
		elseif ($this->result === true)
			$this->strResult = ''; // in case of temporary result on this step

		if ($this->result === false)
			$this->arTestVars['site_checker_success'] = 'N';
	}
コード例 #19
0
					if(BX('cat_disc_convert_finish') != null)
					{
						BX.closeWait();
						StopConvert();
					}
				}
			);
		}

		return false;
	}
	</script><?php 
    $intCountOld = CCatalogDiscountConvert::GetCountOld();
    if ($intCountOld <= 0) {
        CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("CAT_DISC_CONVERT_COMPLETE"), "DETAILS" => GetMessage("ICAT_DISC_CONVERT_COMPLETE_ALL_OK"), "HTML" => true, "TYPE" => "OK"));
        CAdminNotify::DeleteByTag("CATALOG_DISC_CONVERT");
    }
    ?>
<div id="convert_result_div" style="margin:0;"></div>
	<form method="POST" action="<?php 
    echo $APPLICATION->GetCurPage();
    ?>
" name="fs1"><?php 
    $tabControl->Begin();
    $tabControl->BeginNextTab();
    $max_execution_time = intval(COption::GetOptionString("catalog", "max_execution_time", 10));
    if ($max_execution_time <= 0) {
        $max_execution_time = '';
    }
    ?>
		<tr>
コード例 #20
0
 public static function CheckUploaderType($type = "")
 {
     if ($GLOBALS["USER"]->CanDoOperation('edit_php')) {
         if ($type != "form") {
             CAdminNotify::Add(array("MESSAGE" => GetMessage("P_UPLOADER_TYPE_NOTIFY"), "TAG" => "PHOTOGALLERY_UPLOADER", "MODULE_ID" => "PHOTOGALLERY"));
         } else {
             CAdminNotify::DeleteByTag("PHOTOGALLERY_UPLOADER");
         }
     }
 }
コード例 #21
0
ファイル: convert.php プロジェクト: Hawkart/megatv
    ShowError(\Bitrix\Main\Localization\Loc::getMessage("MAIN_MODULE_NOT_INSTALLED"));
}
IncludeModuleLangFile(__FILE__);
$POST_RIGHT = $APPLICATION->GetGroupRight("sender");
if ($POST_RIGHT <= "R") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
if ($REQUEST_METHOD == "POST" && $POST_RIGHT == "W" && check_bitrix_sessid()) {
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_js.php";
    CounterCalculation::$maxExecutionTime = intval($max_execution_time);
    if ($do_not_run == 'Y' || CounterCalculation::update()) {
        $messageProgress = GetMessage("sender_convert_status_run");
        ?>
<script>started = true; MoveProgress();</script><?php 
    } else {
        CAdminNotify::DeleteByTag('sender_counters_16');
        $messageProgress = GetMessage("sender_convert_status_done");
        ?>
<script>EndConvert();</script><?php 
    }
    $completedPercents = CounterCalculation::getCompletedPercent();
    $currentStep = $completedPercents['CURRENT'];
    $stepsCount = $completedPercents['ALL'];
    $message = array("MESSAGE" => GetMessage("sender_convert_status_title"), "DETAILS" => $messageProgress . '#PROGRESS_BAR#', "HTML" => true, "TYPE" => "PROGRESS", "PROGRESS_TOTAL" => $stepsCount, "PROGRESS_VALUE" => $currentStep, "BUTTONS" => array());
    $adminMessage = new CAdminMessage($message);
    echo $adminMessage->show();
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin_js.php";
}
$APPLICATION->SetTitle(GetMessage("sender_convert_title"));
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("sender_convert_tab_convert_name"), "ICON" => "main_user_edit", "TITLE" => GetMessage("sender_convert_tab_convert_title")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);