Пример #1
0
	function Init()
	{
		if($this->bInit)
			return;
		$this->bInit = true;

		$module_list = CModule::GetList();
		while($module = $module_list->Fetch())
			$this->aModules[] = $module["ID"];
	}
Пример #2
0
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</div></td>
				</tr>
				<tr>
					<td width="200" class="field-name"><span class="required">*</span>' . GetMessage("SOE_MODULE") . ':</td>
					<td width="400">';
        if ($bSimpleForm) {
            $formTemplate .= '<input type="hidden" name="BASKET_MODULE" id="BASKET_MODULE" value="catalog">' . GetMessage("SOE_MODULE_CATALOG");
        } else {
            $formTemplate .= '<select name="BASKET_MODULE" onchange="ModuleChange(this.value)" id="BASKET_MODULE">';
            $dbModuleList = CModule::GetList();
            while ($arModuleList = $dbModuleList->Fetch()) {
                $formTemplate .= '<option value="' . $arModuleList["ID"] . '">' . htmlspecialcharsEx($arModuleList["ID"]) . '</option>';
            }
            $formTemplate .= '</select>';
        }
        $formTemplate .= '</td>
				</tr>
				<tr>
					<td class="field-name"><span class="required">*</span>' . GetMessage("SOE_PRODUCT_ID") . ':</td>
					<td><input id="BASKET_PRODUCT_ID" name="BASKET_PRODUCT_ID" value="" size="5" type="text">&nbsp;<input disabled="disabled" id="basket_product_button" value="..." onclick="ProductSearchOpen(1)" type="button"></td>
				</tr>
				<tr>
					<td class="field-name"><span class="required">*</span>' . GetMessage("SOE_ITEM_NAME") . ':</td>
					<td><input size="40" id="BASKET_NAME" name="BASKET_NAME" type="text" value=""></td>
				</tr>
