Example #1
0
    }
    return true;
}
$statDB = CDatabase::GetModuleConnection('statistic');
$err_mess = "FILE: " . __FILE__ . "<br>\nLINE: ";
$module_id = "statistic";
$STAT_RIGHT = $APPLICATION->GetGroupRight($module_id);
$strError = "";
if ($STAT_RIGHT >= "R") {
    $aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB_SET"), "ICON" => "statistic_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_SET")), array("DIV" => "edit6", "TAB" => GetMessage("STAT_OPT_TAB_ADV"), "ICON" => "statistic_settings", "TITLE" => GetMessage("STAT_OPT_TAB_ADV_TITLE")), array("DIV" => "edit7", "TAB" => GetMessage("STAT_OPT_TAB_CITY"), "ICON" => "statistic_settings", "TITLE" => GetMessage("STAT_OPT_TAB_CITY_TITLE")), array("DIV" => "edit2", "TAB" => GetMessage("STAT_OPT_TAB_STORAGE"), "ICON" => "statistic_settings", "TITLE" => GetMessage("STAT_OPT_TAB_STORAGE_TITLE")), array("DIV" => "edit3", "TAB" => GetMessage("STAT_OPT_TAB_TIME"), "ICON" => "statistic_settings", "TITLE" => GetMessage("STAT_OPT_TAB_TIME_TITLE")), array("DIV" => "edit4", "TAB" => GetMessage("STAT_OPT_TAB_SKIP"), "ICON" => "statistic_settings", "TITLE" => GetMessage("STAT_OPT_TAB_SKIP_TITLE")), array("DIV" => "edit5", "TAB" => GetMessage("MAIN_TAB_RIGHTS"), "ICON" => "statistic_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_RIGHTS")));
    $tabControl = new CAdminTabControl("tabControl", $aTabs);
    $aTabs = array(array("DIV" => "fedit2", "TAB" => GetMessage("STAT_OPT_TAB_CLEANUP"), "ICON" => "statistic_settings", "TITLE" => GetMessage("STAT_OPT_TAB_CLEANUP_TITLE")));
    if (strtolower($statDB->type) == "mysql") {
        $aTabs[] = array("DIV" => "fedit3", "TAB" => GetMessage("STAT_OPT_TAB_OPTIMIZE"), "ICON" => "statistic_settings", "TITLE" => GetMessage("STAT_OPT_TAB_OPTIMIZE_TITLE"));
    }
    if ($STAT_RIGHT >= "W" && ($bCheckForDDL = CStatistics::CheckForDDL())) {
        $aTabs[] = array("DIV" => "fedit4", "TAB" => GetMessage("STAT_OPT_TAB_INDEX"), "ICON" => "statistic_settings", "TITLE" => GetMessage("STAT_OPT_TAB_INDEX_TITLE"));
    }
    $tabControl2 = new CAdminTabControl("tabControl2", $aTabs, true, true);
    if ($REQUEST_METHOD == "POST" && $STAT_RIGHT == "W" && strlen($RestoreDefaults) > 0 && check_bitrix_sessid()) {
        COption::RemoveOption($module_id);
        $z = CGroup::GetList($v1 = "id", $v2 = "asc", array("ACTIVE" => "Y", "ADMIN" => "N"));
        while ($zr = $z->Fetch()) {
            $APPLICATION->DelGroupRight($module_id, array($zr["ID"]));
        }
        LocalRedirect($APPLICATION->GetCurPage() . "?mid=" . urlencode($mid) . "&lang=" . urlencode(LANGUAGE_ID) . "&back_url_settings=" . urlencode($_REQUEST["back_url_settings"]) . "&" . $tabControl->ActiveTabParam());
    }
    $cookie_name = COption::GetOptionString("main", "cookie_name", "BITRIX_SM");
    $arOPTIONS = array("TAB1" => array("ONLINE_INTERVAL" => array("ONLINE_INTERVAL", GetMessage("STAT_OPT_ONLINE_INTERVAL"), array("text", 5)), "RECORDS_LIMIT" => array("RECORDS_LIMIT", GetMessage("STAT_OPT_RECORDS_LIMIT"), array("text", 5)), "GRAPH_WEIGHT" => array("GRAPH_WEIGHT", GetMessage("STAT_OPT_GRAPH_WEIGHT"), array("text", 5)), "GRAPH_HEIGHT" => array("GRAPH_HEIGHT", GetMessage("STAT_OPT_GRAPH_HEIGHT"), array("text", 5)), "DIAGRAM_DIAMETER" => array("DIAGRAM_DIAMETER", GetMessage("STAT_OPT_DIAGRAM_DIAMETER"), array("text", 5)), "STAT_LIST_TOP_SIZE" => array("STAT_LIST_TOP_SIZE", GetMessage("STAT_OPT_STAT_LIST_TOP_SIZE"), array("text", 5)), "ADV_DETAIL_TOP_SIZE" => array("ADV_DETAIL_TOP_SIZE", GetMessage("STAT_OPT_ADV_DETAIL_TOP_SIZE"), array("text", 5)), "SAVE_SESSION_DATA" => array("SAVE_SESSION_DATA", GetMessage("STAT_OPT_SAVE_SESSION_DATA"), array("checkbox", "Y")), "USE_AUTO_OPTIMIZE" => "", "BASE_CURRENCY" => ""), "TAB2" => array(1 => GetMessage("STAT_OPT_TIME_TRAFFIC_SECTION"), "VISIT_DAYS" => array("VISIT_DAYS", GetMessage("STAT_OPT_TIME_VISIT_DAYS"), array("text", 5), "CStatistics::CleanUpVisits();", "b_stat_page, b_stat_page_adv"), "PATH_DAYS" => array("PATH_DAYS", GetMessage("STAT_OPT_TIME_PATH_DAYS"), array("text", 5), "CStatistics::CleanUpPathDynamic();", "b_stat_path, b_stat_path_adv"), 2 => GetMessage("STAT_OPT_TIME_REFERER_SECTION"), "PHRASES_DAYS" => array("PHRASES_DAYS", GetMessage("STAT_OPT_TIME_PHRASES_DAYS"), array("text", 5), "CStatistics::CleanUpPhrases();", "b_stat_phrase_list"), "REFERER_LIST_DAYS" => array("REFERER_LIST_DAYS", GetMessage("STAT_OPT_TIME_REFERER_LIST_DAYS"), array("text", 5), "CStatistics::CleanUpRefererList();", "b_stat_referer_list"), "REFERER_DAYS" => array("REFERER_DAYS", GetMessage("STAT_OPT_TIME_REFERER_DAYS"), array("text", 5), "CStatistics::CleanUpReferer();", "b_stat_referer"), 3 => GetMessage("STAT_OPT_TIME_EVENTS_SECTION"), "EVENTS_DAYS" => array("EVENTS_DAYS", GetMessage("STAT_OPT_TIME_EVENTS_DAYS"), array("text", 5), "CStatistics::CleanUpEvents();", "b_stat_event_list"), "EVENT_DYNAMIC_DAYS" => array("EVENT_DYNAMIC_DAYS", GetMessage("STAT_OPT_TIME_EVENTS_DYNAMIC_DAYS"), array("text", 5), "CStatistics::CleanUpEventDynamic();", "b_stat_event_day"), 4 => GetMessage("STAT_OPT_TIME_ADV_SECTION"), "ADV_GUEST_DAYS" => array("ADV_GUEST_DAYS", GetMessage("STAT_OPT_TIME_ADV_GUEST_DAYS"), array("text", 5), "CStatistics::CleanUpAdvGuests();", "b_stat_adv_guest"), "ADV_DAYS" => array("ADV_DAYS", GetMessage("STAT_OPT_TIME_ADV_DAYS"), array("text", 5), "CStatistics::CleanUpAdvDynamic();", "b_stat_adv_day, b_stat_adv_event_day"), 5 => GetMessage("STAT_OPT_TIME_SEARCHER_SECTION"), "SEARCHER_HIT_DAYS" => array("SEARCHER_HIT_DAYS", GetMessage("STAT_OPT_TIME_SEARCHER_HIT_DAYS"), array("text", 5), "CStatistics::CleanUpSearcherHits();", "b_stat_searcher_hit"), "SEARCHER_DAYS" => array("SEARCHER_DAYS", GetMessage("STAT_OPT_TIME_SEARCHER_DAYS"), array("text", 5), "CStatistics::CleanUpSearcherDynamic();", "b_stat_searcher_day"), 6 => GetMessage("STAT_OPT_TIME_GEO_SECTION"), "CITY_DAYS" => array("COUNTRY_DAYS", GetMessage("STAT_OPT_TIME_CITY_DAYS"), array("text", 5), "CStatistics::CleanUpCities();", "b_stat_city_day"), "COUNTRY_DAYS" => array("COUNTRY_DAYS", GetMessage("STAT_OPT_TIME_COUNTRY_DAYS"), array("text", 5), "CStatistics::CleanUpCountries();", "b_stat_country_day"), 7 => GetMessage("STAT_OPT_TIME_GUEST_SECTION"), "GUEST_DAYS" => array("GUEST_DAYS", GetMessage("STAT_OPT_TIME_GUEST_DAYS"), array("text", 5), "CStatistics::CleanUpGuests();", "b_stat_guest"), 8 => GetMessage("STAT_OPT_TIME_SESSION_SECTION"), "SESSION_DAYS" => array("SESSION_DAYS", GetMessage("STAT_OPT_TIME_SESSION_DAYS"), array("text", 5), "CStatistics::CleanUpSessions();", "b_stat_session"), 9 => GetMessage("STAT_OPT_TIME_HIT_TITLE"), "HIT_DAYS" => array("HIT_DAYS", GetMessage("STAT_OPT_TIME_HIT_DAYS"), array("text", 5), "CStatistics::CleanUpHits();", "b_stat_hit")), "TAB3" => array(1 => GetMessage("STAT_OPT_STORAGE_TRAFFIC_SECTION"), "SAVE_VISITS" => array("SAVE_VISITS", GetMessage("STAT_OPT_STORAGE_SAVE_VISITS"), array("checkbox", "Y")), "SAVE_PATH_DATA" => array("SAVE_PATH_DATA", GetMessage("STAT_OPT_STORAGE_SAVE_PATH_DATA"), array("checkbox", "Y")), "MAX_PATH_STEPS" => array("MAX_PATH_STEPS", GetMessage("STAT_OPT_STORAGE_MAX_PATH_STEPS"), array("text", 5)), "IMPORTANT_PAGE_PARAMS" => array("IMPORTANT_PAGE_PARAMS", GetMessage("STAT_OPT_STORAGE_IMPORTANT_PAGE_PARAMS"), array("text", 40)), "DIRECTORY_INDEX" => array("DIRECTORY_INDEX", GetMessage("STAT_OPT_STORAGE_DIRECTORY_INDEX"), array("text", 40)), 2 => GetMessage("STAT_OPT_STORAGE_SEARCHER_SECTION"), "BROWSERS" => "", 3 => GetMessage("STAT_OPT_STORAGE_EVENTS_SECTION"), "EVENT_GID_BASE64_ENCODE" => array("EVENT_GID_BASE64_ENCODE", GetMessage("STAT_OPT_STORAGE_EVENT_GID_BASE64_ENCODE"), array("checkbox", "Y")), "EVENT_GID_SITE_ID" => array("EVENT_GID_SITE_ID", GetMessage("STAT_OPT_STORAGE2_EVENT_GID_SITE_ID", array("#HREF#" => '/bitrix/admin/event_edit.php?lang=' . LANGUAGE_ID)), array("text", 20)), "USER_EVENTS_LOAD_HANDLERS_PATH" => array("USER_EVENTS_LOAD_HANDLERS_PATH", GetMessage("STAT_OPT_STORAGE2_USER_EVENTS_LOAD_HANDLERS_PATH", array("#HREF#" => '/bitrix/admin/event_edit.php?lang=' . LANGUAGE_ID)), array("text", 40)), 4 => GetMessage("STAT_OPT_STORAGE_REFERER_SECTION"), "SAVE_REFERERS" => array("SAVE_REFERERS", GetMessage("STAT_OPT_STORAGE_SAVE_REFERERS"), array("checkbox", "Y")), "REFERER_TOP" => array("REFERER_TOP", GetMessage("STAT_OPT_STORAGE_REFERER_TOP"), array("text", 5)), 5 => GetMessage("STAT_OPT_STORAGE_HIT_SECTION"), "SAVE_HITS" => array("SAVE_HITS", GetMessage("STAT_OPT_STORAGE_SAVE_HITS"), array("checkbox", "Y"))), "TAB4" => array("SKIP_STATISTIC_WHAT" => "", "SKIP_STATISTIC_GROUPS" => "", "SKIP_STATISTIC_IP_RANGES" => ""), "TAB5" => array("ADV_NA" => array("ADV_NA", GetMessage("STAT_OPT_ADV_USE_DEFAULT_ADV"), array("checkbox", "Y")), "ADV_AUTO_CREATE" => array("ADV_AUTO_CREATE", GetMessage("STAT_OPT_ADV_AUTO_CREATE"), array("checkbox", "Y")), "REFERER_CHECK" => array("REFERER_CHECK", GetMessage("STAT_OPT_REFERER_CHECK2"), array("checkbox", "Y")), "SEARCHER_EVENTS" => array("SEARCHER_EVENTS", GetMessage("STAT_OPT_SEARCHER_EVENTS"), array("checkbox", "Y")), "REFERER1_SYN" => array("REFERER1_SYN", GetMessage("STAT_OPT_ADV_REFERER1_SYN"), array("text", 30)), "REFERER2_SYN" => array("REFERER2_SYN", GetMessage("STAT_OPT_ADV_REFERER2_SYN"), array("text", 30)), "REFERER3_SYN" => array("REFERER3_SYN", GetMessage("STAT_OPT_ADV_REFERER3_SYN"), array("text", 30)), "ADV_EVENTS_DEFAULT" => "", 1 => GetMessage("STAT_OPT_ADV_OPENSTAT_SECTION"), "OPENSTAT_ACTIVE" => array("OPENSTAT_ACTIVE", GetMessage("STAT_OPT_ADV_OPENSTAT_ACTIVE"), array("checkbox", "N")), "OPENSTAT_R1_TEMPLATE" => array("OPENSTAT_R1_TEMPLATE", GetMessage("STAT_OPT_ADV_OPENSTAT_R1_TEMPLATE"), array("text", 30)), "OPENSTAT_R2_TEMPLATE" => array("OPENSTAT_R2_TEMPLATE", GetMessage("STAT_OPT_ADV_OPENSTAT_R2_TEMPLATE"), array("text", 30))));
    if ($REQUEST_METHOD == "POST" && strlen($Update . $Apply) > 0 && $STAT_RIGHT >= "W" && check_bitrix_sessid()) {
        if (CheckFDate($next_exec, GetMessage("STAT_OPT_WRONG_NEXT_EXEC"))) {
Example #2
0
<?php

define("ADMIN_MODULE_NAME", "statistic");
define("ADMIN_MODULE_ICON", "<a href=\"stat_list.php?lang=" . LANG . "\"><img src=\"/bitrix/images/statistic/statistic.gif\" width=\"48\" height=\"48\" border=\"0\" alt=\"" . GetMessage("STAT_MODULE_TITLE") . "\" title=\"" . GetMessage("STAT_MODULE_TITLE") . "\"></a>");
$message = null;
if (CModule::IncludeModule('statistic')) {
    if (!$message && CStatistics::CheckForDDL()) {
        $message = new CAdminMessage(array("MESSAGE" => GetMessage("STAT_NEW_INDEXES_NOT_INSTALLED") . ' <a href="settings.php?lang=' . LANG . '&amp;mid=statistic&amp;tabControl2_active_tab=fedit4#services">' . GetMessage("STAT_NEW_INDEXES_INSTALL") . '</a>', "TYPE" => "ERROR", "HTML" => true));
    }
    if (!$message && CModule::IncludeModule("currency")) {
        $base_currency = GetStatisticBaseCurrency();
        if (strlen($base_currency) <= 0) {
            $message = new CAdminMessage(array("MESSAGE" => GetMessage("STAT_BASE_CURRENCY_NOT_INSTALLED") . ' <a href="settings.php?lang=' . LANG . '&amp;mid=statistic">(' . GetMessage("STAT_CHOOSE_CURRENCY") . ')</a>', "TYPE" => "ERROR", "HTML" => true));
        }
    }
}