Skip to content
This repository was archived by the owner on May 30, 2022. It is now read-only.

Commit e5048fd

Browse files
committed
Bitrix 14.0.5
1 parent 63d9f3d commit e5048fd

File tree

106 files changed

+2544
-1208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2544
-1208
lines changed

modules/bitrixcloud/classes/general/cdn.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static public function OnEndBufferContent(&$content)
221221
self::$proto = CMain::IsHTTPS() ? "https" : "http";
222222
self::$config = CBitrixCloudCDNConfig::getInstance()->loadFromOptions();
223223

224-
//if (self::$config->isExpired()
224+
if (self::$config->isExpired())
225225
{
226226
if(!self::updateConfig())
227227
return;
@@ -257,6 +257,7 @@ static public function OnEndBufferContent(&$content)
257257
|src=
258258
|BX\\.loadCSS\\(
259259
|BX\\.loadScript\\(
260+
|BX\\.getCDNPath\\(
260261
|jsUtils\\.loadJSFile\\(
261262
|background\\s*:\\s*url\\(
262263
)) #attribute

modules/bitrixcloud/classes/general/mobile.php

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,35 @@ class CBitrixCloudMobile
99
* @return void
1010
*
1111
* RegisterModuleDependences(
12-
* "mobileapp",
13-
* "OnBeforeAdminMobileMenuBuild",
14-
* "bitrixcloud",
15-
* "CBitrixCloudMobile",
16-
* "OnBeforeAdminMobileMenuBuild"
17-
* );
12+
* "mobileapp",
13+
* "OnBeforeAdminMobileMenuBuild",
14+
* "bitrixcloud",
15+
* "CBitrixCloudMobile",
16+
* "OnBeforeAdminMobileMenuBuild"
17+
* );
1818
*/
1919
static public function OnBeforeAdminMobileMenuBuild()
2020
{
2121
$arMenu = array(
22+
array(
23+
"text" => GetMessage("BCL_MON_MOB_INSPECTOR"),
24+
"type" => "section",
25+
"items" => array(
2226
array(
23-
"text" => GetMessage("BCL_MON_MOB_MENU_TITLE"),
24-
"type" => "section",
25-
"items" => array(
26-
array(
27-
"text" => GetMessage("BCL_MON_MOB_MENU_IPAGE"),
28-
"data-url" => "/bitrix/admin/mobile/bitrixcloud_monitoring_ipage.php",
29-
"data-pageid" => "info_page",
30-
)
31-
)
32-
)
33-
);
27+
"text" => GetMessage("BCL_MON_MOB_MENU_IPAGE"),
28+
"data-url" => "/bitrix/admin/mobile/bitrixcloud_monitoring_ipage.php",
29+
"data-pageid" => "bitrix_cloud_monitoring_info",
30+
"push-param" => "bc"
31+
),
32+
array(
33+
"text" => GetMessage("BCL_MON_MOB_MENU_PUSH"),
34+
"data-url" => "/bitrix/admin/mobile/bitrixcloud_monitoring_push.php",
35+
"data-pageid" => "bitrix_cloud_monitoring_push",
36+
),
37+
38+
),
39+
),
40+
);
3441

3542
$startSortMenuPosition = 300;
3643

@@ -42,4 +49,33 @@ static public function OnBeforeAdminMobileMenuBuild()
4249

4350
return true;
4451
}
45-
}
52+
53+
static public function getUserDevices($userId)
54+
{
55+
$arResult = array();
56+
57+
if(CModule::IncludeModule("pull"))
58+
{
59+
$dbres = CPullPush::GetList(Array(), Array("USER_ID" => $userId));
60+
while($arDb = $dbres->Fetch())
61+
{
62+
if($arDb["DEVICE_TYPE"] == "APPLE")
63+
{
64+
CModule::IncludeModule("mobileapp");
65+
CMobile::Init();
66+
67+
/* if(CMobile::$isDev)
68+
$protocol = 1;
69+
else */
70+
$protocol = 2;
71+
}
72+
else
73+
$protocol = 3;
74+
75+
$arResult[] = $arDb["DEVICE_TOKEN"].":".$protocol.":BitrixAdmin";
76+
}
77+
}
78+
79+
return $arResult;
80+
}
81+
}

