function InstallDB($install_wizard = true) { global $DB, $DBType, $APPLICATION; $errors = null; if (!$DB->Query("SELECT 'x' FROM b_disk_storage", true)) { $errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/disk/install/db/" . $DBType . "/install.sql"); } $this->InstallTasks(); if (!empty($errors)) { $APPLICATION->ThrowException(implode("", $errors)); return false; } $isWebdavInstalled = isModuleInstalled('webdav'); $this->RegisterModuleDependences(!$isWebdavInstalled); RegisterModule("disk"); $this->InstallUserFields(); /** @noinspection PhpDynamicAsStaticMethodCallInspection */ CAgent::addAgent('\\Bitrix\\Disk\\ExternalLink::removeExpiredWithTypeAuto();', 'disk', 'N'); /** @noinspection PhpDynamicAsStaticMethodCallInspection */ CAgent::addAgent('\\Bitrix\\Disk\\Bitrix24Disk\\UploadFileManager::removeIrrelevant();', 'disk', 'N'); if (!$isWebdavInstalled) { require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/disk/lib/configuration.php"; \Bitrix\Main\Config\Option::set('disk', 'successfully_converted', 'Y'); \Bitrix\Main\Config\Option::set('disk', 'disk_revision_api', \Bitrix\Disk\Configuration::REVISION_API); } else { \CAdminNotify::add(array("MESSAGE" => Loc::getMessage("DISK_NOTIFY_MIGRATE_WEBDAV", array("#LINK#" => "/bitrix/admin/disk_from_webdav_convertor.php?lang=" . \Bitrix\Main\Application::getInstance()->getContext()->getLanguage())), "TAG" => "disk_migrate_from_webdav", "MODULE_ID" => "disk", "ENABLE_CLOSE" => "N")); } return true; }
/** * * @param string &$content * @return void * */ public function OnEndBufferContent(&$content) { if (isset($_GET["nocdn"])) { return; } self::$proto = CMain::IsHTTPS() ? "https" : "http"; self::$config = CBitrixCloudCDNConfig::getInstance()->loadFromOptions(); if (self::$config->isExpired()) { if (self::$config->lock()) { try { try { $delayExpiration = true; 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; } } } if (!self::$config->isActive()) { return false; } $sites = self::$config->getSites(); if (defined("ADMIN_SECTION")) { if (!isset($sites["admin"])) { return; } } elseif (defined("SITE_ID")) { if (!isset($sites[SITE_ID])) { return; } } else { return; } self::$ajax = preg_match("/<head>/i", substr($content, 0, 512)) === 0; $arPrefixes = array_map(array("CBitrixCloudCDN", "_preg_quote"), self::$config->getLocationsPrefixes()); $arExtensions = array_map(array("CBitrixCloudCDN", "_preg_quote"), self::$config->getLocationsExtensions()); if (!empty($arPrefixes) && !empty($arExtensions)) { $prefix_regex = "(?:" . implode("|", $arPrefixes) . ")"; $extension_regex = "(?:" . implode("|", $arExtensions) . ")"; $regex = "/\n\t\t\t\t((?i:\n\t\t\t\t\thref=\n\t\t\t\t\t|src=\n\t\t\t\t\t|BX\\.loadCSS\\(\n\t\t\t\t\t|BX\\.loadScript\\(\n\t\t\t\t\t|jsUtils\\.loadJSFile\\(\n\t\t\t\t\t|background\\s*:\\s*url\\(\n\t\t\t\t)) #attribute\n\t\t\t\t(\"|') #open_quote\n\t\t\t\t(" . $prefix_regex . ") #prefix\n\t\t\t\t([^?'\"]+\\.) #href body\n\t\t\t\t(" . $extension_regex . ") #extension\n\t\t\t\t(|\\?\\d+|\\?v=\\d+) #params\n\t\t\t\t(\\2) #close_quote\n\t\t\t/x"; $content = preg_replace_callback($regex, array("CBitrixCloudCDN", "_filter"), $content); } }
public function DoInstall() { if (IsModuleInstalled('sale')) { global $APPLICATION; $this->InstallFiles(); RegisterModule($this->MODULE_ID); return true; } $MODULE_ID = $this->MODULE_ID; $TAG = 'VWS'; $MESSAGE = GetMessage('LP_ERR_MODULE_NOT_FOUND', array('#MODULE#' => 'sale')); $intID = CAdminNotify::Add(compact('MODULE_ID', 'TAG', 'MESSAGE')); return false; }
public static function hideNotifier() { \CAdminNotify::DeleteByTag(self::NOTIF_TAG); }
<?php define("NO_KEEP_STATISTIC", true); define("NO_AGENT_STATISTIC", true); define("NOT_CHECK_PERMISSIONS", true); require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php"; if ($USER->IsAdmin() && isset($_POST["ID"]) && check_bitrix_sessid()) { CAdminNotify::Delete(intval($_POST["ID"])); } echo "OK"; require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_admin_after.php";
function GetPanelHtml() { global $USER, $APPLICATION, $adminPage; if ($APPLICATION->ShowPanel === false || !$USER->IsAuthorized() && $APPLICATION->ShowPanel !== true) { return ""; } CTopPanel::InitPanelIcons(); $arPanelButtons =& $APPLICATION->arPanelButtons; $bShowPanel = false; foreach ($arPanelButtons as $arValue) { if (trim($arValue["HREF"]) != "" || is_array($arValue["MENU"]) && !empty($arValue["MENU"])) { //we have at least one button to show $bShowPanel = true; break; } } if ($bShowPanel == false) { $bShowPanel = self::IsShownForUser(); } if ($bShowPanel == false && $APPLICATION->ShowPanel !== true) { return ""; } $APPLICATION->PanelShowed = true; if (isset($_GET["back_url_admin"]) && $_GET["back_url_admin"] != "" && strpos($_GET["back_url_admin"], "/") === 0) { $_SESSION["BACK_URL_ADMIN"] = $_GET["back_url_admin"]; } $aUserOpt = CUserOptions::GetOption("admin_panel", "settings"); $aUserOptGlobal = CUserOptions::GetOption("global", "settings"); $toggleModeSet = false; if (isset($_GET["freetrix_include_areas"]) && $_GET["freetrix_include_areas"] != "") { $APPLICATION->SetShowIncludeAreas($_GET["freetrix_include_areas"] == "Y"); $toggleModeSet = true; } $params = DeleteParam(array("freetrix_include_areas", "freetrix_show_mode", "back_url_admin")); $href = $APPLICATION->GetCurPage(); $hrefEnc = htmlspecialcharsbx($href); $toggleModeDynamic = $aUserOptGlobal['panel_dynamic_mode'] == 'Y'; $toggleMode = $toggleModeDynamic && !$toggleModeSet ? $aUserOpt['edit'] == 'on' : $APPLICATION->GetShowIncludeAreas() == 'Y'; //Save if changed $old_edit = $aUserOpt['edit']; $aUserOpt['edit'] = $toggleMode ? 'on' : 'off'; if ($old_edit !== $aUserOpt['edit']) { CUserOptions::SetOption('admin_panel', 'settings', $aUserOpt); } $toggleModeLink = $hrefEnc . '?freetrix_include_areas=' . ($toggleMode ? 'N' : 'Y') . ($params != "" ? "&" . htmlspecialcharsbx($params) : ""); $result = CTopPanel::ShowPanelScripts(true); $result .= ' <!--[if lte IE 7]> <style type="text/css">#bx-panel {display:none !important;}</style> <div id="bx-panel-error">' . GetMessage("top_panel_browser") . '</div><![endif]--> <script type="text/javascript">BX.admin.dynamic_mode=' . ($toggleModeDynamic ? 'true' : 'false') . '; BX.admin.dynamic_mode_show_borders = ' . ($toggleMode ? 'true' : 'false') . ';</script> <div style="display:none; overflow:hidden;" id="bx-panel-back"></div> <div id="bx-panel"' . ($aUserOpt["collapsed"] == "on" ? ' class="bx-panel-folded"' : '') . '> <div id="bx-panel-top"> <div id="bx-panel-top-gutter"></div> <div id="bx-panel-tabs"> '; $result .= ' <a id="bx-panel-menu" href="" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_start_menu_tooltip_title'), GetMessage('top_panel_start_menu_tooltip')) . '><span id="bx-panel-menu-icon"></span><span id="bx-panel-menu-text">' . GetMessage("top_panel_menu") . '</span></a><a id="bx-panel-view-tab"><span>' . GetMessage("top_panel_site") . '</span></a><a id="bx-panel-admin-tab" href="' . (isset($_SESSION["BACK_URL_ADMIN"]) && $_SESSION["BACK_URL_ADMIN"] != "" ? htmlspecialcharsbx($_SESSION["BACK_URL_ADMIN"]) . (strpos($_SESSION["BACK_URL_ADMIN"], "?") !== false ? "&" : "?") : '/freetrix/admin/index.php?lang=' . LANGUAGE_ID . '&') . 'back_url_pub=' . urlencode($href . ($params != "" ? "?" . $params : "")) . '"><span>' . GetMessage("top_panel_admin") . '</span></a>'; $back_url = CUtil::JSUrlEscape(CUtil::addslashes($href . ($params != "" ? "?" . $params : ""))); $arStartMenuParams = array('DIV' => 'bx-panel-menu', 'ACTIVE_CLASS' => 'bx-pressed', 'MENU_URL' => '/freetrix/admin/get_start_menu.php?lang=' . LANGUAGE_ID . '&back_url_pub=' . urlencode($back_url) . '&' . freetrix_sessid_get(), 'MENU_PRELOAD' => $aUserOptGlobal["start_menu_preload"] == 'Y'); $result .= '<script type="text/javascript">BX.message({MENU_ENABLE_TOOLTIP: ' . ($aUserOptGlobal['start_menu_title'] != 'N' ? 'true' : 'false') . '}); new BX.COpener(' . CUtil::PhpToJsObject($arStartMenuParams) . ');</script>'; $hkInstance = CHotKeys::getInstance(); $Execs = $hkInstance->GetCodeByClassName("top_panel_menu", GetMessage("top_panel_menu")); $result .= $hkInstance->PrintJSExecs($Execs); $Execs = $hkInstance->GetCodeByClassName("top_panel_admin", GetMessage("top_panel_admin")); $result .= $hkInstance->PrintJSExecs($Execs); if ($USER->CanDoOperation("cache_control")) { $result .= '<a id="bx-panel-clear-cache" href="" onclick="BX.clearCache(); return false;"><span id="bx-panel-clear-cache-icon"></span><span id="bx-panel-clear-cache-text">' . GetMessage("top_panel_cache_new_tooltip_title") . '</span></a>'; } $result .= ' </div> <div id="bx-panel-userinfo"> '; $bCanProfile = $USER->CanDoOperation('view_own_profile') || $USER->CanDoOperation('edit_own_profile'); $userName = CUser::FormatName(CSite::GetNameFormat(false), array("NAME" => $USER->GetFirstName(), "LAST_NAME" => $USER->GetLastName(), "SECOND_NAME" => $USER->GetSecondName(), "LOGIN" => $USER->GetLogin()), $bUseLogin = true, $bHTMLSpec = true); if ($bCanProfile) { $result .= '<a href="/freetrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $USER->GetID() . '" id="bx-panel-user" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_profile_tooltip')) . '><span id="bx-panel-user-icon"></span><span id="bx-panel-user-text">' . $userName . '</span></a>'; } else { $result .= '<a id="bx-panel-user"><span id="bx-panel-user-icon"></span><span id="bx-panel-user-text">' . $userName . '</span></a>'; } $result .= '<a href="' . $hrefEnc . '?logout=yes' . htmlspecialcharsbx(($s = DeleteParam(array("logout"))) == "" ? "" : "&" . $s) . '" id="bx-panel-logout" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_logout_tooltip') . $hkInstance->GetTitle("bx-panel-logout", true)) . '>' . GetMessage("top_panel_logout") . '</a>'; $toggleCaptionOn = '<span id="bx-panel-toggle-caption-mode-on">' . GetMessage("top_panel_on") . '</span>'; $toggleCaptionOff = '<span id="bx-panel-toggle-caption-mode-off">' . GetMessage("top_panel_off") . '</span>'; $toggleCaptions = $toggleMode ? $toggleCaptionOn . $toggleCaptionOff : $toggleCaptionOff . $toggleCaptionOn; $toogle = '<a href="' . $toggleModeLink . '" id="bx-panel-toggle" class="bx-panel-toggle' . ($toggleMode ? '-on' : '-off') . '"' . ($toggleModeDynamic ? '' : ' ' . CTopPanel::AddAttrHint(GetMessage("top_panel_edit_mode_new_tooltip_title"), GetMessage('top_panel_toggle_tooltip') . $hkInstance->GetTitle("bx-panel-small-toggle", true))) . '><span id="bx-panel-switcher-gutter-left"></span><span id="bx-panel-toggle-indicator"><span id="bx-panel-toggle-icon"></span><span id="bx-panel-toggle-icon-overlay"></span></span><span class="bx-panel-break"></span><span id="bx-panel-toggle-caption">' . GetMessage("top_panel_edit_mode_new") . '</span><span class="bx-panel-break"></span><span id="bx-panel-toggle-caption-mode">' . $toggleCaptions . '</span><span id="bx-panel-switcher-gutter-right"></span></a>'; if ($aUserOpt["collapsed"] == "on") { $result .= $toogle; } $result .= '<a href="" id="bx-panel-expander" ' . CTopPanel::AddAttrHint(GetMessage("top_panel_expand_tooltip_title"), GetMessage("top_panel_expand_tooltip") . $hkInstance->GetTitle("bx-panel-expander", true)) . '><span id="bx-panel-expander-text">' . GetMessage("top_panel_expand") . '</span><span id="bx-panel-expander-arrow"></span></a>'; if ($hkInstance->IsActive()) { $result .= '<a id="bx-panel-hotkeys" href="javascript:void(0)" onclick="BXHotKeys.ShowSettings();" ' . CTopPanel::AddAttrHint(GetMessage("HK_PANEL_TITLE") . $hkInstance->GetTitle("bx-panel-hotkeys", true)) . '></a>'; } $result .= '<a href="javascript:void(0)" id="bx-panel-pin"' . ($aUserOpt['fix'] == 'on' ? ' class="bx-panel-pin-fixed"' : '') . ' ' . CTopPanel::AddAttrHint(GetMessage('top_panel_pin_tooltip')) . '></a>'; $Execs = $hkInstance->GetCodeByClassName("bx-panel-logout", GetMessage('top_panel_logout_tooltip')); $result .= $hkInstance->PrintJSExecs($Execs); $Execs = $hkInstance->GetCodeByClassName("bx-panel-small-toggle", GetMessage("top_panel_edit_mode_new_tooltip_title"), 'location.href="' . $href . '?freetrix_include_areas=' . ($toggleMode ? 'N' : 'Y') . ($params != "" ? "&" . $params : "") . '";'); $result .= $hkInstance->PrintJSExecs($Execs); $Execs = $hkInstance->GetCodeByClassName("bx-panel-expander", GetMessage("top_panel_expand_tooltip_title") . "/" . GetMessage("top_panel_collapse_tooltip_title")); $result .= $hkInstance->PrintJSExecs($Execs); $result .= ' </div> </div> '; /* BUTTONS */ $result .= '<div id="bx-panel-site-toolbar"><div id="bx-panel-buttons-gutter"></div><div id="bx-panel-switcher">'; if ($aUserOpt["collapsed"] != "on") { $result .= $toogle; } $result .= '<a href="" id="bx-panel-hider" ' . CTopPanel::AddAttrHint(GetMessage("top_panel_collapse_tooltip_title"), GetMessage("top_panel_collapse_tooltip") . $hkInstance->GetTitle("bx-panel-expander", true)) . '>' . GetMessage("top_panel_collapse") . '<span id="bx-panel-hider-arrow"></span></a>'; $result .= '</div><div id="bx-panel-buttons"><div id="bx-panel-buttons-inner">'; $main_sort = ""; $last_btn_type = ''; $last_btn_small_cnt = 0; $groupId = -1; $result .= '<span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">'; sortByColumn($arPanelButtons, array("MAIN_SORT" => SORT_ASC, "SORT" => SORT_ASC)); foreach ($arPanelButtons as $key => $arButton) { $result .= $hkInstance->PrintTPButton($arButton); if ($main_sort != $arButton["MAIN_SORT"] && $main_sort != "") { $result .= '</span><span class="bx-panel-button-separator"></span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">'; $last_btn_small_cnt = 0; } if (!isset($arButton['TYPE']) || $arButton['TYPE'] != 'BIG') { $arButton['TYPE'] = 'SMALL'; } //very old behaviour if (is_set($arButton, "SRC_0")) { $arButton["SRC"] = $arButton["SRC_0"]; } $arButton['HREF'] = isset($arButton['HREF']) ? trim($arButton['HREF']) : ''; $bHasAction = $arButton['HREF'] != ''; if (array_key_exists("RESORT_MENU", $arButton) && $arButton["RESORT_MENU"] === true && is_array($arButton['MENU']) && !empty($arButton['MENU'])) { sortByColumn($arButton['MENU'], "SORT", '', PHP_INT_MAX); } $bHasMenu = is_array($arButton['MENU']) && count($arButton['MENU']) > 0; if ($bHasMenu && !$bHasAction) { foreach ($arButton['MENU'] as $arItem) { if (isset($arItem['DEFAULT']) && $arItem['DEFAULT']) { $arButton['HREF'] = $arItem['HREF']; $bHasAction = true; } } } if ($last_btn_type != '' && $arButton['TYPE'] != $last_btn_type && $main_sort == $arButton["MAIN_SORT"]) { $result .= '</span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">'; $last_btn_small_cnt = 0; } if ($bHasAction && substr(strtolower($arButton['HREF']), 0, 11) == 'javascript:') { $arButton['ONCLICK'] = substr($arButton['HREF'], 11); $arButton['HREF'] = 'javascript:void(0)'; } if ($arButton['HINT']) { if (isset($arButton['HINT']['ID']) && $arButton['HINT']['ID']) { $hintOptions = CUtil::GetPopupOptions($arButton['HINT']['ID']); if ($hintOptions['display'] == 'off') { unset($arButton['HINT']); } } if ($arButton['HINT']) { unset($arButton['ALT']); } if ($bHasMenu && (!isset($arButton['HINT_MENU']) || !$arButton['HINT_MENU'])) { $arButton['HINT']['TARGET'] = 'parent'; } } $title = isset($arButton['ALT']) ? htmlspecialcharsbx($arButton['ALT']) : ''; $onClick = isset($arButton['ONCLICK']) ? htmlspecialcharsbx($arButton['ONCLICK']) : ''; $onClickJs = isset($arButton['ONCLICK']) ? CUtil::JSEscape($arButton['ONCLICK']) : ''; $hintMenu = isset($arButton['HINT_MENU']) ? CUtil::PhpToJsObject($arButton['HINT_MENU']) : ''; switch ($arButton['TYPE']) { case 'SMALL': if ($last_btn_small_cnt >= 3 && $main_sort == $arButton["MAIN_SORT"]) { $result .= '</span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">'; $last_btn_small_cnt = 0; } elseif ($last_btn_small_cnt > 0) { $result .= '<span class="bx-panel-break"></span>'; } $result .= '<span class="bx-panel-small-button"><span class="bx-panel-small-button-inner">'; $button_icon = '<span class="bx-panel-small-button-icon' . ($arButton['ICON'] ? ' ' . $arButton['ICON'] : '') . '"' . (isset($arButton['SRC']) && $arButton['SRC'] ? ' style="background: scroll transparent url(' . htmlspecialcharsbx($arButton['SRC']) . ') no-repeat center center !important;"' : '') . '></span>'; $button_text = '<span class="bx-panel-small-button-text">' . htmlspecialcharsbx($arButton['TEXT']) . '</span>'; $button_text_js = CUtil::JSEscape($arButton['TEXT']); if ($bHasAction) { $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-active\')" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . $hkInstance->GetTitle("bx_topmenu_btn_" . $key) . '"' : '"' . $hkInstance->GetTitle("bx_topmenu_btn_" . $key) . '"') . '>' . $button_icon . $button_text . '</a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'SMALL\', ACTIVE_CSS: \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-active\', HOVER_CSS: \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', SKIP : ' . ($bHasMenu ? "true" : "false") . ', LINK: "' . CUtil::JSEscape($arButton['HREF']) . '", ACTION : "' . $onClickJs . '",TEXT : "' . $button_text_js . '" })</script>'; if ($bHasMenu) { $result .= '<a href="javascript:void(0)" class="bx-panel-small-button-arrow" id="bx_topmenu_btn_' . $key . '_menu"><span class="bx-panel-small-button-arrow"></span></a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'SMALL\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-small-button-arrow-active\', HOVER_CSS: \'bx-panel-small-button-arrow-hover\'' . ($hintMenu ? ', HINT: ' . $hintMenu : '') . ', GROUP_ID : ' . $groupId . ', TEXT : "' . $button_text_js . '"})</script>'; } } elseif ($bHasMenu) { $result .= '<a href="javascript:void(0)" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . $button_text . '<span class="bx-panel-small-single-button-arrow"></span></a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'SMALL\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-small-button-active\', HOVER_CSS: \'bx-panel-small-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', TEXT : "' . $button_text_js . '"})</script>'; } $result .= '</span></span>'; $last_btn_small_cnt++; break; case 'BIG': $last_btn_small_cnt = 0; $result .= '<span class="bx-panel-button"><span class="bx-panel-button-inner">'; $button_icon = '<span class="bx-panel-button-icon' . ($arButton['ICON'] ? ' ' . $arButton['ICON'] : '') . '"' . (isset($arButton['SRC']) && $arButton['SRC'] ? ' style="background: scroll transparent url(' . htmlspecialcharsbx($arButton['SRC']) . ') no-repeat center center !important;"' : '') . '></span>'; $button_text_js = CUtil::JSEscape(str_replace('#BR#', ' ', $arButton['TEXT'])); if ($bHasAction && $bHasMenu) { $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . ' <span class="bx-panel-button-arrow"></span></span>'; $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-button-icon-active\');" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . '</a><a id="bx_topmenu_btn_' . $key . '_menu" href="javascript:void(0)">' . $button_text . '</a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'BIG\', ACTIVE_CSS: \'bx-panel-button-icon-active\', HOVER_CSS: \'bx-panel-button-icon-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', SKIP : true }); BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'BIG\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-button-text-active\', HOVER_CSS: \'bx-panel-button-text-hover\'' . ($hintMenu ? ', HINT: ' . $hintMenu : '') . ', GROUP_ID : ' . $groupId . ', TEXT : "' . $button_text_js . '"})</script>'; } else { if ($bHasAction) { $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . '</span>'; $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-button-active\');" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . $button_text . '</a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'BIG\', ACTIVE_CSS: \'bx-panel-button-active\', HOVER_CSS: \'bx-panel-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', LINK: "' . CUtil::JSEscape($arButton['HREF']) . '", ACTION : "' . $onClickJs . '", TEXT : "' . $button_text_js . '"});</script>'; } else { $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . ' <span class="bx-panel-button-arrow"></span></span>'; $result .= '<a href="javascript:void(0)" id="bx_topmenu_btn_' . $key . '_menu">' . $button_icon . $button_text . '</a>'; $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'BIG\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-button-active\', HOVER_CSS: \'bx-panel-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', TEXT : "' . $button_text_js . '"});</script>'; } } $result .= '</span></span>'; break; } $main_sort = $arButton["MAIN_SORT"]; $last_btn_type = $arButton['TYPE']; } $result .= '</span>'; $result .= '</div> </div> </div>'; if ($USER->IsAdmin()) { $result .= CAdminNotify::GetHtml(); } $result .= ' </div> '; $result .= '<script type="text/javascript"> BX.admin.panel.state = { fixed: ' . ($aUserOpt["fix"] == "on" ? 'true' : 'false') . ', collapsed: ' . ($aUserOpt["collapsed"] == "on" ? 'true' : 'false') . ' } BX.admin.moreButton.init({ buttonTitle : "' . GetMessageJS("top_panel_more_button_title") . '"}); </script>'; //start menu preload // if($aUserOptGlobal["start_menu_preload"] == 'Y') // $result .= '<script type="text/javascript">BX.ready(function(){jsStartMenu.PreloadMenu(\''.CUtil::JSEscape($href.($params<>""? "?".$params:"")).'\');});</script>'; //show script to play sound $result .= $adminPage->ShowSound(); return $result; }
/** * Adds admin users notification about index rebuild. * * @param boolean $force Whenever skip iblock check. * * @return void */ public static function checkAdminNotification($force = false) { if ($force) { $add = true; } else { $iblockList = \Bitrix\Iblock\IblockTable::getList(array('select' => array('ID'), 'filter' => array('=PROPERTY_INDEX' => 'I'))); $add = $iblockList->fetch() ? true : false; } if ($add) { $notifyList = \CAdminNotify::getList(array(), array("TAG" => "iblock_property_reindex")); if (!$notifyList->fetch()) { \CAdminNotify::add(array("MESSAGE" => Loc::getMessage("IBLOCK_NOTIFY_PROPERTY_REINDEX", array("#LINK#" => "/bitrix/admin/iblock_reindex.php?lang=" . \Bitrix\Main\Application::getInstance()->getContext()->getLanguage())), "TAG" => "iblock_property_reindex", "MODULE_ID" => "iblock", "ENABLE_CLOSE" => "Y", "PUBLIC_SECTION" => "N")); } } else { \CAdminNotify::deleteByTag("iblock_property_reindex"); } }
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; }
} 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 = ''; } ?>
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();
<?php $tabControl->End(); ?> </form> <h2><?php echo GetMessage("SALE_SYSTEM_PROCEDURES"); ?> </h2> <?php $showbasketDiscountConvert = (string) Main\Config\Option::get('sale', 'basket_discount_converted') != 'Y' && Main\ModuleManager::isModuleInstalled('catalog'); if ($showbasketDiscountConvert) { if (CSaleBasketDiscountConvert::getAllCounter() == 0) { $adminNotifyIterator = CAdminNotify::GetList(array(), array('MODULE_ID' => 'sale', 'TAG' => 'BASKET_DISCOUNT_CONVERTED')); if ($adminNotifyIterator) { if ($adminNotify = $adminNotifyIterator->Fetch()) { CAdminNotify::Delete($adminNotify['ID']); } unset($adminNotify); } unset($adminNotifyIterator); $showbasketDiscountConvert = false; } } $systemTabs[] = array('DIV' => 'saleSysTabReindex', 'TAB' => GetMessage('SALE_SYSTEM_TAB_REINDEX'), 'ICON' => 'sale_settings', 'TITLE' => GetMessage('SALE_SYSTEM_TAB_REINDEX_TITLE')); if ($showbasketDiscountConvert) { $systemTabs[] = array('DIV' => 'saleSysTabConvert', 'TAB' => GetMessage('SALE_SYSTEM_TAB_CONVERT'), 'ICON' => 'sale_settings', 'TITLE' => GetMessage('SALE_SYSTEM_TAB_CONVERT_TITLE')); } $systemTabControl = new CAdminTabControl('saleSysTabControl', $systemTabs, true, true); $systemTabControl->Begin(); $systemTabControl->BeginNextTab(); ?>
static function showAlarmMessage() { $tag = "PAY_SYSTEM_ACTION_ALARM"; $dbRes = CAdminNotify::GetList(array(), array("TAG" => $tag)); if ($res = $dbRes->Fetch()) { return false; } return CAdminNotify::Add(array("MESSAGE" => GetMessage("SKGPSA_ALARM_MESSAGE", array("#LANGUAGE_ID#" => LANGUAGE_ID)), "TAG" => $tag, "MODULE_ID" => "SALE", "ENABLE_CLOSE" => "Y", "TYPE" => CAdminNotify::TYPE_ERROR)); }
$arFields = array( "MESSAGE" => str_replace("#LINK#", '/bitrix/admin/cat_discount_convert.php', $arMess['BT_MOD_CAT_DSC_CONV_INVITE'][$strDefLang]), "TAG" => "CATALOG_DISC_CONVERT", "MODULE_ID" => "catalog", "ENABLE_CLOSE" => "N" ); $arLangMess = array(); foreach ($arMess['BT_MOD_CAT_DSC_CONV_INVITE'] as $strLangID => $strMess) { if (empty($strMess)) continue; $arLangMess[$strLangID] = str_replace("#LINK#", '/bitrix/admin/cat_discount_convert.php', $strMess); } if (!empty($arLangMess)) $arFields['LANG'] = $arLangMess; CAdminNotify::Add($arFields); } } } } } if ($bVarsFromForm) { if ($boolCondParseError) { $mxTempo = $arDiscount['CONDITIONS']; $arDiscount = $arFields; $arDiscount['CONDITIONS'] = $mxTempo; unset($mxTempo); }
foreach ($propertyValues as $propertyValue) { $variantIdId = $list[$propertyValue['value']]; $valuesToElements[$propertyValue['id_element']][] = $variantIdId; } foreach ($valuesToElements as $elementId => $elementValues) { $iblockElement->SetPropertyValuesEx($elementId, $idIBlock, array($idProperty => $elementValues)); } return true; }; if ($_POST['apply'] == 'Применить') { $iblockID = intval($_POST['selectIblocks']); $propertyID = intval($_POST['selectProperties']); $newTypeIBlock = $_POST['new-type-property-info-block']; $conversionResult = $conversionProperty($propertyID, $iblockID, $newTypeIBlock); $conversionResult && CAdminNotify::Add(array('MESSAGE' => 'Конвертация прошла успешно', 'TAG' => 'save_property_notify', 'MODULE_ID' => 'ws.tools', 'ENABLE_CLOSE' => 'Y')); !$conversionResult && CAdminNotify::Error(array('MESSAGE' => 'Конвертация не прошла успешно', 'TAG' => 'save_property_notify_error', 'MODULE_ID' => 'ws.tools', 'ENABLE_CLOSE' => 'Y')); } require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php"; $jsParams = array(); $types = array(); $rsTypes = \Bitrix\Iblock\TypeLanguageTable::getList(array('filter' => array('LANGUAGE_ID' => LANG))); while ($type = $rsTypes->fetch()) { $types[$type['IBLOCK_TYPE_ID']] = $type['NAME']; } $jsParams['types'] = array('name' => 'selectTypes', 'list' => $types); $iblocks = array(); $rsIblocks = \Bitrix\Iblock\IblockTable::getList(); while ($iblock = $rsIblocks->fetch()) { $iblocks[$iblock['ID']] = array('name' => $iblock['NAME'], 'type' => $iblock['IBLOCK_TYPE_ID']); } $jsParams['iblocks'] = array('name' => 'selectIblocks', 'list' => $iblocks);
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; }
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; }
} 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();
/** * Checking all forms for spam * @return null|boolean NULL when success or FALSE when spam detected */ public function OnPageStartHandler() { global $APPLICATION, $USER; if (!is_object($USER)) { $USER = new CUser(); } $ct_status = COption::GetOptionString('cleantalk.antispam', 'status', '0'); $ct_global = COption::GetOptionString('cleantalk.antispam', 'form_global_check', '0'); $key = COption::GetOptionString('cleantalk.antispam', 'key', ''); $last_checked = COption::GetOptionString('cleantalk.antispam', 'last_checked', 0); $last_status = COption::GetOptionString('cleantalk.antispam', 'is_paid', 0); $new_checked = time(); $is_sfw = COption::GetOptionString('cleantalk.antispam', 'form_sfw', 0); $sfw_last_updated = COption::GetOptionString('cleantalk.antispam', 'sfw_last_updated', 0); if ($is_sfw == 1 && time() - $sfw_last_updated > 10) { global $DB; $data = array('auth_key' => $key, 'method_name' => '2s_blacklists_db'); $result = CleantalkAntispam::CleantalkSendRequest('https://api.cleantalk.org/2.1', $data, false); $result = json_decode($result, true); if (isset($result['data'])) { $result = $result['data']; $query = "INSERT INTO `" . $wpdb->base_prefix . "cleantalk_sfw` VALUES "; //$wpdb->query("TRUNCATE TABLE `".$wpdb->base_prefix."cleantalk_sfw`;"); for ($i = 0; $i < sizeof($result); $i++) { if ($i == sizeof($result) - 1) { $query .= "(" . $result[$i][0] . "," . $result[$i][1] . ");"; } else { $query .= "(" . $result[$i][0] . "," . $result[$i][1] . "), "; } } $DB->Query($query); } include_once "cleantalk-sfw.class.php"; $sfw = new CleanTalkSFW(); $sfw->send_logs(); COption::SetOptionString('cleantalk.antispam', 'sfw_last_updated', time()); } if ($is_sfw == 1 && !$USER->IsAdmin()) { include_once "cleantalk-sfw.class.php"; $is_sfw_check = true; $ip = CleantalkAntispam::CleantalkGetIP(); $ip = array_unique($ip); $sfw_log = COption::GetOptionString('cleantalk.antispam', 'sfw_log', ''); for ($i = 0; $i < sizeof($ip); $i++) { if (isset($_COOKIE['ct_sfw_pass_key']) && $_COOKIE['ct_sfw_pass_key'] == md5($ip[$i] . $key)) { $is_sfw_check = false; if (isset($_COOKIE['ct_sfw_passed'])) { if ($sfw_log == '') { $sfw_log = array(); $sfw_log[$ip[$i]] = array(); } else { $sfw_log = json_decode($sfw_log, true); } $sfw_log[$ip[$i]]['allow']++; COption::SetOptionString('cleantalk.antispam', 'sfw_log', json_encode($sfw_log)); @setcookie('ct_sfw_passed', '0', 1, "/"); } } } if ($is_sfw_check) { include_once "cleantalk-sfw.class.php"; $sfw = new CleanTalkSFW(); $sfw->cleantalk_get_real_ip(); $sfw->check_ip(); if ($sfw->result) { $sfw->sfw_die(); } } } if ($key != '' && $key != 'enter key' && $USER->IsAdmin()) { $new_status = $last_status; if ($new_checked - $last_checked > 86400) { $url = 'https://api.cleantalk.org'; $dt = array('auth_key' => $key, 'method_name' => 'get_account_status'); $result = CleantalkAntispam::CleantalkSendRequest($url, $dt, false); if ($result !== null) { $result = json_decode($result); if (isset($result->data) && isset($result->data->paid)) { $new_status = intval($result->data->paid); if ($last_status != 1 && $new_status == 1) { COption::SetOptionString('cleantalk.antispam', 'is_paid', 1); $show_notice = 1; if (LANGUAGE_ID == 'ru') { $review_message = "Нравится антиспам от CleanTalk? Расскажите другим об этом! <a target='_blank' href='http://marketplace.1c-bitrix.ru/solutions/cleantalk.antispam/#rating'>Оставьте отзыв в Bitrix.Marketplace</a>"; } else { $review_mess = "Like Anti-spam by CleanTalk? Help others learn about CleanTalk! <a target='_blank' href='http://marketplace.1c-bitrix.ru/solutions/cleantalk.antispam/#rating'>Leave a review at the Bitrix.Marketplace</a>"; } CAdminNotify::Add(array('MESSAGE' => $review_mess, 'TAG' => 'review_notify', 'MODULE_ID' => 'main', 'ENABLE_CLOSE' => 'Y')); } } } $url = 'https://api.cleantalk.org'; $dt = array('auth_key' => $key, 'method_name' => 'notice_paid_till'); $result = CleantalkAntispam::CleantalkSendRequest($url, $dt, false); if ($result !== null) { $result = json_decode($result); if (isset($result->moderate_ip) && $result->moderate_ip == 1) { COption::SetOptionString('cleantalk.antispam', 'moderate_ip', 1); COption::SetOptionString('cleantalk.antispam', 'ip_license', $result['ip_license']); } else { COption::SetOptionString('cleantalk.antispam', 'moderate_ip', 0); COption::SetOptionString('cleantalk.antispam', 'ip_license', 0); } } COption::SetOptionString('cleantalk.antispam', 'last_checked', $new_checked); } } if (!$USER->IsAdmin() && $ct_status == 1 && $ct_global == 1) { $sender_email = null; $message = ''; CleantalkAntispam::CleantalkGetFields($sender_email, $message, $_POST); if ($sender_email !== null) { $arUser = array(); $arUser["type"] = "comment"; $arUser["sender_email"] = $sender_email; $arUser["sender_nickname"] = ''; $arUser["sender_ip"] = $_SERVER['REMOTE_ADDR']; $arUser["message_title"] = ""; $arUser["message_body"] = $message; $arUser["example_title"] = ""; $arUser["example_body"] = ""; $arUser["example_comments"] = ""; $aResult = CleantalkAntispam::CheckAllBefore($arUser, FALSE); if (isset($aResult) && is_array($aResult)) { if ($aResult['errno'] == 0) { if ($aResult['allow'] == 1) { //Not spammer - just return; return; } else { CleantalkAntispam::CleantalkDie($aResult['ct_result_comment']); return false; } } } } } }
?> </a><?php $Execs = $hkInstance->GetCodeByClassName("bx-panel-logout", GetMessage('admin_panel_logout')); echo $hkInstance->PrintJSExecs($Execs); } _showTopPanelButtonsSection($arPanelButtons, $hkInstance, 1); if ($USER->IsAuthorized()) { if ($hkInstance->IsActive()) { ?> <a hidefocus="true" id="bx-panel-hotkeys" href="javascript:void(0)" onclick="BXHotKeys.ShowSettings();" class="header-keyboard" title="<?php echo GetMessage('admin_panel_hotkeys_title'); ?> "></a><?php } $aUserOpt = CUserOptions::GetOption("admin_panel", "settings"); ?> <a hidefocus="true" href="javascript:void(0)" id="bx-panel-pin" class="adm-header-pin" onclick="BX.adminPanel.Fix(this)" title="<?php echo GetMessage('top_panel_pin_' . ($aUserOpt['fix'] == 'on' ? 'off' : 'on')); ?> "></a><?php $Execs = $hkInstance->GetCodeByClassName("bx-panel-pin", GetMessage('top_panel_pin')); echo $hkInstance->PrintJSExecs($Execs); } ?> </div></div><div class="adm-header-bottom"></div><?php if ($USER->IsAdmin()) { echo CAdminNotify::GetHtml(); } ?> </div><?php echo $GLOBALS["adminPage"]->ShowSound();
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 = ''; }
protected function notifyAdmin($code) { $tag = "YANDEX_MARKET_" . $code; $problemsCount = intval(\Bitrix\Main\Config\Option::get("sale", $tag, 0, $this->siteId)); if ($problemsCount < 3) { \Bitrix\Main\Config\Option::set("sale", $tag, $problemsCount + 1, $this->siteId); return false; } $dbRes = CAdminNotify::GetList(array(), array("TAG" => $tag)); if ($res = $dbRes->Fetch()) { return false; } CAdminNotify::Add(array("MESSAGE" => GetMessage("SALE_YMH_ADMIN_NOTIFY_" . $code, array("##LANGUAGE_ID##" => LANGUAGE_ID)), "TAG" => "YANDEX_MARKET_" . $code, "MODULE_ID" => "SALE", "ENABLE_CLOSE" => "Y")); \Bitrix\Main\Config\Option::set("sale", $tag, 0, $this->siteId); return true; }
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; }
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;">
public static function updateDBSchema() { global $DB, $DBType; $updater = new \CUpdater(); $updater->Init($curPath = "", $DBType, $updaterName = "", $curDir = "", "sale", "DB"); // table existence check $locationTableExists = $updater->TableExists("b_sale_location"); if ($locationTableExists) { $locationGroupTableExists = $updater->TableExists("b_sale_location_group"); $locationGroupNameTableExists = $updater->TableExists("b_sale_location_group_lang"); $locationNameTableExists = $updater->TableExists("b_sale_loc_name"); $locationExternalServiceTableExists = $updater->TableExists("b_sale_loc_ext_srv"); $locationExternalTableExists = $updater->TableExists("b_sale_loc_ext"); $locationTypeTableExists = $updater->TableExists("b_sale_loc_type"); $locationTypeNameTableExists = $updater->TableExists("b_sale_loc_type_name"); $locationLoc2SiteTableExists = $updater->TableExists("b_sale_loc_2site"); $locationDefaul2SiteTableExists = $updater->TableExists("b_sale_loc_def2site"); $tax2LocationTableExists = $updater->TableExists("b_sale_tax2location"); $delivery2LocationTableExists = $updater->TableExists("b_sale_delivery2location"); // adding columns to B_SALE_LOCATION // if CODE not exists, add it if (!$DB->query("select CODE from b_sale_location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location ADD CODE varchar(100) not null", "MSSQL" => "ALTER TABLE B_SALE_LOCATION ADD CODE varchar(100) default '' NOT NULL", "Oracle" => "ALTER TABLE B_SALE_LOCATION ADD CODE VARCHAR2(100 CHAR) default '' NOT NULL")); } // if CODE exists, copy values from ID and add index if ($DB->query("select CODE from b_sale_location WHERE 1=0", true)) { if (!$DB->IndexExists('b_sale_location', array('CODE'))) { $DB->query("update b_sale_location set CODE = ID"); // OK: oracle, mssql $DB->query("CREATE UNIQUE INDEX IX_B_SALE_LOC_CODE ON b_sale_location (CODE)"); // OK: oracle, mssql } } // create LEFT_MARGIN if (!$DB->query("select LEFT_MARGIN from b_sale_location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location ADD LEFT_MARGIN int", "MSSQL" => "ALTER TABLE B_SALE_LOCATION ADD LEFT_MARGIN int", "Oracle" => "ALTER TABLE B_SALE_LOCATION ADD LEFT_MARGIN NUMBER(18)")); } // create RIGHT_MARGIN if (!$DB->query("select RIGHT_MARGIN from b_sale_location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location ADD RIGHT_MARGIN int", "MSSQL" => "ALTER TABLE B_SALE_LOCATION ADD RIGHT_MARGIN int", "Oracle" => "ALTER TABLE B_SALE_LOCATION ADD RIGHT_MARGIN NUMBER(18)")); } $lMarginExists = $DB->query("select LEFT_MARGIN from b_sale_location WHERE 1=0", true); $rMarginExists = $DB->query("select RIGHT_MARGIN from b_sale_location WHERE 1=0", true); // add indexes if margins exist, but indexes not if ($lMarginExists && $rMarginExists) { if (!$DB->IndexExists('b_sale_location', array('LEFT_MARGIN', 'RIGHT_MARGIN'))) { $DB->query("CREATE INDEX IX_B_SALE_LOC_MARGINS ON b_sale_location (LEFT_MARGIN, RIGHT_MARGIN)"); // OK: oracle, mssql } if (!$DB->IndexExists('b_sale_location', array('RIGHT_MARGIN', 'LEFT_MARGIN'))) { $DB->query("CREATE INDEX IX_B_SALE_LOC_MARGINS_REV ON b_sale_location (RIGHT_MARGIN, LEFT_MARGIN)"); // OK: oracle, mssql } } // add PARENT_ID if (!$DB->query("select PARENT_ID from b_sale_location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location ADD PARENT_ID int DEFAULT '0'", "MSSQL" => "ALTER TABLE B_SALE_LOCATION ADD PARENT_ID int DEFAULT '0'", "Oracle" => "ALTER TABLE B_SALE_LOCATION ADD PARENT_ID NUMBER(18) DEFAULT '0'")); } // add index, if not exist for PARENT_ID, that exists if ($DB->query("select PARENT_ID from b_sale_location WHERE 1=0", true) && !$DB->IndexExists('b_sale_location', array('PARENT_ID'))) { $DB->query('CREATE INDEX IX_B_SALE_LOC_PARENT ON b_sale_location (PARENT_ID)'); // OK: oracle, mssql } // add DEPTH_LEVEL if (!$DB->query("select DEPTH_LEVEL from b_sale_location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location ADD DEPTH_LEVEL int default '1'", "MSSQL" => "ALTER TABLE B_SALE_LOCATION ADD DEPTH_LEVEL int DEFAULT '1'", "Oracle" => "ALTER TABLE B_SALE_LOCATION ADD DEPTH_LEVEL NUMBER(18) DEFAULT '1'")); } // add index, if not exist for DEPTH_LEVEL, that exists if ($DB->query("select DEPTH_LEVEL from b_sale_location WHERE 1=0", true) && !$DB->IndexExists('b_sale_location', array('DEPTH_LEVEL'))) { $DB->query("CREATE INDEX IX_B_SALE_LOC_DL ON b_sale_location (DEPTH_LEVEL)"); // OK: oracle, mssql } // add TYPE_ID if (!$DB->query("select TYPE_ID from b_sale_location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location ADD TYPE_ID int", "MSSQL" => "ALTER TABLE B_SALE_LOCATION ADD TYPE_ID int", "Oracle" => "ALTER TABLE B_SALE_LOCATION ADD TYPE_ID NUMBER(18)")); } // add index, if not exist for TYPE_ID, that exists if ($DB->query("select TYPE_ID from b_sale_location WHERE 1=0", true) && !$DB->IndexExists('b_sale_location', array('TYPE_ID'))) { $DB->query("CREATE INDEX IX_B_SALE_LOC_TYPE ON b_sale_location (TYPE_ID)"); // OK: oracle, mssql } // add LATITUDE if (!$DB->query("select LATITUDE from b_sale_location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location ADD LATITUDE decimal(8,6)", "MSSQL" => "ALTER TABLE B_SALE_LOCATION ADD LATITUDE decimal(8,6)", "Oracle" => "ALTER TABLE B_SALE_LOCATION ADD LATITUDE NUMBER(8,6)")); } // add LONGITUDE if (!$DB->query("select LONGITUDE from b_sale_location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location ADD LONGITUDE decimal(9,6)", "MSSQL" => "ALTER TABLE B_SALE_LOCATION ADD LONGITUDE decimal(9,6)", "Oracle" => "ALTER TABLE B_SALE_LOCATION ADD LONGITUDE NUMBER(9,6)")); } // dropping not-nulls if ($DBType == 'mysql') { $DB->query("ALTER TABLE b_sale_location MODIFY COUNTRY_ID int NULL"); } if ($DBType == 'mssql') { $DB->query("ALTER TABLE B_SALE_LOCATION ALTER COLUMN COUNTRY_ID int NULL"); } if ($DBType == 'oracle') { // dropping not-nulls if ($DB->query("SELECT * FROM ALL_TAB_COLUMNS WHERE TABLE_NAME = 'B_SALE_LOCATION' and COLUMN_NAME = 'COUNTRY_ID' and NULLABLE = 'N'")->fetch()) { //if ($DB->IndexExists('b_sale_location', array('COUNTRY_ID'))) // $DB->query('drop index IXS_LOCATION_COUNTRY_ID'); $DB->query("ALTER TABLE B_SALE_LOCATION MODIFY ( COUNTRY_ID NUMBER(18) NULL)"); } //if (!$DB->IndexExists('b_sale_location', array('COUNTRY_ID'))) // $DB->query('CREATE INDEX IXS_LOCATION_COUNTRY_ID ON B_SALE_LOCATION(COUNTRY_ID)'); // altering sequences for oracle // new sequence for b_sale_location if ($DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_SALE_LOCATION'", true)->fetch()) { $DB->query("RENAME SQ_SALE_LOCATION TO SQ_B_SALE_LOCATION"); // OK $DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOCATION_INSERT\n\t\t\t\t\t\tBEFORE INSERT\n\t\t\t\t\t\tON B_SALE_LOCATION\n\t\t\t\t\t\tFOR EACH ROW\n\t\t\t\t\t\tBEGIN\n\t\t\t\t\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\t\t\t\t\tSELECT SQ_B_SALE_LOCATION.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\t\t\t\t\tEND IF;\n\t\t\t\t\t\tEND;"); // OK } // new sequence for b_sale_location_group if ($locationGroupTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOCATION_GROUP'", true)->fetch()) { $DB->query("RENAME SQ_SALE_LOCATION_GROUP TO SQ_B_SALE_LOCATION_GROUP"); // OK $DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOCATION_GROUP_INSERT\n\t\t\t\t\t\tBEFORE INSERT\n\t\t\t\t\t\tON B_SALE_LOCATION_GROUP\n\t\t\t\t\t\tFOR EACH ROW\n\t\t\t\t\t\tBEGIN\n\t\t\t\t\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\t\t\t\t\tSELECT SQ_B_SALE_LOCATION_GROUP.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\t\t\t\t\tEND IF;\n\t\t\t\t\t\tEND;"); // OK } // new sequence for b_sale_location_group_lang if ($locationGroupNameTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOCATION_GROUP_LANG'", true)->fetch()) { $DB->query("RENAME SQ_SALE_LOCATION_GROUP_LANG TO SQ_B_SALE_LOCATION_GROUP_LANG"); // OK $DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOCGR_LANG_INSERT\n\t\t\t\t\t\tBEFORE INSERT\n\t\t\t\t\t\tON B_SALE_LOCATION_GROUP_LANG\n\t\t\t\t\t\tFOR EACH ROW\n\t\t\t\t\t\tBEGIN\n\t\t\t\t\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\t\t\t\t\tSELECT SQ_B_SALE_LOCATION_GROUP_LANG.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\t\t\t\t\tEND IF;\n\t\t\t\t\t\tEND;"); // OK } } // adding columns to B_SALE_LOCATION_GROUP if ($locationGroupTableExists) { if (!$DB->query("select CODE from b_sale_location_group WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_location_group ADD CODE varchar(100) NOT NULL", "MSSQL" => "ALTER TABLE B_SALE_LOCATION_GROUP ADD CODE varchar(100) default '' NOT NULL", "Oracle" => "ALTER TABLE B_SALE_LOCATION_GROUP ADD CODE VARCHAR2(100 CHAR) default '' NOT NULL")); } // if CODE exists, copy values from ID and add index if ($DB->query("select CODE from b_sale_location_group WHERE 1=0", true)) { if (!$DB->IndexExists('b_sale_location_group', array('CODE'))) { $DB->query("update b_sale_location_group set CODE = ID"); // OK: oracle, mssql $DB->query("CREATE UNIQUE INDEX IX_B_SALE_LOC_GROUP_CODE ON b_sale_location_group (CODE)"); // OK: oracle, mssql } } } if (!$locationNameTableExists) { $updater->query(array("MySQL" => "create table b_sale_loc_name (\n\t\t\t\t\t\t\t\t\tID int not null auto_increment,\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID char(2) not null,\n\t\t\t\t\t\t\t\t\tLOCATION_ID int not null,\n\t\t\t\t\t\t\t\t\tNAME varchar(100) not null,\n\t\t\t\t\t\t\t\t\tNAME_UPPER varchar(100) not null,\n\t\t\t\t\t\t\t\t\tSHORT_NAME varchar(100),\n\n\t\t\t\t\t\t\t\t\tprimary key (ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_NAME (\n\t\t\t\t\t\t\t\t\tID int NOT NULL IDENTITY (1, 1),\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID char(2) NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_ID int NOT NULL,\n\t\t\t\t\t\t\t\t\tNAME varchar(100) NOT NULL,\n\t\t\t\t\t\t\t\t\tNAME_UPPER varchar(100) NOT NULL,\n\t\t\t\t\t\t\t\t\tSHORT_NAME varchar(100)\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_NAME PRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_NAME(\n\t\t\t\t\t\t\t\t\tID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID CHAR(2 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_ID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tNAME VARCHAR2(100 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tNAME_UPPER VARCHAR2(100 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tSHORT_NAME VARCHAR2(100 CHAR),\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)")); $locationNameTableExists = true; } if ($DBType == 'oracle' && $locationNameTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_NAME'", true)->fetch()) { $DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_NAME INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER"); // OK $DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_NAME_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_NAME\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_NAME.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;"); // OK } if ($locationNameTableExists) { if (!$DB->IndexExists('b_sale_loc_name', array('NAME_UPPER'))) { $DB->query("CREATE INDEX IX_B_SALE_LOC_NAME_NAME_U ON b_sale_loc_name (NAME_UPPER)"); // OK: oracle, mssql } if (!$DB->IndexExists('b_sale_loc_name', array('LOCATION_ID', 'LANGUAGE_ID'))) { $DB->query("CREATE INDEX IX_B_SALE_LOC_NAME_LI_LI ON b_sale_loc_name (LOCATION_ID, LANGUAGE_ID)"); // OK: oracle, mssql } } if (!$locationExternalServiceTableExists) { $updater->query(array("MySQL" => "create table b_sale_loc_ext_srv(\n\t\t\t\t\t\t\t\t\tID int not null auto_increment,\n\t\t\t\t\t\t\t\t\tCODE varchar(100) not null,\n\n\t\t\t\t\t\t\t\t\tprimary key (ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_EXT_SRV(\n\t\t\t\t\t\t\t\t\tID int NOT NULL IDENTITY (1, 1),\n\t\t\t\t\t\t\t\t\tCODE varchar(100) NOT NULL\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_EXT_SRV PRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_EXT_SRV(\n\t\t\t\t\t\t\t\t\tID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tCODE VARCHAR2(100 CHAR) NOT NULL,\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)")); $locationExternalServiceTableExists = true; } if ($DBType == 'oracle' && $locationExternalServiceTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_EXT_SRV'", true)->fetch()) { $DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_EXT_SRV INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER"); // OK $DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_EXT_SRV_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_EXT_SRV\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_EXT_SRV.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;"); // OK } if (!$locationExternalTableExists) { $updater->query(array("MySQL" => "create table b_sale_loc_ext(\n\t\t\t\t\t\t\t\t\tID int not null auto_increment,\n\t\t\t\t\t\t\t\t\tSERVICE_ID int not null,\n\t\t\t\t\t\t\t\t\tLOCATION_ID int not null,\n\t\t\t\t\t\t\t\t\tXML_ID varchar(100) not null,\n\n\t\t\t\t\t\t\t\t\tprimary key (ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_EXT(\n\t\t\t\t\t\t\t\t\tID int NOT NULL IDENTITY (1, 1),\n\t\t\t\t\t\t\t\t\tSERVICE_ID int NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_ID int NOT NULL,\n\t\t\t\t\t\t\t\t\tXML_ID varchar(100) NOT NULL\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_EXT PRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_EXT(\n\t\t\t\t\t\t\t\t\tID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tSERVICE_ID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_ID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tXML_ID VARCHAR2(100 CHAR) NOT NULL,\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)")); $locationExternalTableExists = true; } if ($DBType == 'oracle' && $locationExternalTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_EXT'", true)->fetch()) { $DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_EXT INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER"); // OK $DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_EXT_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_EXT\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_EXT.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;"); // OK } if ($locationExternalTableExists && !$DB->IndexExists('b_sale_loc_ext', array('LOCATION_ID', 'SERVICE_ID'))) { $DB->query("CREATE INDEX IX_B_SALE_LOC_EXT_LID_SID ON b_sale_loc_ext (LOCATION_ID, SERVICE_ID)"); // OK: oracle, mssql } if (!$locationTypeTableExists) { $updater->query(array("MySQL" => "create table b_sale_loc_type(\n\t\t\t\t\t\t\t\t\tID int not null auto_increment,\n\t\t\t\t\t\t\t\t\tCODE varchar(30) not null,\n\t\t\t\t\t\t\t\t\tSORT int default '100',\n\n\t\t\t\t\t\t\t\t\tprimary key (ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_TYPE(\n\t\t\t\t\t\t\t\t\tID int NOT NULL IDENTITY (1, 1),\n\t\t\t\t\t\t\t\t\tCODE varchar(30) NOT NULL,\n\t\t\t\t\t\t\t\t\tSORT int\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_TYPE PRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_TYPE(\n\t\t\t\t\t\t\t\t\tID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tCODE VARCHAR2(30 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tSORT NUMBER(18) DEFAULT '100',\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)")); $updater->query(array("MSSQL" => "ALTER TABLE B_SALE_LOC_TYPE ADD CONSTRAINT DF_B_SALE_LOC_TYPE_SORT DEFAULT '100' FOR SORT")); $locationTypeTableExists = true; } if ($DBType == 'oracle' && $locationTypeTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_TYPE'", true)->fetch()) { $DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_TYPE INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER"); // OK $DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_TYPE_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_TYPE\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_TYPE.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;"); // OK } if (!$locationTypeNameTableExists) { $updater->query(array("MySQL" => "create table b_sale_loc_type_name(\n\t\t\t\t\t\t\t\t\tID int not null auto_increment,\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID char(2) not null,\n\t\t\t\t\t\t\t\t\tNAME varchar(100) not null,\n\t\t\t\t\t\t\t\t\tTYPE_ID int not null,\n\n\t\t\t\t\t\t\t\t\tprimary key (ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_TYPE_NAME(\n\t\t\t\t\t\t\t\t\tID int NOT NULL IDENTITY (1, 1),\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID char(2) NOT NULL,\n\t\t\t\t\t\t\t\t\tNAME varchar(100) NOT NULL,\n\t\t\t\t\t\t\t\t\tTYPE_ID int NOT NULL\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_TYPE_NAME PRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_TYPE_NAME(\n\t\t\t\t\t\t\t\t\tID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID CHAR(2 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tNAME VARCHAR2(100 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tTYPE_ID NUMBER(18) NOT NULL,\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)")); $locationTypeNameTableExists = true; } if ($DBType == 'oracle' && $locationTypeNameTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_TYPE_NAME'", true)->fetch()) { $DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_TYPE_NAME INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER"); // OK $DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_TYPE_NAME_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_TYPE_NAME\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_TYPE_NAME.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;"); // OK } if ($locationTypeNameTableExists) { if (!$DB->IndexExists('b_sale_loc_type_name', array('TYPE_ID', 'LANGUAGE_ID'))) { $DB->query('CREATE INDEX IX_B_SALE_LOC_TYPE_NAME_TI_LI ON b_sale_loc_type_name (TYPE_ID, LANGUAGE_ID)'); // OK: oracle, mssql } } if (!$locationLoc2SiteTableExists) { $updater->query(array("MySQL" => "create table b_sale_loc_2site(\n\t\t\t\t\t\t\t\t\tLOCATION_ID int not null,\n\t\t\t\t\t\t\t\t\tSITE_ID char(2) not null,\n\t\t\t\t\t\t\t\t\tLOCATION_TYPE char(1) not null default 'L',\n\n\t\t\t\t\t\t\t\t\tprimary key (SITE_ID, LOCATION_ID, LOCATION_TYPE)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_2SITE(\n\t\t\t\t\t\t\t\t\tLOCATION_ID int NOT NULL,\n\t\t\t\t\t\t\t\t\tSITE_ID char(2) NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_TYPE char(1) NOT NULL\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_2SITE PRIMARY KEY (SITE_ID, LOCATION_ID, LOCATION_TYPE)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_2SITE(\n\t\t\t\t\t\t\t\t\tLOCATION_ID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tSITE_ID CHAR(2 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_TYPE CHAR(1 CHAR) DEFAULT 'L' NOT NULL,\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (SITE_ID, LOCATION_ID, LOCATION_TYPE)\n\t\t\t\t\t\t\t\t)")); $updater->query(array("MSSQL" => "ALTER TABLE B_SALE_LOC_2SITE ADD CONSTRAINT DF_B_SALE_LOC_2SITE DEFAULT 'L' FOR LOCATION_TYPE")); } if (!$locationDefaul2SiteTableExists) { $updater->query(array("MySQL" => "create table b_sale_loc_def2site(\n\t\t\t\t\t\t\t\t\tLOCATION_CODE varchar(100) not null,\n\t\t\t\t\t\t\t\t\tSITE_ID char(2) not null,\n\t\t\t\t\t\t\t\t\tSORT int default '100',\n\n\t\t\t\t\t\t\t\t\tprimary key (LOCATION_CODE, SITE_ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_DEF2SITE(\n\t\t\t\t\t\t\t\t\tLOCATION_CODE varchar(100) NOT NULL,\n\t\t\t\t\t\t\t\t\tSITE_ID char(2) NOT NULL,\n\t\t\t\t\t\t\t\t\tSORT int\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_DEF2SITE PRIMARY KEY (LOCATION_CODE, SITE_ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_DEF2SITE(\n\t\t\t\t\t\t\t\t\tLOCATION_CODE VARCHAR2(100 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tSITE_ID CHAR(2 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tSORT NUMBER(18) DEFAULT '100',\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (LOCATION_CODE, SITE_ID)\n\t\t\t\t\t\t\t\t)")); $updater->query(array("MSSQL" => "ALTER TABLE B_SALE_LOC_DEF2SITE ADD CONSTRAINT DF_B_SALE_LOC_DEF2SITE_SORT DEFAULT '100' FOR SORT")); } // move tax and delivery to the new relation field: code if ($tax2LocationTableExists && $DB->query("select LOCATION_ID from b_sale_tax2location WHERE 1=0", true)) { $DB->query('delete from b_sale_tax2location where LOCATION_ID is null'); // OK: oracle, mssql // useless records to be deleted if (!$DB->query("select LOCATION_CODE from b_sale_tax2location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_tax2location ADD LOCATION_CODE varchar(100) NOT NULL", "MSSQL" => "ALTER TABLE B_SALE_TAX2LOCATION ADD LOCATION_CODE varchar(100) default '' NOT NULL", "Oracle" => "ALTER TABLE B_SALE_TAX2LOCATION ADD LOCATION_CODE VARCHAR2(100 CHAR) default '' NOT NULL")); } $DB->query('update b_sale_tax2location set LOCATION_CODE = LOCATION_ID'); // OK: oracle, mssql if ($DBType == 'mssql') { $DB->query('ALTER TABLE b_sale_tax2location DROP CONSTRAINT PK_B_SALE_TAX2LOCATION'); } else { $DB->query('ALTER TABLE b_sale_tax2location DROP PRIMARY KEY'); } // OK: oracle $DB->query('ALTER TABLE b_sale_tax2location DROP COLUMN LOCATION_ID'); // OK: oracle, mssql $DB->query('ALTER TABLE b_sale_tax2location ADD CONSTRAINT PK_B_SALE_TAX2LOCATION PRIMARY KEY (TAX_RATE_ID, LOCATION_CODE, LOCATION_TYPE)'); // OK: oracle, mssql } if ($delivery2LocationTableExists && $DB->query("select LOCATION_ID from b_sale_delivery2location WHERE 1=0", true)) { $DB->query('delete from b_sale_delivery2location where LOCATION_ID is null'); // OK: oracle, mssql // useless records to be deleted if (!$DB->query("select LOCATION_CODE from b_sale_delivery2location WHERE 1=0", true)) { $updater->query(array("MySQL" => "ALTER TABLE b_sale_delivery2location ADD LOCATION_CODE varchar(100) NOT NULL", "MSSQL" => "ALTER TABLE B_SALE_DELIVERY2LOCATION ADD LOCATION_CODE varchar(100) default '' NOT NULL", "Oracle" => "ALTER TABLE B_SALE_DELIVERY2LOCATION ADD LOCATION_CODE VARCHAR2(100 CHAR) default '' NOT NULL")); } $DB->query('update b_sale_delivery2location set LOCATION_CODE = LOCATION_ID'); // OK: oracle, mssql if ($DBType == 'mssql') { $DB->query('ALTER TABLE b_sale_delivery2location DROP CONSTRAINT PK_B_SALE_DELIVERY2LOCATION'); } else { $DB->query('ALTER TABLE b_sale_delivery2location DROP PRIMARY KEY'); } // OK: oracle $DB->query('ALTER TABLE b_sale_delivery2location DROP COLUMN LOCATION_ID'); // OK: oracle, mssql $DB->query('ALTER TABLE b_sale_delivery2location ADD CONSTRAINT PK_B_SALE_DELIVERY2LOCATION PRIMARY KEY (DELIVERY_ID, LOCATION_CODE, LOCATION_TYPE)'); // OK: oracle, mssql } if (\COption::GetOptionString('sale', 'sale_locationpro_migrated', '') != 'Y') { \CAdminNotify::Add(array("MESSAGE" => Loc::getMessage('SALE_LOCATION_MIGRATION_PLZ_MIGRATE_NOTIFIER', array('#ANCHOR_MIGRATE#' => '<a href="/bitrix/admin/sale_location_migration.php">', '#ANCHOR_END#' => '</a>')), "TAG" => "SALE_LOCATIONPRO_PLZ_MIGRATE", "MODULE_ID" => "SALE", "ENABLE_CLOSE" => "Y")); } } }
function CommonTest() { if (!IsModuleInstalled('intranet') || defined('FX_CRONTAB')) // can't get real HTTP server vars from cron return "CSiteCheckerTest::CommonTest();"; IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'].'/freetrix/modules/main/admin/site_checker.php'); $step = 0; while(true) { if (is_object($oTest)) $ar = $oTest->arTestVars; $oTest = new CSiteCheckerTest($step, $fast = 1); $oTest->arTestVars = $ar; $oTest->host = $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : 'localhost'; $oTest->ssl = $_SERVER['HTTPS'] == 'on'; $oTest->port = $_SERVER['SERVER_PORT'] ? $_SERVER['SERVER_PORT'] : ($oTest->ssl ? 443 : 80); $oTest->Start(); if ($oTest->result === false) { $ar = Array( "MESSAGE" => GetMessage("MAIN_SC_GOT_ERRORS", array('#LINK#' => "/freetrix/admin/site_checker.php?lang=".LANGUAGE_ID."&express_test=Y")), "TAG" => "SITE_CHECKER", "MODULE_ID" => "MAIN", 'TYPE' => 'ERROR' ); CAdminNotify::Add($ar); break; } if ($oTest->percent >= 100) break; $step++; } return "CSiteCheckerTest::CommonTest();"; }
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>
function CommonTest() { if (!IsModuleInstalled('intranet') || defined('BX_CRONTAB') || (defined('CHK_EVENT') && CHK_EVENT === true)) // can't get real HTTP server vars from cron return "CSiteCheckerTest::CommonTest();"; if (($ntlm_varname = COption::GetOptionString('ldap', 'ntlm_varname', 'REMOTE_USER')) && ($user = trim($_SERVER[$ntlm_varname]))) return "CSiteCheckerTest::CommonTest();"; // Server NTLM is enabled, no way to connect through a socket IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/admin/site_checker.php'); $step = 0; while(true) { if (is_object($oTest)) $ar = $oTest->arTestVars; $oTest = new CSiteCheckerTest($step, $fast = 1); $oTest->arTestVars = $ar; $oTest->host = $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : 'localhost'; $oTest->ssl = $_SERVER['HTTPS'] == 'on'; $oTest->port = $_SERVER['SERVER_PORT'] ? $_SERVER['SERVER_PORT'] : ($oTest->ssl ? 443 : 80); $oTest->Start(); if ($oTest->result === false) { $ar = Array( "MESSAGE" => GetMessage("MAIN_SC_GOT_ERRORS", array('#LINK#' => "/bitrix/admin/site_checker.php?lang=".LANGUAGE_ID."&express_test=Y")), "TAG" => "SITE_CHECKER", "MODULE_ID" => "MAIN", 'TYPE' => 'ERROR' ); CAdminNotify::Add($ar); break; } if ($oTest->percent >= 100) break; $step++; } return "CSiteCheckerTest::CommonTest();"; }
public function setIsAlreadyConverted() { CAdminNotify::DeleteByTag('webdav_convertor_14_0_2'); COption::SetOptionString('webdav', '~isAlreadyConvertedDropped', 'Y'); return $this; }
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"); } } }
/** * * @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; }