예제 #1
0
 function CWizard($wizardName)
 {
     $this->name = $wizardName;
     if (!CWizardUtil::CheckName($this->name)) {
         $this->SetError(GetMessage("MAIN_WIZARD_ERROR_WRONG_WIZ_NAME"));
         return;
     }
     $pathToWizard = CWizardUtil::MakeWizardPath($this->name);
     $this->path = CWizardUtil::GetRepositoryPath() . $pathToWizard;
     if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $this->path) || !is_dir($_SERVER["DOCUMENT_ROOT"] . $this->path)) {
         $this->SetError(GetMessage("MAIN_WIZARD_ERROR_NOT_FOUND"));
         return;
     }
     $this->__GetDescription();
     $this->__CheckDepends();
     $this->__GetInstallationScript();
 }
예제 #2
0
 function CopyWizard($wizardName, $newName)
 {
     if (!CWizardUtil::CheckName($wizardName) || !CWizardUtil::CheckName($newName)) {
         return false;
     }
     $wizardPath = $_SERVER["DOCUMENT_ROOT"] . CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath($wizardName);
     $newNamePath = $_SERVER["DOCUMENT_ROOT"] . CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath($newName);
     if (!file_exists($wizardPath) || file_exists($newNamePath)) {
         return false;
     }
     CopyDirFiles($wizardPath, $newNamePath, $rewrite = false, $recursive = true);
     return true;
 }
예제 #3
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/extranet/classes/general/wizard_utils.php";
$arTemplates = array();
$templatesPath = CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath("bitrix:extranet") . "/site/templates";
$arTemplates = CExtranetWizardServices::GetTemplates($templatesPath);
$arSteps = array("WelcomeStep");
if (!empty($arTemplates)) {
    $arSteps[] = "SelectTemplateStep";
    $arSteps[] = "SelectThemeStep";
}
$arSteps[] = "SiteSettingsStep";
$arSteps[] = "DataInstallStep";
$arSteps[] = "FinishStep";
$arWizardDescription = array("NAME" => GetMessage("EXTRANET_WIZARD_NAME"), "DESCRIPTION" => GetMessage("EXTRANET_WIZARD_DESC"), "VERSION" => "1.0.0", "START_TYPE" => "WINDOW", "TEMPLATES" => array(array("SCRIPT" => "scripts/template.php", "CLASS" => "ExtranetWizardTemplate")), "STEPS" => $arSteps);
예제 #4
0
파일: utils.php 프로젝트: ASDAFF/bitrix-5
 function GetWizardCharset($wizardName)
 {
     if (!defined("B_PROLOG_INCLUDED")) {
         define("B_PROLOG_INCLUDED", true);
     }
     $wizardPath = CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath($wizardName);
     if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $wizardPath . "/.description.php")) {
         return false;
     }
     $arWizardDescription = array();
     include $_SERVER["DOCUMENT_ROOT"] . $wizardPath . "/.description.php";
     if (array_key_exists("CHARSET", $arWizardDescription) && strlen($arWizardDescription["CHARSET"]) > 0) {
         return $arWizardDescription["CHARSET"];
     }
     return false;
 }
예제 #5
0
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/tar_gz.php";
if (!$USER->CanDoOperation('edit_php') || !check_bitrix_sessid()) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
$ID = $_REQUEST["ID"];
$ID = str_replace("\\", "", $ID);
$ID = str_replace("/", "", $ID);
$bUseCompression = true;
if (!extension_loaded('zlib') || !function_exists("gzcompress")) {
    $bUseCompression = false;
}
$HTTP_ACCEPT_ENCODING = "";
CheckDirPath($_SERVER['DOCUMENT_ROOT'] . BX_PERSONAL_ROOT . "/tmp/wizards/");
$tempFile = $_SERVER['DOCUMENT_ROOT'] . BX_PERSONAL_ROOT . "/tmp/wizards/" . md5(uniqid(rand(), true) . ".tar.gz");
$wizardPath = $_SERVER["DOCUMENT_ROOT"] . CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath($ID);
$strError = "";
if (is_dir($wizardPath)) {
    $oArchiver = new CArchiver($tempFile, $bUseCompression);
    $success = $oArchiver->add("\"" . $wizardPath . "\"", false, $_SERVER["DOCUMENT_ROOT"] . CWizardUtil::GetRepositoryPath());
    if ($success) {
        header('Pragma: public');
        header('Cache-control: private');
        header('Accept-Ranges: bytes');
        header("Content-Length: " . filesize($tempFile));
        header("Content-Type: application/x-force-download; filename=" . str_replace(":", "-", $ID) . ".tar.gz");
        header("Content-Disposition: attachment; filename=\"" . str_replace(":", "-", $ID) . ".tar.gz\"");
        header("Content-Transfer-Encoding: binary");
        readfile($tempFile);
        unlink($tempFile);
    } else {