modules/bitrixcloud/classes/general/monitoring.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,45 @@ static public function getList()
7171
return $result;
7272
}
7373
}
74+
static public function addDevice($domain, $deviceId)
75+
{
76+
if ($deviceId != "")
77+
{
78+
$option = CBitrixCloudOption::getOption('monitoring_devices');
79+
$devices = $option->getArrayValue();
80+
$devices[] = $domain."|".$deviceId;
81+
$option->setArrayValue($devices);
82+
}
83+
}
84+
static public function deleteDevice($domain, $deviceId)
85+
{
86+
if ($deviceId != "")
87+
{
88+
$option = CBitrixCloudOption::getOption('monitoring_devices');
89+
$devices = $option->getArrayValue();
90+
$index = array_search($domain."|".$deviceId, $devices);
91+
if ($index !== false)
92+
{
93+
unset($devices[$index]);
94+
$option->setArrayValue($devices);
95+
}
96+
}
97+
}
98+
static public function getDevices($domain)
99+
{
100+
$result = array();
101+
$option = CBitrixCloudOption::getOption('monitoring_devices');
102+
$devices = $option->getArrayValue();
103+
foreach($devices as $domain_device)
104+
{
105+
if (list ($myDomain, $myDevice) = explode("|", $domain_device, 2))
106+
{
107+
if ($myDomain === $domain)
108+
$result[] = $myDevice;
109+
}
110+
}
111+
return $result;
112+
}
74113
/*
75114
* Registers new monitoring job with the remote service.
76115
* Returns empty string on success.

modules/bitrixcloud/classes/general/monitoring_webservice.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ public function actionStart($domain, $is_https, $language_id, $emails, $tests)
101101
}
102102
}
103103

104+
$option = CBitrixCloudOption::getOption('monitoring_devices');
105+
$devices = $option->getArrayValue();
106+
foreach($devices as $domain_device)
107+
{
108+
if (list ($myDomain, $myDevice) = explode("|", $domain_device, 2))
109+
{
110+
if ($myDomain === $domain)
111+
$this->addStr .= "&ar_devices[]=".urlencode($myDevice);
112+
}
113+
}
114+
104115
$this->monitoring_action("monitoring_start");
105116
}
106117
/**

modules/compression/include.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,35 @@ public static function OnPageStart()
1010

1111
public static function OnAfterEpilog()
1212
{
13-
$bShowTime = ($_SESSION["SESS_SHOW_TIME_EXEC"] == 'Y');
14-
$bShowStat = ($GLOBALS["DB"]->ShowSqlStat && ($GLOBALS["USER"]->IsAdmin() || $_SESSION["SHOW_SQL_STAT"]=="Y"));
13+
global $USER;
14+
15+
$canEditPHP = $USER->CanDoOperation('edit_php');
16+
$bShowTime = isset($_SESSION["SESS_SHOW_TIME_EXEC"]) && ($_SESSION["SESS_SHOW_TIME_EXEC"] == 'Y');
17+
$bShowStat = ($GLOBALS["DB"]->ShowSqlStat && ($canEditPHP || $_SESSION["SHOW_SQL_STAT"]=="Y"));
18+
$bShowCacheStat = (\Bitrix\Main\Data\Cache::getShowCacheStat() && ($canEditPHP || $_SESSION["SHOW_CACHE_STAT"]=="Y"));
19+
$bExcel = isset($_REQUEST["mode"]) && $_REQUEST["mode"] === 'excel';
1520
$ENCODING = CCompress::CheckCanGzip();
1621
if($ENCODING !== 0)
1722
{
1823
$level = 4;
1924

20-
if (strtoupper($_GET["compress"])=="Y")
21-
$_SESSION["SESS_COMPRESS"] = "Y";
22-
elseif (strtoupper($_GET["compress"])=="N")
23-
unset($_SESSION["SESS_COMPRESS"]);
25+
if (isset($_GET["compress"]))
26+
{
27+
if ($_GET["compress"] === "Y" || $_GET["compress"] === "y")
28+
$_SESSION["SESS_COMPRESS"] = "Y";
29+
elseif ($_GET["compress"] === "N" || $_GET["compress"] === "n")
30+
unset($_SESSION["SESS_COMPRESS"]);
31+
}
2432

25-
if(!defined("ADMIN_AJAX_MODE") && !defined('PUBLIC_AJAX_MODE'))
33+
if(!defined("ADMIN_AJAX_MODE") && !defined('PUBLIC_AJAX_MODE') && !$bExcel)
2634
{
27-
if($bShowTime || $bShowStat)
35+
if($bShowTime || $bShowStat || $bShowCacheStat)
2836
{
2937
$main_exec_time = round((getmicrotime()-START_EXEC_TIME), 4);
3038
include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/debug_info.php");
3139
}
3240

33-
if($_SESSION["SESS_COMPRESS"]=="Y")
41+
if(isset($_SESSION["SESS_COMPRESS"]) && $_SESSION["SESS_COMPRESS"] == "Y")
3442
include($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/compression/table.php");
3543
}
3644

@@ -57,7 +65,7 @@ public static function OnAfterEpilog()
5765
{
5866
ob_end_flush();
5967
ob_end_flush();
60-
if(($bShowTime || $bShowStat) && !defined("ADMIN_AJAX_MODE") && !defined('PUBLIC_AJAX_MODE'))
68+
if(($bShowTime || $bShowStat || $bShowCacheStat) && !defined("ADMIN_AJAX_MODE") && !defined('PUBLIC_AJAX_MODE'))
6169
{
6270
$main_exec_time = round((getmicrotime()-START_EXEC_TIME), 4);
6371
include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/debug_info.php");

modules/forum/classes/general/functions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ static function GetEditorToolbar($arParams)
169169

170170
public function convert($text, $allow = array(), $type = "html", $arFiles = false) //, "KEEP_AMP" => "N"
171171
{
172+
$text = str_replace(array("\013", "\014"), "", $text);
172173
if (!isset($this->image_params['width'])) $this->image_params['width'] = 300;
173174
if (!isset($this->image_params['height'])) $this->image_params['height'] = 300;
174175
if (!isset($this->image_params['template'])) $this->image_params['template'] = 'popup_image';
@@ -189,7 +190,8 @@ public function convert($text, $allow = array(), $type = "html", $arFiles = fals
189190
$this->arFiles = is_array($arFiles) ? $arFiles : array($arFiles);
190191
$this->arFilesIDParsed = array();
191192

192-
return $this->convertText($text);
193+
$text = str_replace(array("\013", "\014"), array(chr(34), chr(39)), $this->convertText($text));
194+
return $text;
193195
}
194196

195197
public function convert4mail($text, $arFiles = false)

modules/forum/classes/general/message.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,32 @@ public static function OnSocNetLogFormatEvent($arEvent, $arParams)
14581458

14591459
return $arEvent;
14601460
}
1461+
1462+
/**
1463+
* @param $arFilter - array("FORUM_ID" => 241, "TOPIC_ID" => 82383, "APPROVED" => "Y")
1464+
* @param $rights - string(1) (A|R|U|W);
1465+
*/
1466+
public static function setWebdavRights($arFilter, $rights)
1467+
{
1468+
if (IsModuleInstalled("webdav"))
1469+
{
1470+
$arFilter = (is_array($arFilter) ? $arFilter : array($arFilter));
1471+
$arFilter[">UF_FORUM_MESSAGE_DOC"] = 0;
1472+
$db_res = CForumMessage::GetList(array("ID" => "ASC"), $arFilter, false, 0, array("SELECT" => array("UF_FORUM_MESSAGE_DOC")));
1473+
$arDocs = array();
1474+
if ($db_res && ($res = $db_res->Fetch()))
1475+
{
1476+
do {
1477+
if (!empty($res["UF_FORUM_MESSAGE_DOC"]) && is_array($res["UF_FORUM_MESSAGE_DOC"]))
1478+
$arDocs = array_merge($arDocs, $res["UF_FORUM_MESSAGE_DOC"]);
1479+
} while ($res = $db_res->Fetch());
1480+
}
1481+
if (!empty($arDocs) && CModule::IncludeModule("webdav"))
1482+
{
1483+
CWebDavIblock::appendRightsOnElements($arDocs, $rights);
1484+
}
1485+
}
1486+
}
14611487
}
14621488

