示例#1
0
define("STOP_STATISTICS", true);
define("PUBLIC_AJAX_MODE", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
if (!$USER->IsAdmin() || !check_bitrix_sessid()) {
    echo GetMessage('CLUWIZ_ERROR_ACCESS_DENIED');
    require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
    die;
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/wizard.php";
$lang = $_REQUEST['lang'];
if (!preg_match('/^[a-z0-9_]{2}$/i', $lang)) {
    $lang = 'en';
}
$wizard = new CWizard("bitrix:cluster.slave_start");
$wizard->IncludeWizardLang("scripts/drop.php", $lang);
CModule::IncludeModule('cluster');
$node_id = $_REQUEST["node_id"];
if ($node_id <= 1) {
    $nodeDB = false;
} else {
    $nodeDB = CDatabase::GetDBNodeConnection($node_id, true, false);
}
if (!is_object($nodeDB)) {
    echo GetMessage('CLUWIZ_CONNECTION_ERROR');
} else {
    $arTablesToDelete = array();
    $rsTables = $nodeDB->Query("show tables", false, '', array("fixed_connection" => true));
    while ($arTable = $rsTables->Fetch()) {
        $arTablesToDelete[] = $arTable["Tables_in_" . $nodeDB->DBName];
    }
示例#2
0
<?php

define("STOP_STATISTICS", true);
define('DLSERVER', 'www.1c-bitrix.ru');
define('DLPORT', 80);
define('DLPATH', '/download/files/locations/');
define('DLMETHOD', 'GET');
define('DLZIPFILE', 'zip_ussr.csv');
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/wizard.php";
$wizard = new CWizard("bitrix:sale.locations");
$wizard->IncludeWizardLang("scripts/loader.php");
$saleModulePermissions = $APPLICATION->GetGroupRight("sale");
if ($saleModulePermissions < "W") {
    echo GetMessage('WSL_LOADER_ERROR_ACCESS_DENIED');
    require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
    die;
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/general/location_import.php";
$arLoadParams = array('STEP' => intval($_REQUEST['STEP']), 'CSVFILE' => $_REQUEST['CSVFILE'], 'LOADZIP' => $_REQUEST['LOADZIP'], 'DLSERVER' => DLSERVER, 'DLPORT' => DLPORT, 'DLPATH' => DLPATH, 'DLMETHOD' => DLMETHOD, 'DLZIPFILE' => DLZIPFILE);
$arLoadResult = saleLocationLoadFile($arLoadParams);
if (strlen($arLoadResult['ERROR']) > 0) {
    echo $arLoadResult['ERROR'];
    if (isset($arLoadResult['RUN_ERROR']) && $arLoadResult['RUN_ERROR'] == true) {
        echo '<script>RunError()</script>';
    }
} elseif (isset($arLoadResult['COMPLETE']) && $arLoadResult['COMPLETE'] === true) {
    echo GetMessage('WSL_LOADER_ALL_LOADED');
    echo '<script>EnableButton();</script>';
} elseif ($arLoadResult['STEP'] !== false) {
    if (strlen($arLoadResult['MESSAGE']) > 0) {
示例#3
0
文件: move.php 项目: Satariall/izurit
define("STOP_STATISTICS", true);
define("PUBLIC_AJAX_MODE", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
if (!$USER->IsAdmin() || !check_bitrix_sessid()) {
    echo GetMessage('CLUWIZ_ERROR_ACCESS_DENIED');
    require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
    die;
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/wizard.php";
$lang = $_REQUEST['lang'];
if (!preg_match('/^[a-z0-9_]{2}$/i', $lang)) {
    $lang = 'en';
}
$wizard = new CWizard("bitrix:cluster.slave_start");
$wizard->IncludeWizardLang("scripts/move.php", $lang);
CModule::IncludeModule('cluster');
$STEP = intval($_REQUEST['STEP']);
$node_id = intval($_REQUEST["node_id"]);
if ($node_id < 2) {
    $nodeDB = false;
} else {
    $nodeDB = CDatabase::GetDBNodeConnection($node_id, true, false);
}
if (!is_object($nodeDB)) {
    echo GetMessage('CLUWIZ_CONNECTION_ERROR');
} elseif ($STEP < 2) {
    $DB->Query("DELETE FROM b_cluster_table", false, '', array("fixed_connection" => true));
    $strError = CreateNodeTable($DB, $nodeDB, "b_cluster_table");
    $arTables = array();
    $rsTables = $DB->Query("show tables", false, '', array("fixed_connection" => true));
示例#4
0
<?php

define("STOP_STATISTICS", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
$saleModulePermissions = $APPLICATION->GetGroupRight("sale");
if (!check_bitrix_sessid() || $saleModulePermissions < "W") {
    echo GetMessage('WSL_IMPORT_ERROR_ACCESS_DENIED');
    require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
    die;
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/wizard.php";
$wizard = new CWizard("bitrix:sale.locations");
$wizard->IncludeWizardLang("scripts/import.php");
$step_length = intval($_REQUEST["STEP_LENGTH"]);
if ($step_length <= 0) {
    $step_length = 10;
}
define('ZIP_WRITE_TO_LOG', 0);
define('ZIP_STEP_LENGTH', $step_length);
define('LOC_STEP_LENGTH', $step_length);
define('DLZIPFILE', 'zip_ussr.csv');
function writeToLog($cur_op)
{
    if (defined('ZIP_WRITE_TO_LOG') && ZIP_WRITE_TO_LOG === 1) {
        global $start_time;
        list($usec, $sec) = explode(" ", microtime());
        $cur_time = (double) $usec + (double) $sec;
        $fp = fopen('log.txt', 'a');
        fwrite($fp, $cur_time . ": ");
        fwrite($fp, $cur_op . "\r\n");
        fclose($fp);