예제 #1
0
if (!$USER->CanDoOperation('edit_php')) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$res = false;
if (strlen($Reindex) > 0 && check_bitrix_sessid()) {
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_js.php";
    if (strlen($Next) <= 0 || !CheckSerializedData($_REQUEST['NS'])) {
        $NS = array("max_execution_time" => $max_execution_time, "stepped" => $stepped, "max_file_size" => $max_file_size);
        if ($site_id != "") {
            $NS["SITE_ID"] = $site_id;
        }
    } else {
        $NS = unserialize($_REQUEST['NS']);
    }
    if (class_exists("\\Bitrix\\Main\\Application", false)) {
        $res = \Bitrix\Main\UrlRewriter::reindexAll($NS["stepped"] == "Y" ? $NS["max_execution_time"] : 0, $NS);
    } else {
        $res = CUrlRewriter::ReIndexAll($NS["stepped"] == "Y" ? $NS["max_execution_time"] : 0, $NS);
    }
    if (is_array($res)) {
        //$res["STAT"]=$NS["STAT"];
        //$res["STAT"][]=$res["CNT"]-$NS["CNT"];
        //$perfomance = "<br>",implode($res["STAT"],", ");
        CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("url_rewrite_mess_title"), "DETAILS" => GetMessage("MURL_REINDEX_TOTAL") . " <b>" . $res["CNT"] . "</b>", "HTML" => true, "TYPE" => "OK"));
        ?>
		<input type="hidden" id="NS" name="NS" value="<?php 
        echo htmlspecialcharsbx(serialize($res));
        ?>
">
	<?php 
    } else {