14631489
class _CMessageDBResult extends CDBResult
@@ -1466,6 +1492,13 @@ class _CMessageDBResult extends CDBResult
14661492
public function _CMessageDBResult($res, $params = array())
14671493
{
14681494
$this->sNameTemplate = (!empty($params["sNameTemplate"]) ? $params["sNameTemplate"] : '');
1495+
$this->checkUserFields = false;
1496+
$this->arUserFields = false;
1497+
if (array_key_exists("SELECT", $params))
1498+
{
1499+
$this->arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("FORUM_MESSAGE", 0, LANGUAGE_ID);
1500+
$this->checkUserFields = (!empty($this->arUserFields));
1501+
}
14691502
parent::CDBResult($res);
14701503
}
14711504
public function Fetch()
@@ -1611,6 +1644,19 @@ public function Fetch()
16111644
}
16121645
}
16131646
}
1647+
1648+
if ($this->checkUserFields)
1649+
{
1650+
$arUF = array_intersect_key($res, $this->arUserFields);
1651+
if (empty($arUF))
1652+
$this->checkUserFields = false;
1653+
else {
1654+
foreach($arUF as $k => $v) {
1655+
$res[$k] = $this->arUserFields[$k];
1656+
$res[$k]["VALUE"] = $v;
1657+
}
1658+
}
1659+
}
16141660
}
16151661
return $res;
16161662
}

0 commit comments

Comments
 (0)