Пример #3
0
	function CheckKernel($arParams)
	{

		$time_start = time();
		global $DB;
		$arCompare = Array(
			"install/components/bitrix/" => "/bitrix/components/bitrix/",
			"install/js/" => "/bitrix/js/",
			"install/activities/" => "/bitrix/activities/",
		);

		if(!$_SESSION["BX_CHECKLIST"][$arParams["TEST_ID"]])
			$_SESSION["BX_CHECKLIST"][$arParams["TEST_ID"]] = Array();
		$NS = &$_SESSION["BX_CHECKLIST"][$arParams["TEST_ID"]];
		if ($arParams["STEP"] == false)
		{
			$NS = Array();
			$rsInstalledModules = CModule::GetList();
			while ($ar = $rsInstalledModules->Fetch())
			{
				if (!strpos($ar["ID"],"."))
					$NS["MLIST"][] = $ar["ID"];
			}
			$NS["MNUM"] = 0;
			$NS["FILE_LIST"] = Array();
			$NS["FILES_COUNT"] = 0;
			$NS["MODFILES_COUNT"] = 0;
		}
		$arError = false;
		$module_id = $NS["MLIST"][$NS["MNUM"]];
		$module_folder = $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$module_id."/";
		$dbtype = strtolower($DB->type);
		if ($module_id == "main")
			$ver = SM_VERSION;
		else
		{
			@include($module_folder."install/version.php");
			$ver = $arModuleVersion["VERSION"];
		}
		if (!$ver)
		{
			$state = Array(
				"STATUS" => false,
				"MESSAGE" =>  GetMessage("CL_MODULE_VERSION_ERROR",Array("#module_id#"=>$module_id))."\n"
			);
			$arError = true;
		}
		else
		{
			if(count($NS["FILE_LIST"]) == 0)
			{
				$sHost = COption::GetOptionString("main","update_site","www.bitrixsoft.com");
				$sUrl = "/bitrix/updates/checksum.php";
				$sVars = "check_sum=Y&module_id=".$module_id."&ver=".$ver."&dbtype=".$dbtype."&mode=2";
				$data = QueryGetData($sHost, 80, $sUrl, $sVars, $errno, $errstr);
				$NS["FILE_LIST"] = $result = unserialize(gzinflate($data));
				$NS["MODULE_FILES_COUNT"] = count($NS["FILE_LIST"]);
			}
			else
			{
				$result = $NS["FILE_LIST"];
			}
			$arMessage = "";
			$arFilesCount = 0;
			$arModifiedFilesCount = 0;
			$timeout = COption::GetOptionString("main","update_load_timeout","30");
			if (is_array($result) && !$result["error"])
			{
				foreach($result as $file=>$checksum)
				{
					$arFile = $module_folder.$file;
					unset($NS["FILE_LIST"][$file]);
					if (!file_exists($arFile))
						continue;
					$arFilesCount++;
					if (md5_file($arFile)!=$checksum)
					{
						$arMessage.= str_replace(Array("//","\\\\"),Array("/","\\"),$arFile)."\n";
						$arModifiedFilesCount++;
					}
					$arTmpCompare = $arCompare;
					foreach ($arTmpCompare as $key=>$value)
					if (strpos($file,$key) === 0)
					{
						$arFile = str_replace($key,$_SERVER["DOCUMENT_ROOT"].$value,$file);
						if (file_exists($arFile) && md5_file($arFile)!=$checksum)
						{
							$arModifiedFilesCount++;
							$arMessage.= str_replace(Array("//","\\\\"),Array("/","\\"),$arFile)."\n";
						}
						$arFilesCount++;
					}
					if ((time()-$time_start)>=$timeout)
						break;
				}
				if (strlen($arMessage)> 0)
				{
					$state = Array(
						"MESSAGE" => $arMessage,
						"STATUS" => false
					);
				}
			}
			else
			{
				if($result["error"]!= "unknow module id")
				{
					$state["MESSAGE"] = GetMessage("CL_CANT_CHECK",Array("#module_id#"=>$module_id))."\n";
					$arError = true;
				}
				else
					$Skip = true;
			}
		}
		if ($state["MESSAGE"])
			$NS["MESSAGE"][$module_id].=$state["MESSAGE"];
		if (!$arError && !$Skip)
		{
			if (count($NS["FILE_LIST"]) == 0)
			{
				if (strlen($NS["MESSAGE"][$module_id]) == 0)
					$NS["MESSAGE"][$module_id] = GetMessage("CL_NOT_MODIFIED",Array("#module_id#"=>$module_id))."\n";
				else
					$NS["MESSAGE"][$module_id] = GetMessage("CL_MODIFIED_FILES",Array("#module_id#"=>$module_id))."\n".$NS["MESSAGE"][$module_id];
			}
			$NS["FILES_COUNT"]+=$arFilesCount;
			$NS["MODFILES_COUNT"]+=$arModifiedFilesCount;
		}
		if ($state["STATUS"] === false || $arError == true || $Skip)
		{
			if ($state["STATUS"] === false || $arError == true)
				$NS["STATUS"] = false;
			$NS["FILE_LIST"] = Array();
			$NS["MODULE_FILES_COUNT"] = 0;
		}

		if (($NS["MNUM"]+1)>=(count($NS["MLIST"])) && !$NS["LAST_FILE"])
		{
			$arDetailReport = "";
			foreach($NS["MESSAGE"] as $module_message)
				$arDetailReport.="<div class=\"checklist-dot-line\"></div>".$module_message;
			$arResult = Array(
				"MESSAGE"=>Array(
					"PREVIEW"=> GetMessage("CL_KERNEL_CHECK_FILES").$NS["FILES_COUNT"]."\n".
					GetMessage("CL_KERNEL_CHECK_MODULE").count($NS["MLIST"])."\n".
					GetMessage("CL_KERNEL_CHECK_MODIFIED").$NS["MODFILES_COUNT"],
					"DETAIL" => $arDetailReport
					),
				"STATUS" =>($NS["STATUS"] === false?false:true)
			);

		}
		else
		{
			$percent =  round(($NS["MNUM"])/(count($NS["MLIST"])*0.01),0);
			if ($NS["MODULE_FILES_COUNT"]>0)
				$module_percent =  (1/(count($NS["MLIST"])*0.01))*((($NS["MODULE_FILES_COUNT"]-count($NS["FILE_LIST"]))/($NS["MODULE_FILES_COUNT"]*0.01))*0.01);
			$percent+=$module_percent;
			$arResult = Array(
				"IN_PROGRESS"=>"Y",
				"PERCENT" => number_format($percent,2),
			);
			if (count($NS["FILE_LIST"]) == 0)
			{
				$NS["MNUM"]++;
				$NS["MODULE_FILES_COUNT"] = 0;
			}
		}
		return $arResult;
	}
