• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CEventLog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addRecord

 /**
  * @param int $level Record level.
  * @param string $type Record type.
  * @param string $itemId Identifier of record object.
  * @param string $description Record description.
  * @return bool
  * @throws \Bitrix\Main\SystemException
  */
 public function addRecord($level, $type, $itemId, $description)
 {
     if ($this->logLevel < $level || $level == static::LOG_LEVEL_DISABLE) {
         return false;
     }
     if (!array_key_exists($level, $this->severities)) {
         throw new SystemException("Unknown type of severity: " . $level . ". " . __METHOD__);
     }
     $eventLog = new \CEventLog();
     return $eventLog->Add(array("SEVERITY" => $this->severities[$level], "AUDIT_TYPE_ID" => $type, "MODULE_ID" => "sale", "ITEM_ID" => $itemId, "DESCRIPTION" => $description));
 }
开发者ID:Satariall,项目名称:izurit,代码行数:19,代码来源:logger.php


示例2: dbg2EventLog

 /**
  * @param mixed                 $data
  * @param bool | string | false $die
  * @param string                $msg
  *
  * @return null
  */
 public static function dbg2EventLog($data, $die = false, $msg = 'DEBUG')
 {
     if (!is_bool($die)) {
         $msg = $die;
         $die = false;
     }
     $sDebug = self::_debugmessage($data);
     $oEventLog = new \CEventLog();
     $oEventLog->Add(array("SEVERITY" => "SECURITY", "AUDIT_TYPE_ID" => "DEBUG_MESSAGE", "MODULE_ID" => "DEBUG", "ITEM_ID" => $msg, "DESCRIPTION" => $sDebug));
     if ($die && self::isValidIP()) {
         die;
     }
 }
开发者ID:Varfann,项目名称:bx-features,代码行数:20,代码来源:dbg.php


示例3: 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


示例4: custom_mail

 /**
  * @see CEvent::HandleEvent()
  * @see bxmail()
  *
  * @param string $to
  * @param string $subject
  * @param string $message
  * @param string $additionalHeaders Additional headers setted by Bitrix.
  *
  * @return bool
  */
 function custom_mail($to, $subject, $message, $additionalHeaders = '')
 {
     // Cache to send many mails in one script run.
     static $transport, $sender;
     try {
         if (!$sender) {
             if (!$transport) {
                 $host = COption::GetOptionString('sh.mailtransport', 'host');
                 if (COption::GetOptionInt('sh.mailtransport', 'ssl')) {
                     $host = 'ssl://' . $host;
                 }
                 $port = COption::GetOptionInt('sh.mailtransport', 'port');
                 $user = COption::GetOptionString('sh.mailtransport', 'username');
                 $password = COption::GetOptionString('sh.mailtransport', 'password');
                 $transport = new Net_SMTP($host, $port);
                 if (PEAR::isError($connectionResult = $transport->connect())) {
                     throw new Capall_MailTransportException($connectionResult);
                 }
                 // TODO Server without authentication?..
                 if (PEAR::isError($authenticationResult = $transport->auth($user, $password))) {
                     throw new Capall_MailTransportException($authenticationResult);
                 }
             }
             $sender = new Capall_MailTransport_Sender($transport);
         }
         $sender->send($to, $subject, $message, $additionalHeaders);
         return true;
     } catch (Capall_MailTransportException $error) {
         CEventLog::Log('WARNING', 'MAILTRANSPORT_ERROR', 'sh.mailtransport', null, $error->__toString());
         return false;
     } catch (Exception $error) {
         // Unknown error...
         return false;
     }
 }
开发者ID:alexeyshockov,项目名称:bitrix-mail-transport,代码行数:46,代码来源:include.php


示例5: BXCreateSection

function BXCreateSection(&$fileContent, &$sectionFileContent, &$absoluteFilePath, &$sectionPath)
{
    //Check quota
    $quota = new CDiskQuota();
    if (!$quota->CheckDiskQuota(array("FILE_SIZE" => strlen($fileContent) + strlen($sectionFileContent)))) {
        $GLOBALS["APPLICATION"]->ThrowException($quota->LAST_ERROR, "BAD_QUOTA");
        return false;
    }
    $io = CBXVirtualIo::GetInstance();
    //Create dir
    if (!$io->CreateDirectory($absoluteFilePath)) {
        $GLOBALS["APPLICATION"]->ThrowException(GetMessage("PAGE_NEW_FOLDER_CREATE_ERROR") . "<br /> (" . htmlspecialcharsbx($absoluteFilePath) . ")", "DIR_NOT_CREATE");
        return false;
    }
    //Create .section.php
    $f = $io->GetFile($absoluteFilePath . "/.section.php");
    if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/.section.php", $sectionFileContent)) {
        return false;
    }
    //Create index.php
    if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/index.php", $fileContent)) {
        return false;
    } else {
        if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
            $res_log['path'] = $sectionPath . "/index.php";
            CEventLog::Log("content", "PAGE_ADD", "main", "", serialize($res_log));
        }
    }
    return true;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:30,代码来源:file_new.php


