} closedir($handle); } } } $file = trim(preg_replace("'[\\\\/]+'", "/", dirname(__FILE__) . "/../lang/" . LANGUAGE_ID . "/include/webdav.php")); __IncludeLang($file); $object = strPos($componentPage, "group_files") !== false ? "group" : "user"; /******************************************************************** Input params ********************************************************************/ /***************** BASE ********************************************/ $arParams["IBLOCK_TYPE"] = intVal($object == "user" ? $arParams["FILES_USER_IBLOCK_TYPE"] : $arParams["FILES_GROUP_IBLOCK_TYPE"]); $arParams["IBLOCK_ID"] = intVal($object == "user" ? $arParams["FILES_USER_IBLOCK_ID"] : $arParams["FILES_GROUP_IBLOCK_ID"]); $arParams['USE_AUTH'] = $arParams['FILES_USE_AUTH'] == "Y" ? "Y" : "N"; $arParams["NAME_FILE_PROPERTY"] = strToupper(trim(empty($arParams["FILE_NAME_FILE_PROPERTY"]) ? "FILE" : $arParams["FILE_NAME_FILE_PROPERTY"])); $arParams["FILES_PATH_TO_SMILE"] = !empty($arParams["PATH_TO_FORUM_SMILE"]) ? $arParams["PATH_TO_FORUM_SMILE"] : "/bitrix/images/forum/smile/"; $arResult['BASE_URL'] = $object == "user" ? $arParams["FILES_USER_BASE_URL"] : $arParams["FILES_GROUP_BASE_URL"]; if ($arParams["SEF_MODE"] == "Y") { $arResult['BASE_URL'] = $object == "user" ? $arResult["PATH_TO_USER_FILES"] : $arResult["PATH_TO_GROUP_FILES"]; } $arResult['BASE_URL'] = rtrim(str_replace(array("#user_id#", "#group_id#", "#path#"), array($arResult["VARIABLES"]["user_id"], $arResult["VARIABLES"]["group_id"], ""), $arResult['BASE_URL']), '/'); /***************** ADDITIONAL **************************************/ $arParams["SET_NAV_CHAIN"] = $arParams["SET_NAV_CHAIN"] == "N" ? "N" : "Y"; if ($object == 'user') { CIBlockWebdavSocnet::UserERights($arParams['IBLOCK_ID']); } elseif ($object == 'group') { CIBlockWebdavSocnet::GroupERights($arParams['IBLOCK_ID']); } $res = CIBlockWebdavSocnet::GetUserMaxPermission($object, $object == "user" ? $arResult["VARIABLES"]["user_id"] : $arResult["VARIABLES"]["group_id"], $USER->GetID(), $arParams['IBLOCK_ID']); $arParams["PERMISSION"] = $res["PERMISSION"];
private function internalDBLog($log_type, $log_auth_type, $log_text) { if (isset($this->options['options']['log_table']) && isset($this->options['options']['enable_logging']) && $this->options['options']['enable_logging'] == true) { $res = $this->dbConnect(); $this->checkDBError($res, __LINE__); if (is_string($log_type)) { $log_type = strToupper(substr($log_type, 0, 1)); } switch ($log_type) { case LOG_CRIT: case 'C': $log_type = 'C'; break; case LOG_WARNING: case 'W': $log_type = 'W'; break; case LOG_NOTICE: case 'N': $log_type = 'N'; break; case LOG_INFO: case 'I': $log_type = 'I'; break; case LOG_DEBUG: case 'D': $log_type = 'D'; break; default: $log_type = 'E'; } $log_page = $_SERVER['SCRIPT_FILENAME']; $root = $_SERVER['DOCUMENT_ROOT']; if ($root != '' && $root[strlen($root) - 1] != '/') { $root = $root . '/'; } if (!empty($root) && strpos($log_page, $root) == 0) { $log_page = './' . substr($log_page, strlen($root)); } if (strlen($log_page) > 80) { $log_page = '...' . substr($log_page, -77); } $fields = array('do_id' => $this->domainID, 'app_id' => $this->applicationID, 'us_id' => $this->UID, 'log_type' => $log_type, 'log_auth_type' => $log_auth_type, 'log_time' => date('Y-m-d H:i:s'), 'log_ip' => $this->getIPAddress(), 'log_page' => $log_page, 'log_text' => $log_text); $res = $this->db->extended->autoExecute($this->options['options']['log_table'], $fields, MDB2_AUTOQUERY_INSERT); $this->checkDBError($res, __LINE__); return true; } return false; /* No log table defined */ }