Пример #4
0
 function CheckKernel($arParams)
 {
     $time_start = time();
     global $DB;
     $arCompare = array("install/components/bitrix/" => "/bitrix/components/bitrix/", "install/js/" => "/bitrix/js/", "install/activities/" => "/bitrix/activities/", "install/admin/" => "/bitrix/admin/", "install/wizards/" => "/bitrix/wizards/");
     if (!$_SESSION["BX_CHECKLIST"][$arParams["TEST_ID"]]) {
         $_SESSION["BX_CHECKLIST"][$arParams["TEST_ID"]] = array();
     }
     $NS =& $_SESSION["BX_CHECKLIST"][$arParams["TEST_ID"]];
     if ($arParams["STEP"] == false) {
         $NS = array();
         $rsInstalledModules = CModule::GetList();
         while ($ar = $rsInstalledModules->Fetch()) {
             if (!strpos($ar["ID"], ".")) {
                 $NS["MLIST"][] = $ar["ID"];
             }
         }
         $NS["MNUM"] = 0;
         $NS["FILE_LIST"] = array();
         $NS["FILES_COUNT"] = 0;
         $NS["MODFILES_COUNT"] = 0;
     }
     $arError = false;
     $module_id = $NS["MLIST"][$NS["MNUM"]];
     $module_folder = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/" . $module_id . "/";
     $dbtype = strtolower($DB->type);
     if ($module_id == "main") {
         $ver = SM_VERSION;
     } else {
         $arModuleVersion = array();
         @(include $module_folder . "install/version.php");
         $ver = $arModuleVersion["VERSION"];
     }
     $arFilesCount = 0;
     $arModifiedFilesCount = 0;
     $state = array();
     $Skip = false;
     if (!$ver) {
         $state = array("STATUS" => false, "MESSAGE" => GetMessage("CL_MODULE_VERSION_ERROR", array("#module_id#" => $module_id)) . "\n");
         $arError = true;
     } else {
         if (count($NS["FILE_LIST"]) == 0) {
             $sHost = COption::GetOptionString("main", "update_site", "www.bitrixsoft.com");
             $proxyAddr = COption::GetOptionString("main", "update_site_proxy_addr", "");
             $proxyPort = COption::GetOptionString("main", "update_site_proxy_port", "");
             $proxyUserName = COption::GetOptionString("main", "update_site_proxy_user", "");
             $proxyPassword = COption::GetOptionString("main", "update_site_proxy_pass", "");
             $http = new \Bitrix\Main\Web\HttpClient();
             $http->setProxy($proxyAddr, $proxyPort, $proxyUserName, $proxyPassword);
             $data = $http->get("http://" . $sHost . "/bitrix/updates/checksum.php?check_sum=Y&module_id=" . $module_id . "&ver=" . $ver . "&dbtype=" . $dbtype . "&mode=2");
             $NS["FILE_LIST"] = $result = unserialize(gzinflate($data));
             $NS["MODULE_FILES_COUNT"] = count($NS["FILE_LIST"]);
         } else {
             $result = $NS["FILE_LIST"];
         }
         $arMessage = "";
         $timeout = COption::GetOptionString("main", "update_load_timeout", "30");
         if (is_array($result) && !$result["error"]) {
             foreach ($result as $file => $checksum) {
                 $arFile = $module_folder . $file;
                 unset($NS["FILE_LIST"][$file]);
                 if (!file_exists($arFile)) {
                     continue;
                 }
                 $arFilesCount++;
                 if (md5_file($arFile) != $checksum) {
                     $arMessage .= str_replace(array("//", "\\\\"), array("/", "\\"), $arFile) . "\n";
                     $arModifiedFilesCount++;
                 }
                 $arTmpCompare = $arCompare;
                 foreach ($arTmpCompare as $key => $value) {
                     if (strpos($file, $key) === 0) {
                         $arFile = str_replace($key, $_SERVER["DOCUMENT_ROOT"] . $value, $file);
                         if (!file_exists($arFile) || md5_file($arFile) != $checksum) {
                             $arModifiedFilesCount++;
                             $arMessage .= str_replace(array("//", "\\\\"), array("/", "\\"), $arFile) . "\n";
                         }
                         $arFilesCount++;
                     }
                 }
                 if (time() - $time_start >= $timeout) {
                     break;
                 }
             }
             if (strlen($arMessage) > 0) {
                 $state = array("MESSAGE" => $arMessage, "STATUS" => false);
             }
         } else {
             if ($result["error"] != "unknow module id") {
                 $state["MESSAGE"] = GetMessage("CL_CANT_CHECK", array("#module_id#" => $module_id)) . "\n";
                 $arError = true;
             } else {
                 $Skip = true;
             }
         }
     }
     if ($state["MESSAGE"]) {
         $NS["MESSAGE"][$module_id] .= $state["MESSAGE"];
     }
     if (!$arError && !$Skip) {
         if (count($NS["FILE_LIST"]) == 0) {
             if (strlen($NS["MESSAGE"][$module_id]) == 0) {
                 $NS["MESSAGE"][$module_id] = GetMessage("CL_NOT_MODIFIED", array("#module_id#" => $module_id)) . "\n";
             } else {
                 $NS["MESSAGE"][$module_id] = GetMessage("CL_MODIFIED_FILES", array("#module_id#" => $module_id)) . "\n" . $NS["MESSAGE"][$module_id];
             }
         }
         $NS["FILES_COUNT"] += $arFilesCount;
         $NS["MODFILES_COUNT"] += $arModifiedFilesCount;
     }
     if ($state["STATUS"] === false || $arError == true || $Skip) {
         if ($state["STATUS"] === false || $arError == true) {
             $NS["STATUS"] = false;
         }
         $NS["FILE_LIST"] = array();
         $NS["MODULE_FILES_COUNT"] = 0;
     }
     if ($NS["MNUM"] + 1 >= count($NS["MLIST"]) && !$NS["LAST_FILE"]) {
         $arDetailReport = "";
         foreach ($NS["MESSAGE"] as $module_message) {
             $arDetailReport .= "<div class=\"checklist-dot-line\"></div>" . $module_message;
         }
         $arResult = array("MESSAGE" => array("PREVIEW" => GetMessage("CL_KERNEL_CHECK_FILES") . $NS["FILES_COUNT"] . "\n" . GetMessage("CL_KERNEL_CHECK_MODULE") . count($NS["MLIST"]) . "\n" . GetMessage("CL_KERNEL_CHECK_MODIFIED") . $NS["MODFILES_COUNT"], "DETAIL" => $arDetailReport), "STATUS" => $NS["STATUS"] === false ? false : true);
     } else {
         $percent = round($NS["MNUM"] / (count($NS["MLIST"]) * 0.01), 0);
         $module_percent = 0;
         if ($NS["MODULE_FILES_COUNT"] > 0) {
             $module_percent = 1 / (count($NS["MLIST"]) * 0.01) * (($NS["MODULE_FILES_COUNT"] - count($NS["FILE_LIST"])) / ($NS["MODULE_FILES_COUNT"] * 0.01) * 0.01);
         }
         $percent += $module_percent;
         $arResult = array("IN_PROGRESS" => "Y", "PERCENT" => number_format($percent, 2));
         if (count($NS["FILE_LIST"]) == 0) {
             $NS["MNUM"]++;
             $NS["MODULE_FILES_COUNT"] = 0;
         }
     }
     return $arResult;
 }
