当前位置: 首页>>代码示例>>PHP>>正文


PHP CEventLog::GetList方法代码示例

本文整理汇总了PHP中CEventLog::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CEventLog::GetList方法的具体用法?PHP CEventLog::GetList怎么用?PHP CEventLog::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CEventLog的用法示例。


在下文中一共展示了CEventLog::GetList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getEventsLog

 /**
  * Return array with events list and users
  *
  * @param int $iblockId Info-block ID
  * @param int $elementId Info-block element ID
  * @param int $limit Limit returned rows
  * @return array (EVENTS => array(), USERS => array())
  */
 public static function getEventsLog($iblockId, $elementId, $limit = 0)
 {
     $arEvents = array();
     $arUsersId = array();
     $arUsers = array();
     $limit = intval($limit);
     if ($limit > 0) {
         $rsEventsNav = array('nTopCount' => $limit);
     } else {
         $rsEventsNav = false;
     }
     $rsEvents = \CEventLog::GetList(array('ID' => 'DESC'), array('MODULE_ID' => 'iblock', 'ITEM_ID' => $iblockId), $rsEventsNav);
     while ($arEvent = $rsEvents->Fetch()) {
         $arEventDesc = unserialize($arEvent['DESCRIPTION']);
         if ($arEventDesc['ID'] === $elementId) {
             $arEvents[] = array_merge($arEvent, array('DESCRIPTION' => $arEventDesc));
             $arUsersId[] = $arEventDesc['USER_ID'];
         }
     }
     if (!empty($arUsersId)) {
         $rsUsers = \CUser::GetList($by = 'id', $order = 'asc', array('ID' => $arUsersId), array('FIELDS' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME')));
         while ($arUser = $rsUsers->Fetch()) {
             $arUsers[$arUser['ID']] = $arUser;
         }
     }
     return array('EVENTS' => $arEvents, 'USERS' => $arUsers);
 }
开发者ID:ASDAFF,项目名称:nik.elementary,代码行数:35,代码来源:helpers.php

示例2: array

 if ($arFilter["MODULE_ITEM"] != "") {
     $arEventFilter["=MODULE_ITEM"] = $arFilter["MODULE_ITEM"];
 }
 if ($arParams["LOG_DATE_FROM"] != "") {
     $arEventFilter["TIMESTAMP_X_1"] = $arParams["LOG_DATE_FROM"] . " 00.00.00";
 }
 if ($arParams["LOG_DATE_TO"] != "") {
     $arEventFilter["TIMESTAMP_X_2"] = $arParams["LOG_DATE_TO"] . " 23.59.59";
 }
 $arEventFilter["USER_ID"] = $find != '' && $find_type == "user_id" ? $find : $find_user_id;
 $nameFormat = CSite::GetNameFormat(false);
 $dateFormat = CSite::GetDateFormat('SHORT');
 $timeFormat = CSite::GetTimeFormat();
 $arUsersTmp = array();
 $arNavParams = array("nPageSize" => $arParams["PAGE_NUM"], "bShowAll" => false);
 $results = CEventLog::GetList(array('TIMESTAMP_X' => 'DESC'), $arEventFilter, $arNavParams);
 $results->NavStart($arNavParams);
 //page navigation
 $arResult["NAV"] = $results;
 while ($row = $results->NavNext()) {
     if (!isset($arUsersTmp[$row['USER_ID']])) {
         $arUserInfo = array();
         $rsUser = CUser::GetList($by = "", $ord = "", array("ID_EQUAL_EXACT" => intval($row['USER_ID'])), array("FIELDS" => array('ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL', 'PERSONAL_PHOTO')));
         if ($arUser = $rsUser->GetNext()) {
             $arUserInfo["ID"] = $row['USER_ID'];
             $arUserInfo["FULL_NAME"] = CUser::FormatName($nameFormat, $arUser, true, false);
             $arUserInfo['avatar'] = CFile::ResizeImageGet($arUser["PERSONAL_PHOTO"], array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_EXACT, false);
             $arUsersTmp[$row['USER_ID']] = $arUserInfo;
         }
     } else {
         $arUserInfo = $arUsersTmp[$row['USER_ID']];
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例3: array

    } else {
        $audit_type_id_op = "";
        $audit_type_id_filter = $find_audit_type;
    }
    if (!is_array($audit_type_id_filter) && strlen($find_audit_type_id)) {
        $audit_type_id_op = "";
        $audit_type_id_filter = "(" . $audit_type_id_filter . ")|(" . $find_audit_type_id . ")";
    }
    $arFilter = array("TIMESTAMP_X_1" => $find_timestamp_x_1, "TIMESTAMP_X_2" => $find_timestamp_x_2, "SEVERITY" => is_array($find_severity) && count($find_severity) > 0 ? implode("|", $find_severity) : "", $audit_type_id_op . "AUDIT_TYPE_ID" => $audit_type_id_filter, "MODULE_ID" => $find_module_id, "ITEM_ID" => $find_item_id, "SITE_ID" => $find_site_id, "USER_ID" => $find != '' && $find_type == "user_id" ? $find : $find_user_id, "GUEST_ID" => $find_guest_id, "REMOTE_ADDR" => $find != '' && $find_type == "remote_addr" ? $find : $find_remote_addr, "REQUEST_URI" => $find_request_uri, "USER_AGENT" => $find != '' && $find_type == "user_agent" ? $find : $find_user_agent);
}
if (isset($_REQUEST["mode"]) && $_REQUEST["mode"] == "excel") {
    $arNavParams = false;
} else {
    $arNavParams = array("nPageSize" => CAdminResult::GetNavSize($sTableID));
}
$rsData = CEventLog::GetList(array($_REQUEST["by"] => $_REQUEST["order"]), $arFilter, $arNavParams);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("MAIN_EVENTLOG_LIST_PAGE")));
$arHeaders = array(array("id" => "ID", "content" => GetMessage("MAIN_EVENTLOG_ID"), "sort" => "ID", "default" => true, "align" => "right"), array("id" => "TIMESTAMP_X", "content" => GetMessage("MAIN_EVENTLOG_TIMESTAMP_X"), "sort" => "TIMESTAMP_X", "default" => true, "align" => "right"), array("id" => "SEVERITY", "content" => GetMessage("MAIN_EVENTLOG_SEVERITY")), array("id" => "AUDIT_TYPE_ID", "content" => GetMessage("MAIN_EVENTLOG_AUDIT_TYPE_ID"), "default" => true), array("id" => "MODULE_ID", "content" => GetMessage("MAIN_EVENTLOG_MODULE_ID")), array("id" => "ITEM_ID", "content" => GetMessage("MAIN_EVENTLOG_ITEM_ID"), "default" => true), array("id" => "REMOTE_ADDR", "content" => GetMessage("MAIN_EVENTLOG_REMOTE_ADDR"), "default" => true), array("id" => "USER_AGENT", "content" => GetMessage("MAIN_EVENTLOG_USER_AGENT")), array("id" => "REQUEST_URI", "content" => GetMessage("MAIN_EVENTLOG_REQUEST_URI"), "default" => true), array("id" => "SITE_ID", "content" => GetMessage("MAIN_EVENTLOG_SITE_ID")), array("id" => "USER_ID", "content" => GetMessage("MAIN_EVENTLOG_USER_ID"), "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage("MAIN_EVENTLOG_DESCRIPTION"), "default" => true));
if ($bStatistic) {
    $arHeaders[] = array("id" => "GUEST_ID", "content" => GetMessage("MAIN_EVENTLOG_GUEST_ID"));
}
$lAdmin->AddHeaders($arHeaders);
$arUsersCache = array();
$arGroupsCache = array();
$arForumCache = array("FORUM" => array(), "TOPIC" => array(), "MESSAGE" => array());
$a_ID = $a_AUDIT_TYPE_ID = $a_GUEST_ID = $a_USER_ID = $a_ITEM_ID = $a_REQUEST_URI = $a_DESCRIPTION = $a_REMOTE_ADDR = '';
while ($db_res = $rsData->NavNext(true, "a_")) {
    $row =& $lAdmin->AddRow($a_ID, $db_res);
    $row->AddViewField("AUDIT_TYPE_ID", array_key_exists($a_AUDIT_TYPE_ID, $arAuditTypes) ? preg_replace("/^\\[.*?\\]\\s+/", "", $arAuditTypes[$a_AUDIT_TYPE_ID]) : $a_AUDIT_TYPE_ID);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:event_log.php

示例4: array

$data['very_high']['ITEMS'][] = array("IS_OK" => $bSecurityAV, "KPI_NAME" => GetMessage("SEC_PANEL_ANTIVIRUS_NAME"), "KPI_VALUE" => $bSecurityAV ? GetMessage("SEC_PANEL_ANTIVIRUS_VALUE_ON") : GetMessage("SEC_PANEL_ANTIVIRUS_VALUE_OFF"), "KPI_RECOMMENDATION" => $bSecurityAV ? '&nbsp;' : ($USER->CanDoOperation('security_antivirus_settings_write') ? '<a href="security_antivirus.php?lang=' . LANGUAGE_ID . '&amp;return_url=' . urlencode('security_panel.php?lang=' . LANGUAGE_ID) . '">' . GetMessage("SEC_PANEL_ANTIVIRUS_RECOMMENDATION") . '</a>' : GetMessage("SEC_PANEL_ANTIVIRUS_RECOMMENDATION")));
$strSecurityAVAction = COption::GetOptionString("security", "antivirus_action");
$data['very_high']['ITEMS'][] = array("IS_OK" => $strSecurityAVAction !== "notify_only", "KPI_NAME" => GetMessage("SEC_PANEL_AV_ACTION_NAME"), "KPI_VALUE" => $strSecurityAVAction === "notify_only" ? GetMessage("SEC_PANEL_AV_ACTION_VALUE_NOTIFY") : GetMessage("SEC_PANEL_AV_ACTION_VALUE_ACT"), "KPI_RECOMMENDATION" => $strSecurityAVAction !== "notify_only" ? '&nbsp;' : ($USER->CanDoOperation('security_antivirus_settings_write') ? '<a href="security_antivirus.php?lang=' . LANGUAGE_ID . '&amp;return_url=' . urlencode('security_panel.php?lang=' . LANGUAGE_ID) . '&amp;tabControl_active_tab=params">' . GetMessage("SEC_PANEL_AV_ACTION_RECOMMENDATION") . '</a>' : GetMessage("SEC_PANEL_AV_ACTION_RECOMMENDATION")));
$rsSecurityWhiteList = CSecurityAntiVirus::GetWhiteList();
if ($rsSecurityWhiteList->Fetch()) {
    $bSecurityWhiteList = true;
} else {
    $bSecurityWhiteList = false;
}
$data['very_high']['ITEMS'][] = array("IS_OK" => !$bSecurityWhiteList, "KPI_NAME" => GetMessage("SEC_PANEL_AV_WHITE_LIST_NAME"), "KPI_VALUE" => $bSecurityWhiteList ? GetMessage("SEC_PANEL_AV_WHITE_LIST_VALUE_ON") : GetMessage("SEC_PANEL_AV_WHITE_LIST_VALUE_OFF"), "KPI_RECOMMENDATION" => !$bSecurityWhiteList ? '&nbsp;' : ($USER->CanDoOperation('security_antivirus_settings_write') ? '<a href="security_antivirus.php?lang=' . LANGUAGE_ID . '&amp;return_url=' . urlencode('security_panel.php?lang=' . LANGUAGE_ID) . '&amp;tabControl_active_tab=exceptions">' . GetMessage("SEC_PANEL_AV_WHITE_LIST_RECOMMENDATION") . '</a>' : GetMessage("SEC_PANEL_AV_WHITE_LIST_RECOMMENDATION")));
$days = COption::GetOptionInt("main", "event_log_cleanup_days", 7);
if ($days > 7) {
    $days = 7;
}
$cntLog = 0;
$rsLog = CEventLog::GetList(array(), array("TIMESTAMP_X_1" => ConvertTimeStamp(time() - $days * 24 * 3600 + CTimeZone::GetOffset(), "FULL"), "AUDIT_TYPE_ID" => "SECURITY_VIRUS"));
while ($rsLog->Fetch()) {
    $cntLog++;
}
$data['very_high']['ITEMS'][] = array("IS_OK" => true, "KPI_NAME" => GetMessage("SEC_PANEL_VIRUS_LOG_NAME", array("#DAYS#" => $days)), "KPI_VALUE" => $cntLog, "KPI_RECOMMENDATION" => $cntLog ? $USER->CanDoOperation('view_event_log') ? '<a href="event_log.php?lang=' . LANGUAGE_ID . '&amp;set_filter=Y&amp;find_type=audit_type_id&amp;find_audit_type[]=SECURITY_VIRUS&amp;mod=security">' . GetMessage("SEC_PANEL_VIRUS_LOG_RECOMMENDATION") . '</a>' : GetMessage("SEC_PANEL_VIRUS_LOG_RECOMMENDATION") : '&nbsp;');
function CheckLevel($arItems)
{
    $result = true;
    foreach ($arItems as $item) {
        if (!$item["IS_OK"]) {
            $result = false;
            break;
        }
    }
    return $result;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:security_panel.php

示例5: array

        $audit_type_id_filter = $find_audit_type;
    }
    if (!is_array($audit_type_id_filter) && strlen($find_audit_type_id)) {
        $audit_type_id_op = "";
        $audit_type_id_filter = "(" . $audit_type_id_filter . ")|(" . $find_audit_type_id . ")";
    }
    $arFilter = array("TIMESTAMP_X_1" => $find_timestamp_x_1, "TIMESTAMP_X_2" => $find_timestamp_x_2, "SEVERITY" => is_array($find_severity) && count($find_severity) > 0 ? implode("|", $find_severity) : "", $audit_type_id_op . "AUDIT_TYPE_ID" => $audit_type_id_filter, "MODULE_ID" => $find_module_id, "ITEM_ID" => $find_item_id, "SITE_ID" => $find_site_id, "USER_ID" => $find != '' && $find_type == "user_id" ? $find : $find_user_id, "GUEST_ID" => $find_guest_id, "REMOTE_ADDR" => $find != '' && $find_type == "remote_addr" ? $find : $find_remote_addr, "REQUEST_URI" => $find_request_uri, "USER_AGENT" => $find != '' && $find_type == "user_agent" ? $find : $find_user_agent);
}
if (isset($_REQUEST["mode"]) && $_REQUEST["mode"] == "excel") {
    $arNavParams = false;
} else {
    $arNavParams = array("nPageSize" => CAdminResult::GetNavSize($sTableID));
}
/** @global string $by  */
/** @global string $order  */
$rsData = CEventLog::GetList(array($by => $order), $arFilter, $arNavParams);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("MAIN_EVENTLOG_LIST_PAGE")));
$arHeaders = array(array("id" => "ID", "content" => GetMessage("MAIN_EVENTLOG_ID"), "sort" => "ID", "default" => true, "align" => "right"), array("id" => "TIMESTAMP_X", "content" => GetMessage("MAIN_EVENTLOG_TIMESTAMP_X"), "sort" => "TIMESTAMP_X", "default" => true, "align" => "right"), array("id" => "SEVERITY", "content" => GetMessage("MAIN_EVENTLOG_SEVERITY")), array("id" => "AUDIT_TYPE_ID", "content" => GetMessage("MAIN_EVENTLOG_AUDIT_TYPE_ID"), "default" => true), array("id" => "MODULE_ID", "content" => GetMessage("MAIN_EVENTLOG_MODULE_ID")), array("id" => "ITEM_ID", "content" => GetMessage("MAIN_EVENTLOG_ITEM_ID"), "default" => true), array("id" => "REMOTE_ADDR", "content" => GetMessage("MAIN_EVENTLOG_REMOTE_ADDR"), "default" => true), array("id" => "USER_AGENT", "content" => GetMessage("MAIN_EVENTLOG_USER_AGENT")), array("id" => "REQUEST_URI", "content" => GetMessage("MAIN_EVENTLOG_REQUEST_URI"), "default" => true), array("id" => "SITE_ID", "content" => GetMessage("MAIN_EVENTLOG_SITE_ID")), array("id" => "USER_ID", "content" => GetMessage("MAIN_EVENTLOG_USER_ID"), "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage("MAIN_EVENTLOG_DESCRIPTION"), "default" => true));
if ($bStatistic) {
    $arHeaders[] = array("id" => "GUEST_ID", "content" => GetMessage("MAIN_EVENTLOG_GUEST_ID"));
}
$lAdmin->AddHeaders($arHeaders);
$arUsersCache = array();
$arGroupsCache = array();
$arForumCache = array("FORUM" => array(), "TOPIC" => array(), "MESSAGE" => array());
$a_ID = $a_AUDIT_TYPE_ID = $a_GUEST_ID = $a_USER_ID = $a_ITEM_ID = $a_REQUEST_URI = $a_DESCRIPTION = $a_REMOTE_ADDR = '';
while ($db_res = $rsData->NavNext(true, "a_")) {
    $row =& $lAdmin->AddRow($a_ID, $db_res);
    $row->AddViewField("AUDIT_TYPE_ID", array_key_exists($a_AUDIT_TYPE_ID, $arAuditTypes) ? preg_replace("/^\\[.*?\\]\\s+/", "", $arAuditTypes[$a_AUDIT_TYPE_ID]) : $a_AUDIT_TYPE_ID);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:event_log.php


注:本文中的CEventLog::GetList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。