示例6: put

 public function put()
 {
     if ($this->_stateSaved) {
         throw new \Exception("Log instance saved before");
     }
     $this->_stateSaved = true;
     return \CEventLog::Log($this->_severity, $this->_type, $this->_moduleId, $this->_itemId, $this->_description);
 }
开发者ID:Under5,项目名称:bitrix-module-tools,代码行数:8,代码来源:log.php


示例7: Log

 static function Log($object, $action, $id, $description)
 {
     if (!COption::GetOptionString("webdav", "webdav_log", "N") == "Y") {
         return;
     }
     $type = CWebDavEventLog::_name($object, $action);
     CEventLog::Log("NOTICE", $type, "webdav", $id, $description);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:event_log.php


示例8: addRecord

 /**
  * @param $level
  * @param $auditType
  * @param $itemId
  * @param $description
  * @return bool
  */
 public static function addRecord($level, $auditType, $itemId, $description)
 {
     if ($level == self::LOG_LEVEL_ERROR) {
         $severity = "ERROR";
     } elseif ($level == self::LOG_LEVEL_INFO) {
         $severity = "INFO";
     } elseif ($level == self::LOG_LEVEL_DEBUG) {
         $severity = "DEBUG";
     } else {
         $severity = "UNKNOWN";
     }
     \CEventLog::Add(array("SEVERITY" => $severity, "AUDIT_TYPE_ID" => $auditType, "MODULE_ID" => "scale", "ITEM_ID" => $itemId, "DESCRIPTION" => $description));
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:21,代码来源:logger.php


示例9: Request

 function Request($server, $page, $port, $params, $uri = false)
 {
     if ($uri && strlen($uri) > 0) {
         $strURI = $uri;
     } else {
         $strURI = "http://" . $server . (strlen($port) > 0 && intval($port) > 0 ? ":" . intval($port) : "") . (strlen($page) ? $page : "/") . (strlen($params) > 0 ? "?" . $params : "");
     }
     $http = new \Bitrix\Main\Web\HttpClient(array("version" => "1.0", "socketTimeout" => 30, "streamTimeout" => 30, "redirect" => true, "redirectMax" => 5));
     $strData = $http->get($strURI);
     $errors = $http->getError();
     $arRSSResult = array();
     if (!$strData && !empty($errors)) {
         $strError = "";
         foreach ($errors as $errorCode => $errMes) {
             $strError .= $errorCode . ": " . $errMes;
         }
         \CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "XDIMPORT_HTTP", "MODULE_ID" => "xdimport", "ITEM_ID" => "RSS_REQUEST", "DESCRIPTION" => $strError));
     }
     if ($strData) {
         $rss_charset = "windows-1251";
         if (preg_match("/<" . "\\?XML[^>]{1,}encoding=[\"']([^>\"']{1,})[\"'][^>]{0,}\\?" . ">/i", $strData, $matches)) {
             $rss_charset = Trim($matches[1]);
         }
         $strData = preg_replace("/<" . "\\?XML.*?\\?" . ">/i", "", $strData);
         $strData = $GLOBALS["APPLICATION"]->ConvertCharset($strData, $rss_charset, SITE_CHARSET);
     }
     if (strlen($strData) > 0) {
         require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/xml.php";
         $objXML = new CDataXML();
         $res = $objXML->LoadString($strData);
         if ($res !== false) {
             $ar = $objXML->GetArray();
             if (is_array($ar) && isset($ar["rss"]) && is_array($ar["rss"]) && isset($ar["rss"]["#"]) && is_array($ar["rss"]["#"]) && isset($ar["rss"]["#"]["channel"]) && is_array($ar["rss"]["#"]["channel"]) && isset($ar["rss"]["#"]["channel"][0]) && is_array($ar["rss"]["#"]["channel"][0]) && isset($ar["rss"]["#"]["channel"][0]["#"])) {
                 $arRSSResult = $ar["rss"]["#"]["channel"][0]["#"];
             } else {
                 $arRSSResult = array();
             }
             $arRSSResult["rss_charset"] = strtolower(SITE_CHARSET);
         }
     }
     if (is_array($arRSSResult) && !empty($arRSSResult)) {
         $arRSSResult = CXDILFSchemeRSS::FormatArray($arRSSResult);
         if (!empty($arRSSResult) && array_key_exists("item", $arRSSResult) && is_array($arRSSResult["item"]) && !empty($arRSSResult["item"])) {
             $arRSSResult["item"] = array_reverse($arRSSResult["item"]);
         }
     }
     return $arRSSResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:48,代码来源:lf_scheme_rss.php


示例10: Log

 function Log($object, $action, $id, $description = "", $title = "")
 {
     if (COption::GetOptionString("forum", "LOGS", "Q") <= "A") {
         return false;
     }
     $arTypesTitle = array("FORUM_MESSAGE_APPROVE" => GetMessage("FORUM_MESSAGE_APPROVE"), "FORUM_MESSAGE_UNAPPROVE" => GetMessage("FORUM_MESSAGE_UNAPPROVE"), "FORUM_MESSAGE_MOVE" => GetMessage("FORUM_MESSAGE_MOVE"), "FORUM_MESSAGE_EDIT" => GetMessage("FORUM_MESSAGE_EDIT"), "FORUM_MESSAGE_DELETE" => GetMessage("FORUM_MESSAGE_DELETE"), "FORUM_MESSAGE_SPAM" => GetMessage("FORUM_MESSAGE_SPAM"), "FORUM_TOPIC_APPROVE" => GetMessage("FORUM_TOPIC_APPROVE"), "FORUM_TOPIC_UNAPPROVE" => GetMessage("FORUM_TOPIC_UNAPPROVE"), "FORUM_TOPIC_STICK" => GetMessage("FORUM_TOPIC_STICK"), "FORUM_TOPIC_UNSTICK" => GetMessage("FORUM_TOPIC_UNSTICK"), "FORUM_TOPIC_OPEN" => GetMessage("FORUM_TOPIC_OPEN"), "FORUM_TOPIC_CLOSE" => GetMessage("FORUM_TOPIC_CLOSE"), "FORUM_TOPIC_MOVE" => GetMessage("FORUM_TOPIC_MOVE"), "FORUM_TOPIC_EDIT" => GetMessage("FORUM_TOPIC_EDIT"), "FORUM_TOPIC_DELETE" => GetMessage("FORUM_TOPIC_DELETE"), "FORUM_TOPIC_SPAM" => GetMessage("FORUM_TOPIC_SPAM"), "FORUM_FORUM_EDIT" => GetMessage("FORUM_FORUM_EDIT"), "FORUM_FORUM_DELETE" => GetMessage("FORUM_FORUM_DELETE"));
     $object = strToUpper($object);
     $action = strToUpper($action);
     $type = "FORUM_" . $object . "_" . $action;
     $title = trim($title);
     if (empty($title)) {
         $title = $arTypesTitle[$type];
     }
     $description = trim($description);
     CEventLog::Log("NOTICE", $type, "forum", $id, $description);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:16,代码来源:event_log.php


示例11: doLog

 /**
  * @param string $severity
  * @param string $auditType
  * @param string $itemName
  * @param string $itemDescription
  * @return bool
  */
 public function doLog($severity, $auditType, $itemName, $itemDescription)
 {
     $savedInDB = $savedInFile = $savedInSyslog = false;
     if ($this->isDBEngineActive) {
         $savedInDB = CEventLog::log($severity, $auditType, "security", $itemName, base64_encode($itemDescription));
     }
     $message = "";
     if ($this->isSyslogEngineActive) {
         $message = $this->messageFormatter->format($auditType, $itemName, $itemDescription);
         $savedInSyslog = syslog($this->syslogPriority, $message);
     }
     if ($this->isFileEngineActive) {
         if (!$message) {
             $message = $this->messageFormatter->format($auditType, $itemName, $itemDescription);
         }
         $message .= "\n";
         $savedInFile = file_put_contents($this->filePath, $message, FILE_APPEND) > 0;
     }
     return $savedInDB || $savedInSyslog || $savedInFile;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:27,代码来源:event.php


示例12: foreach

             $arOffersOldFields = CIBlock::GetFields($OF_IBLOCK_ID);
             $arOffersFields["FIELDS"] = $arOffersOldFields;
             foreach ($arLogFields as $keyLogField => $valueLogField) {
                 $arOffersFields["FIELDS"][$keyLogField] = $valueLogField;
             }
         }
         $obIBlock = new CIBlock();
         $mxOffersID = $obIBlock->Update($OF_IBLOCK_ID, $arOffersFields);
         if (false == $mxOffersID) {
             $strWarning .= $obIBlock->LAST_ERROR . "<br>";
             $bVarsFromForm = true;
         } else {
             $res_log = array();
             $res_log['NAME'] = CIBlock::GetArrayByID($OF_IBLOCK_ID, 'NAME');
             if (COption::GetOptionString("iblock", "event_log_iblock", "N") === "Y") {
                 CEventLog::Log("IBLOCK", "IBLOCK_EDIT", "iblock", $OF_IBLOCK_ID, serialize($res_log));
             }
         }
     } else {
         $strWarning .= str_replace(array('#ID#'), array($OF_IBLOCK_ID), GetMessage('IB_E_RIGHTS_IBLOCK_ACCESS_DENIED')) . '<br>';
         $bVarsFromForm = true;
     }
 }
 if (!$bVarsFromForm) {
     $arSKUProp = CheckSKUProperty($ID, $OF_IBLOCK_ID);
     if ('OK' == $arSKUProp['RESULT']) {
         $intSKUPropID = $arSKUProp['VALUE'];
     } else {
         $bVarsFromForm = true;
         $strWarning .= $arSKUProp['MESSAGE'] . '<br>';
     }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:iblock_edit.php


示例13: unserialize

        $abs_path = $DOC_ROOT . $path;
    }
    if (strlen($strWarning) <= 0) {
        if ($REQUEST_METHOD == "POST" && strlen($save) > 0 && is_array($ids) && check_bitrix_sessid()) {
            CFileMan::SaveMenu(array($site, $menufilename), $aMenuLinksTmp, $sMenuTemplateTmp);
            $bEdit = true;
            $module_id = "fileman";
            if (COption::GetOptionString($module_id, "log_menu", "Y") == "Y") {
                $mt = COption::GetOptionString("fileman", "menutypes", $default_value, $site);
                $mt = unserialize(str_replace("\\", "", $mt));
                $res_log['menu_name'] = $mt[$name];
                $res_log['path'] = substr($path, 1);
                if (strlen($new) <= 0) {
                    CEventLog::Log("content", "MENU_EDIT", "fileman", "", serialize($res_log));
                } else {
                    CEventLog::Log("content", "MENU_ADD", "fileman", "", serialize($res_log));
                }
            }
            if (strlen($apply) <= 0) {
                if (strlen($back_url) > 0) {
                    LocalRedirect("/" . ltrim($back_url, "/"));
                } else {
                    LocalRedirect("/bitrix/admin/fileman_admin.php?" . $addUrl . "&site=" . $site . "&path=" . UrlEncode($path));
                }
            } else {
                LocalRedirect("/bitrix/admin/fileman_menu_edit.php?" . $addUrl . "&site=" . $site . "&path=" . UrlEncode($path) . "&name=" . $name);
            }
        }
    }
}
if ($bEdit) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:fileman_menu_edit.php