Пример #5
0
ClearVars();
if (!$USER->CanDoOperation('view_groups')) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
$modules = COperation::GetAllowedModules();
for ($i = 0, $l = count($modules); $i < $l; $i++) {
    IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/" . $modules[$i] . "/admin/task_description.php");
}
$strError = "";
$ID = intval($_REQUEST["ID"]);
$COPY_ID = intval($_REQUEST["COPY_ID"]);
if ($COPY_ID > 0) {
    $ID = $COPY_ID;
}
$modules = CModule::GetList();
$arModules = array();
while ($mr = $modules->Fetch()) {
    $arModules[] = $mr["ID"];
}
$arSites = array();
$rsSites = CSite::GetList($by = "sort", $order = "asc", array("ACTIVE" => "Y"));
while ($arSite = $rsSites->GetNext()) {
    $arSites["reference_id"][] = $arSite["ID"];
    $arSites["reference"][] = "[" . $arSite["ID"] . "] " . $arSite["NAME"];
}
$USER_COUNT = CUser::GetCount();
$USER_COUNT_MAX = 25;
$arBXGroupPolicy = array("parent" => array("SESSION_TIMEOUT" => "", "SESSION_IP_MASK" => "", "MAX_STORE_NUM" => "", "STORE_IP_MASK" => "", "STORE_TIMEOUT" => "", "CHECKWORD_TIMEOUT" => "", "PASSWORD_LENGTH" => "", "PASSWORD_UPPERCASE" => "N", "PASSWORD_LOWERCASE" => "N", "PASSWORD_DIGITS" => "N", "PASSWORD_PUNCTUATION" => "N", "LOGIN_ATTEMPTS" => ""), "low" => array("SESSION_TIMEOUT" => 30, "SESSION_IP_MASK" => "0.0.0.0", "MAX_STORE_NUM" => 20, "STORE_IP_MASK" => "255.0.0.0", "STORE_TIMEOUT" => 60 * 24 * 93, "CHECKWORD_TIMEOUT" => 60 * 24 * 185, "PASSWORD_LENGTH" => 6, "PASSWORD_UPPERCASE" => "N", "PASSWORD_LOWERCASE" => "N", "PASSWORD_DIGITS" => "N", "PASSWORD_PUNCTUATION" => "N", "LOGIN_ATTEMPTS" => 0), "middle" => array("SESSION_TIMEOUT" => 20, "SESSION_IP_MASK" => "255.255.0.0", "MAX_STORE_NUM" => 10, "STORE_IP_MASK" => "255.255.0.0", "STORE_TIMEOUT" => 60 * 24 * 30, "CHECKWORD_TIMEOUT" => 60 * 24 * 1, "PASSWORD_LENGTH" => 8, "PASSWORD_UPPERCASE" => "Y", "PASSWORD_LOWERCASE" => "Y", "PASSWORD_DIGITS" => "Y", "PASSWORD_PUNCTUATION" => "N", "LOGIN_ATTEMPTS" => 0), "high" => array("SESSION_TIMEOUT" => 15, "SESSION_IP_MASK" => "255.255.255.255", "MAX_STORE_NUM" => 1, "STORE_IP_MASK" => "255.255.255.255", "STORE_TIMEOUT" => 60 * 24 * 3, "CHECKWORD_TIMEOUT" => 60, "PASSWORD_LENGTH" => 10, "PASSWORD_UPPERCASE" => "Y", "PASSWORD_LOWERCASE" => "Y", "PASSWORD_DIGITS" => "Y", "PASSWORD_PUNCTUATION" => "Y", "LOGIN_ATTEMPTS" => 3));
$BX_GROUP_POLICY_CONTROLS = array("SESSION_TIMEOUT" => array("text", 5), "SESSION_IP_MASK" => array("text", 20), "MAX_STORE_NUM" => array("text", 5), "STORE_IP_MASK" => array("text", 20), "STORE_TIMEOUT" => array("text", 5), "CHECKWORD_TIMEOUT" => array("text", 5), "PASSWORD_LENGTH" => array("text", 5), "PASSWORD_UPPERCASE" => array("checkbox", "Y"), "PASSWORD_LOWERCASE" => array("checkbox", "Y"), "PASSWORD_DIGITS" => array("checkbox", "Y"), "PASSWORD_PUNCTUATION" => array("checkbox", "Y"), "LOGIN_ATTEMPTS" => array("text", 5));
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB"), "ICON" => "group_edit", "TITLE" => GetMessage("MAIN_TAB_TITLE")), array("DIV" => "edit2", "TAB" => GetMessage("TAB_2"), "ICON" => "group_edit", "TITLE" => GetMessage('MUG_POLICY_TITLE')));
Пример #6
0
						}
						?>
					</table>
				<?
			}
			$viewTabControl->End();
		}
		else
			echo GetMessage('RATING_NOT_AVAILABLE');
		?>
		</td>
	</tr>
<?
$tabControl->EndCustomField("RATING_BOX");

$db_opt_res = CModule::GetList();
while ($opt_res = $db_opt_res->Fetch())
{
	$mdir = $opt_res["ID"];
	if (file_exists($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/".$mdir) && is_dir($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/".$mdir))
	{
		$ofile = $_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/".$mdir."/options_user_settings.php";
		if (file_exists($ofile))
		{
			$mname = str_replace(".", "_", $mdir);
			$tabControl->BeginNextFormTab();
			$tabControl->BeginCustomField("MODULE_TAB_".$mname, GetMessage($mname."_TAB"));
			include($ofile);
			$tabControl->EndCustomField("MODULE_TAB_".$mname);
		}
	}