示例14: GetMessage

					$strWarning = GetMessage("pub_src_edit_err");
				}
			}
			else
			{
				$bEdit = true;
				CUndo::ShowUndoMessage(CUndo::Add($arUndoParams));

				$module_id = "fileman";
				if(COption::GetOptionString($module_id, "log_page", "Y")=="Y")
				{
					$res_log['path'] = substr($path, 1);
					CEventLog::Log(
						"content",
						"PAGE_EDIT",
						"main",
						"",
						serialize($res_log),
						$_REQUEST["site"]
					);
				}

				if (CAutoSave::Allowed())
					$AUTOSAVE->Reset();
			}

			if(strlen($strWarning)<=0)
			{
?>
<script type="text/javascript" bxrunfirst="true">
top.BX.showWait();
top.BX.reload('<?php 
开发者ID:ASDAFF,项目名称:open_bx,代码行数:32,代码来源:file_edit_src.php


示例15: Start

	function Start()
	{
		$this->test_percent = 100; // by default

		ob_start();
		try
		{
			$this->result = call_user_func(array($this,$this->function));
		}
		catch (Exception $e)
		{
			$this->Result(null, GetMessage("MAIN_SC_TEST_IS_INCORRECT"));
			echo $e->getMessage();
		}
		$this->strError = ob_get_clean();

		if (!$this->strResult)
			$this->Result($this->result);

		if (!$this->fix_mode)
		{
			// write to log
			if (@$this->OpenLog())
			{
				$text = date('Y-M-d H:i:s') . ' ' . $this->strCurrentTestName . ' (' . $this->function . "): " . $this->LogResult . "\n";
				if ($this->test_percent < 100)
					$text .= $this->test_percent.'% done' . "\n";

				if ($this->strError)
				{
					$text .= str_replace('<br>', "\n", $this->strError)."\n";
				}

				if ($this->test_percent >= 100) // test finished
					$text .= preg_replace('#<[^<>]+>#','',$this->strResult)."\n";

				$text = htmlspecialchars_decode($text);

				fwrite($this->LogResourse, $text);
			}
		}

		$this->last_function = $this->function;
		$this->percent = floor(($this->step + $this->test_percent / 100) / count($this->arTest) * 100);

		if ($this->test_percent >= 100) // test finished
		{
			if ($this->step + 1 < count($this->arTest))
			{
				$this->step++;
				$this->test_percent = 0;
				$this->arTestVars['last_value'] = '';
				list($this->function, $this->strNextTestName) = each($this->arTest[$this->step]);
			}
			else // finish
			{
				if (!$this->fix_mode) // if we have a kernel
				{
					COption::SetOptionString('main', 'site_checker_success', $this->arTestVars['site_checker_success']);
					CEventLog::Add(array(
						"SEVERITY" => "WARNING",
						"AUDIT_TYPE_ID" => $this->arTestVars['site_checker_success'] == 'Y' ? 'SITE_CHECKER_SUCCESS' : 'SITE_CHECKER_ERROR',
						"MODULE_ID" => "main",
						"ITEM_ID" => $_SERVER['DOCUMENT_ROOT'],
						"DESCRIPTION" => '',
					));
					if ($this->arTestVars['site_checker_success'] == 'Y')
						CAdminNotify::DeleteByTag('SITE_CHECKER');
				}
			}
		}
		elseif ($this->result === true)
			$this->strResult = ''; // in case of temporary result on this step

		if ($this->result === false)
			$this->arTestVars['site_checker_success'] = 'N';
	}
开发者ID:nycmic,项目名称:bittest,代码行数:77,代码来源:site_checker.php


示例16: Delete

 public static function Delete($ID)
 {
     global $DB, $APPLICATION, $USER;
     $USER_ID = is_object($USER) ? intval($USER->GetID()) : 0;
     $ID = IntVal($ID);
     $APPLICATION->ResetException();
     foreach (GetModuleEvents("iblock", "OnBeforeIBlockElementDelete", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
             $err = GetMessage("MAIN_BEFORE_DEL_ERR") . ' ' . $arEvent['TO_NAME'];
             $err_id = false;
             if ($ex = $APPLICATION->GetException()) {
                 $err .= ': ' . $ex->GetString();
                 $err_id = $ex->GetID();
             }
             $APPLICATION->throwException($err, $err_id);
             return false;
         }
     }
     $arSql = array("ID='" . $ID . "'", "WF_PARENT_ELEMENT_ID='" . $ID . "'");
     foreach ($arSql as $strWhere) {
         $strSql = "\n\t\t\t\tSELECT\n\t\t\t\t\tID\n\t\t\t\t\t,IBLOCK_ID\n\t\t\t\t\t,WF_PARENT_ELEMENT_ID\n\t\t\t\t\t,WF_STATUS_ID\n\t\t\t\t\t,PREVIEW_PICTURE\n\t\t\t\t\t,DETAIL_PICTURE\n\t\t\t\t\t,XML_ID as EXTERNAL_ID\n\t\t\t\t\t,CODE\n\t\t\t\t\t,NAME\n\t\t\t\tFROM b_iblock_element\n\t\t\t\tWHERE " . $strWhere . "\n\t\t\t\tORDER BY ID DESC\n\t\t\t";
         $z = $DB->Query($strSql);
         while ($zr = $z->Fetch()) {
             $elementId = (int) $zr["ID"];
             $VERSION = CIBlockElement::GetIBVersion($zr["IBLOCK_ID"]);
             $db_res = CIBlockElement::GetProperty($zr["IBLOCK_ID"], $zr["ID"], "sort", "asc", array("PROPERTY_TYPE" => "F"));
             $arIBlockFields = CIBLock::GetArrayByID($zr["IBLOCK_ID"], "FIELDS");
             if (IntVal($zr["WF_PARENT_ELEMENT_ID"]) <= 0 && $arIBlockFields["LOG_ELEMENT_DELETE"]["IS_REQUIRED"] == "Y") {
                 $arEvents = GetModuleEvents("main", "OnBeforeEventLog", true);
                 if (empty($arEvents) || ExecuteModuleEventEx($arEvents[0], array($USER_ID)) === false) {
                     $rsElement = CIBlockElement::GetList(array(), array("=ID" => $ID), false, false, array("LIST_PAGE_URL", "NAME", "CODE"));
                     $arElement = $rsElement->GetNext();
                     $arIblock = CIBlock::GetArrayByID($zr['IBLOCK_ID']);
                     $res_log = array("ID" => $ID, "CODE" => $arElement["CODE"], "NAME" => $arElement["NAME"], "ELEMENT_NAME" => $arIblock["ELEMENT_NAME"], "USER_ID" => $USER_ID, "IBLOCK_PAGE_URL" => $arElement["LIST_PAGE_URL"]);
                     CEventLog::Log("IBLOCK", "IBLOCK_ELEMENT_DELETE", "iblock", $zr["IBLOCK_ID"], serialize($res_log));
                 }
             }
             $piId = \Bitrix\Iblock\PropertyIndex\Manager::resolveElement($zr["IBLOCK_ID"], $zr["ID"]);
             foreach (GetModuleEvents("iblock", "OnIBlockElementDelete", true) as $arEvent) {
                 ExecuteModuleEventEx($arEvent, array($elementId, $zr));
             }
             while ($res = $db_res->Fetch()) {
                 CIBlockElement::DeleteFile($res["VALUE"], $zr["ID"], "PROPERTY", $zr["WF_PARENT_ELEMENT_ID"], $zr["IBLOCK_ID"]);
             }
             if ($VERSION == 2) {
                 if (!$DB->Query("DELETE FROM b_iblock_element_prop_m" . $zr["IBLOCK_ID"] . " WHERE IBLOCK_ELEMENT_ID = " . $elementId)) {
                     return false;
                 }
                 if (!$DB->Query("DELETE FROM b_iblock_element_prop_s" . $zr["IBLOCK_ID"] . " WHERE IBLOCK_ELEMENT_ID = " . $elementId)) {
                     return false;
                 }
             } else {
                 if (!$DB->Query("DELETE FROM b_iblock_element_property WHERE IBLOCK_ELEMENT_ID = " . $elementId)) {
                     return false;
                 }
             }
             static $arDelCache = array();
             if (!is_set($arDelCache, $zr["IBLOCK_ID"])) {
                 $arDelCache[$zr["IBLOCK_ID"]] = false;
                 $db_ps = $DB->Query("SELECT ID,IBLOCK_ID,VERSION,MULTIPLE FROM b_iblock_property WHERE PROPERTY_TYPE='E' AND (LINK_IBLOCK_ID=" . $zr["IBLOCK_ID"] . " OR LINK_IBLOCK_ID=0 OR LINK_IBLOCK_ID IS NULL)");
                 while ($ar_ps = $db_ps->Fetch()) {
                     if ($ar_ps["VERSION"] == 2) {
                         if ($ar_ps["MULTIPLE"] == "Y") {
                             $strTable = "b_iblock_element_prop_m" . $ar_ps["IBLOCK_ID"];
                         } else {
                             $strTable = "b_iblock_element_prop_s" . $ar_ps["IBLOCK_ID"];
                         }
                     } else {
                         $strTable = "b_iblock_element_property";
                     }
                     $arDelCache[$zr["IBLOCK_ID"]][$strTable][] = $ar_ps["ID"];
                 }
             }
             if ($arDelCache[$zr["IBLOCK_ID"]]) {
                 foreach ($arDelCache[$zr["IBLOCK_ID"]] as $strTable => $arProps) {
                     if (strncmp("b_iblock_element_prop_s", $strTable, 23) == 0) {
                         $tableFields = $DB->GetTableFields($strTable);
                         foreach ($arProps as $prop_id) {
                             $strSql = "UPDATE " . $strTable . " SET PROPERTY_" . $prop_id . "=null";
                             if (isset($tableFields["DESCRIPTION_" . $prop_id])) {
                                 $strSql .= ",DESCRIPTION_" . $prop_id . "=null";
                             }
                             $strSql .= " WHERE PROPERTY_" . $prop_id . "=" . $zr["ID"];
                             if (!$DB->Query($strSql)) {
                                 return false;
                             }
                         }
                     } elseif (strncmp("b_iblock_element_prop_m", $strTable, 23) == 0) {
                         $tableFields = $DB->GetTableFields(str_replace("prop_m", "prop_s", $strTable));
                         $strSql = "SELECT IBLOCK_PROPERTY_ID, IBLOCK_ELEMENT_ID FROM " . $strTable . " WHERE IBLOCK_PROPERTY_ID IN (" . implode(", ", $arProps) . ") AND VALUE_NUM=" . $zr["ID"];
                         $rs = $DB->Query($strSql);
                         while ($ar = $rs->Fetch()) {
                             $strSql = "\n\t\t\t\t\t\t\t\t\tUPDATE " . str_replace("prop_m", "prop_s", $strTable) . "\n\t\t\t\t\t\t\t\t\tSET PROPERTY_" . $ar["IBLOCK_PROPERTY_ID"] . "=null\n\t\t\t\t\t\t\t\t\t" . (isset($tableFields["DESCRIPTION_" . $ar["IBLOCK_PROPERTY_ID"]]) ? ",DESCRIPTION_" . $ar["IBLOCK_PROPERTY_ID"] . "=null" : "") . "\n\t\t\t\t\t\t\t\t\tWHERE IBLOCK_ELEMENT_ID = " . $ar["IBLOCK_ELEMENT_ID"] . "\n\t\t\t\t\t\t\t\t";
                             if (!$DB->Query($strSql)) {
                                 return false;
                             }
                         }
                         $strSql = "DELETE FROM " . $strTable . " WHERE IBLOCK_PROPERTY_ID IN (" . implode(", ", $arProps) . ") AND VALUE_NUM=" . $zr["ID"];
                         if (!$DB->Query($strSql)) {
                             return false;
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:iblockelement.php


示例17: DelGroupRight

 function DelGroupRight($module_id = '', $arGroups = array(), $site_id = false)
 {
     global $DB;
     $err_mess = CAllMain::err_mess() . "<br>Function:  DelGroupRight<br>Line: ";
     $strSql = '';
     $sGroups = '';
     if (is_array($arGroups) && count($arGroups) > 0) {
         foreach ($arGroups as $grp) {
             $sGroups .= ($sGroups != '' ? ',' : '') . intval($grp);
         }
     }
     if ($module_id != '') {
         if ($sGroups != '') {
             if (COption::GetOptionString("main", "event_log_module_access", "N") === "Y") {
                 //get old value
                 $rsRight = $DB->Query("SELECT GROUP_ID, G_ACCESS FROM b_module_group WHERE MODULE_ID='" . $DB->ForSql($module_id, 50) . "' AND GROUP_ID IN (" . $sGroups . ") AND SITE_ID " . ($site_id ? "= '" . $DB->ForSql($site_id) . "'" : "IS NULL"));
                 while ($arRight = $rsRight->Fetch()) {
                     CEventLog::Log("SECURITY", "MODULE_RIGHTS_CHANGED", "main", $arRight["GROUP_ID"], $module_id . ($site_id ? "/" . $site_id : "") . ": (" . $arRight["G_ACCESS"] . ") => ()");
                 }
             }
             $strSql = "DELETE FROM b_module_group WHERE MODULE_ID='" . $DB->ForSql($module_id, 50) . "' and GROUP_ID in (" . $sGroups . ") AND SITE_ID " . ($site_id ? "= '" . $DB->ForSql($site_id) . "'" : "IS NULL");
         } else {
             //on delete module
             $strSql = "DELETE FROM b_module_group WHERE MODULE_ID='" . $DB->ForSql($module_id, 50) . "' AND SITE_ID " . ($site_id ? "= '" . $DB->ForSql($site_id) . "'" : "IS NULL");
         }
     } elseif ($sGroups != '') {
         //on delete user group
         $strSql = "DELETE FROM b_module_group WHERE GROUP_ID in (" . $sGroups . ") AND SITE_ID " . ($site_id ? "= '" . $DB->ForSql($site_id) . "'" : "IS NULL");
     }
     if ($strSql != '') {
         $DB->Query($strSql, false, $err_mess . __LINE__);
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:33,代码来源:main.php


示例18: doLog

 /**
  * @param string $pSeverity
  * @param string $pAuditType
  * @param string $pItemName
  * @param string $pItemDescription
  * @return bool
  */
 public function doLog($pSeverity, $pAuditType, $pItemName, $pItemDescription)
 {
     $savedInDB = $savedInFile = $savedInSyslog = false;
     if ($this->isDBEngineActive) {
         $savedInDB = CEventLog::log($pSeverity, $pAuditType, "security", $pItemName, $pItemDescription);
     }
     if ($this->isSyslogEngineActive) {
         $message = self::formatMessage($pAuditType, $pItemName, $pItemDescription, $this->isUserInfoNeeded);
         $savedInSyslog = syslog($this->syslogPriority, $message);
     }
     if ($this->isFileEngineActive) {
         $message = self::formatMessage($pAuditType, $pItemName, $pItemDescription, $this->isUserInfoNeeded);
         $message .= "\n";
         $savedInFile = file_put_contents($this->filePath, $message, FILE_APPEND) > 0;
     }
     return $savedInDB || $savedInSyslog || $savedInFile;
 }
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:24,代码来源:event.php


示例19: Update


//.........这里部分代码省略.........
                     while ($arProp = $props->Fetch()) {
                         if (!array_key_exists($arProp["VALUE"], $arDup)) {
                             $arFields["PROPERTY_VALUES"][$arProp["ID"]][$arProp['PROPERTY_VALUE_ID']] = array("VALUE" => $arProp["VALUE"], "DESCRIPTION" => $arProp["DESCRIPTION"]);
                             $arDup[$arProp["VALUE"]] = true;
                             //This is cure for files duplication bug
                         }
                     }
                 }
             }
         } else {
             if (array_key_exists("PREVIEW_PICTURE", $arFields)) {
                 CFile::SaveForDB($arFields, "PREVIEW_PICTURE", "iblock");
             }
             if (array_key_exists("DETAIL_PICTURE", $arFields)) {
                 CFile::SaveForDB($arFields, "DETAIL_PICTURE", "iblock");
             }
         }
         unset($arFields["IBLOCK_ID"]);
         unset($arFields["WF_NEW"]);
         unset($arFields["IBLOCK_SECTION_ID"]);
         $bTimeStampNA = false;
         if (is_set($arFields, "TIMESTAMP_X") && ($arFields["TIMESTAMP_X"] === NULL || $arFields["TIMESTAMP_X"] === false)) {
             $bTimeStampNA = true;
             unset($arFields["TIMESTAMP_X"]);
         }
         $strUpdate = $DB->PrepareUpdate("b_iblock_element", $arFields, "iblock");
         if (strlen($strUpdate) > 0) {
             $strUpdate .= ", ";
         }
         $strSql = "UPDATE b_iblock_element SET " . $strUpdate . ($bTimeStampNA ? "TIMESTAMP_X=TIMESTAMP_X" : "TIMESTAMP_X=now()") . " WHERE ID=" . $ID;
         $DB->Query($strSql, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
         if (array_key_exists("PROPERTY_VALUES", $arFields) && is_array($arFields["PROPERTY_VALUES"]) && count($arFields["PROPERTY_VALUES"]) > 0) {
             CIBlockElement::SetPropertyValues($ID, $ar_element["IBLOCK_ID"], $arFields["PROPERTY_VALUES"]);
         }
         if (is_set($arFields, "IBLOCK_SECTION")) {
             CIBlockElement::SetElementSection($ID, $arFields["IBLOCK_SECTION"], false, $arIBlock["RIGHTS_MODE"] === "E" ? $arIBlock["ID"] : 0);
         }
         if ($arIBlock["RIGHTS_MODE"] === "E") {
             $obElementRights = new CIBlockElementRights($arIBlock["ID"], $ID);
             if (array_key_exists("RIGHTS", $arFields) && is_array($arFields["RIGHTS"])) {
                 $obElementRights->SetRights($arFields["RIGHTS"]);
             }
         }
         if (array_key_exists("IPROPERTY_TEMPLATES", $arFields)) {
             $ipropTemplates = new \Bitrix\Iblock\InheritedProperty\ElementTemplates($arIBlock["ID"], $ID);
             $ipropTemplates->set($arFields["IPROPERTY_TEMPLATES"]);
         }
         if ($bUpdateSearch) {
             CIBlockElement::UpdateSearch($ID, true);
         }
         if ($bWorkFlow) {
             CIBlockElement::WF_CleanUpHistoryCopies($ID);
         }
         //Restore saved values
         if ($SAVED_PREVIEW_PICTURE !== false) {
             $arFields["PREVIEW_PICTURE_ID"] = $arFields["PREVIEW_PICTURE"];
             $arFields["PREVIEW_PICTURE"] = $SAVED_PREVIEW_PICTURE;
         } else {
             unset($arFields["PREVIEW_PICTURE"]);
         }
         if ($SAVED_DETAIL_PICTURE !== false) {
             $arFields["DETAIL_PICTURE_ID"] = $arFields["DETAIL_PICTURE"];
             $arFields["DETAIL_PICTURE"] = $SAVED_DETAIL_PICTURE;
         } else {
             unset($arFields["DETAIL_PICTURE"]);
         }
         if ($arIBlock["FIELDS"]["LOG_ELEMENT_EDIT"]["IS_REQUIRED"] == "Y") {
             $USER_ID = is_object($USER) ? intval($USER->GetID()) : 0;
             $arEvents = GetModuleEvents("main", "OnBeforeEventLog", true);
             if (empty($arEvents) || ExecuteModuleEventEx($arEvents[0], array($USER_ID)) === false) {
                 $rsElement = CIBlockElement::GetList(array(), array("=ID" => $ID, "CHECK_PERMISSIONS" => "N", "SHOW_NEW" => "Y"), false, false, array("ID", "NAME", "LIST_PAGE_URL", "CODE"));
                 $arElement = $rsElement->GetNext();
                 $res = array("ID" => $ID, "CODE" => $arElement["CODE"], "NAME" => $arElement["NAME"], "ELEMENT_NAME" => $arIBlock["ELEMENT_NAME"], "USER_ID" => $USER_ID, "IBLOCK_PAGE_URL" => $arElement["LIST_PAGE_URL"]);
                 CEventLog::Log("IBLOCK", "IBLOCK_ELEMENT_EDIT", "iblock", $arIBlock["ID"], serialize($res));
             }
         }
         $Result = true;
         /************* QUOTA *************/
         $_SESSION["SESS_RECOUNT_DB"] = "Y";
         / 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CEventMessage类代码示例发布时间:2022-05-23
下一篇:
PHP CEvent类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap