1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
prolog_after.php
См. документацию.
1<?php
2
9
15
16use Bitrix\Main;
17
19
20define("START_EXEC_PROLOG_AFTER_1", microtime(true));
21$GLOBALS["BX_STATE"] = "PA";
22
23if (!headers_sent())
24{
25 header("Content-type: text/html; charset=" . LANG_CHARSET);
26}
27
29
30if (defined("DEMO") && DEMO == "Y")
31{
32 if (defined("OLDSITEEXPIREDATE") && defined("SITEEXPIREDATE") && OLDSITEEXPIREDATE != SITEEXPIREDATE)
33 {
34 die(GetMessage("expire_mess2"));
35 }
36
37 $delta = $license->getExpireDate()?->getTimestamp() - time();
38 $daysToExpire = ($delta < 0 ? 0 : ceil($delta / 86400));
39
40 if ($daysToExpire == 0)
41 {
42 echo GetMessage("expire_mess1");
43 }
44}
45elseif (defined("TIMELIMIT_EDITION") && TIMELIMIT_EDITION == "Y")
46{
47 if (defined("OLDSITEEXPIREDATE") && defined("SITEEXPIREDATE") && OLDSITEEXPIREDATE != SITEEXPIREDATE)
48 {
49 die(GetMessage("expire_mess2"));
50 }
51
52 if (
53 ($expireDate = $license->getExpireDate()) !== null
54 && $expireDate->getTimestamp() < time()
55 && !Main\ModuleManager::isModuleInstalled('intranet')
56 )
57 {
58 $licenseLink = $license->getRenewalLink();
59 echo GetMessage("expire_mess_timelicense2", ['#LINK#' => $licenseLink]);
60 }
61}
62
63if (COption::GetOptionString("main", "site_stopped", "N") == "Y" && !$USER->CanDoOperation('edit_other_settings'))
64{
65 if (($siteClosed = getLocalPath("php_interface/" . LANG . "/site_closed.php", BX_PERSONAL_ROOT)) !== false)
66 {
67 include($_SERVER["DOCUMENT_ROOT"] . $siteClosed);
68 }
69 elseif (($siteClosed = getLocalPath("php_interface/include/site_closed.php", BX_PERSONAL_ROOT)) !== false)
70 {
71 include($_SERVER["DOCUMENT_ROOT"] . $siteClosed);
72 }
73 else
74 {
75 include($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/site_closed.php");
76 }
77 die();
78}
79
80$sPreviewFile = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/tmp/templates/__bx_preview/header.php";
81if (defined("SITE_TEMPLATE_PREVIEW_MODE") && file_exists($sPreviewFile))
82{
83 include_once($sPreviewFile);
84}
85else
86{
87 Main\Page\Asset::getInstance()->startTarget('TEMPLATE');
88 include_once($_SERVER["DOCUMENT_ROOT"] . SITE_TEMPLATE_PATH . "/header.php");
89 Main\Page\Asset::getInstance()->startTarget('PAGE');
90}
91
92/* Draw edit menu for whole content */
95
96if ($APPLICATION->GetShowIncludeAreas())
97{
98 $aUserOpt = CUserOptions::GetOption("global", "settings", []);
99 if (!isset($aUserOpt["page_edit_control_enable"]) || $aUserOpt["page_edit_control_enable"] != "N")
100 {
101 $documentRoot = CSite::GetSiteDocRoot(SITE_ID);
102 if (isset($_SERVER["REAL_FILE_PATH"]) && $_SERVER["REAL_FILE_PATH"] != "")
103 {
104 $currentFilePath = $_SERVER["REAL_FILE_PATH"];
105 }
106 else
107 {
108 $currentFilePath = $APPLICATION->GetCurPage(true);
109 }
110
111 $bCanEdit = true;
112
113 if (!is_file($documentRoot . $currentFilePath) || !$USER->CanDoFileOperation("fm_edit_existent_file", [SITE_ID, $currentFilePath]))
114 {
115 $bCanEdit = false;
116 }
117
118 //need fm_lpa for every .php file, even with no php code inside
119 if ($bCanEdit && !$USER->CanDoOperation('edit_php') && in_array(GetFileExtension($currentFilePath), GetScriptFileExt()) && !$USER->CanDoFileOperation('fm_lpa', [SITE_ID, $currentFilePath]))
120 {
121 $bCanEdit = false;
122 }
123
124 if ($bCanEdit && IsModuleInstalled("fileman") && !($USER->CanDoOperation("fileman_admin_files") && $USER->CanDoOperation("fileman_edit_existent_files")))
125 {
126 $bCanEdit = false;
127 }
128
129 if ($bCanEdit)
130 {
131 echo $APPLICATION->IncludeStringBefore();
133 }
134 }
135}
136define("START_EXEC_PROLOG_AFTER_2", microtime(true));
137$GLOBALS["BX_STATE"] = "WA";
138$APPLICATION->RestartWorkarea(true);
139
140//magically replacing the current file with another one
141$event = new Main\Event("main", "OnFileRewrite", ["path" => Main\Context::getCurrent()->getRequest()->getScriptFile()]);
142$event->send();
143
144foreach ($event->getResults() as $evenResult)
145{
146 if (($result = $evenResult->getParameters()) <> '')
147 {
148 $file = new Main\IO\File($_SERVER["DOCUMENT_ROOT"] . $result);
149 if ($file->isExists())
150 {
151 //only the first result matters
152 include($file->getPhysicalPath());
153 die();
154 }
155 }
156}
global $APPLICATION
Определения include.php:80
static getInstance()
Определения application.php:98
Определения file.php:6
$sPreviewFile
Определения epilog_before.php:86
global $BX_GLOBAL_AREA_EDIT_ICON
Определения epilog_before.php:21
$result
Определения get_property_values.php:14
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $USER
Определения csv_new_run.php:40
foreach(['Bitrix\\Main'=> '/lib', 'Psr\\Container'=> '/vendor/psr/container/src', 'Psr\\Log'=> '/vendor/psr/log/src', 'Psr\\Http\\Message'=> '/vendor/psr/http-message/src', 'Psr\\Http\\Client'=> '/vendor/psr/http-client/src', 'Http\\Promise'=> '/vendor/php-http/promise/src', 'PHPMailer\\PHPMailer'=> '/vendor/phpmailer/phpmailer/src', 'GeoIp2'=> '/vendor/geoip2/geoip2/src', 'MaxMind\\Db'=> '/vendor/maxmind-db/reader/src/MaxMind/Db', 'PhpParser'=> '/vendor/nikic/php-parser/lib/PhpParser', 'Recurr'=> '/vendor/simshaun/recurr/src/Recurr',] as $namespace=> $namespacePath) $documentRoot
Определения autoload.php:27
const LANG_CHARSET
Определения include.php:65
if(file_exists(( $_fname=__DIR__ . "/classes/general/update_db_updater.php"))) if(($_fname=getLocalPath("init.php")) !==false) if(( $_fname=getLocalPath("php_interface/init.php", BX_PERSONAL_ROOT)) !==false) if(($_fname=getLocalPath("php_interface/" . SITE_ID . "/init.php", BX_PERSONAL_ROOT)) !==false) if((!(defined("STATISTIC_ONLY") &&STATISTIC_ONLY &&!str_starts_with( $GLOBALS["APPLICATION"]->GetCurPage(), BX_ROOT . "/admin/"))) &&COption::GetOptionString("main", "include_charset", "Y")=="Y" &&LANG_CHARSET !='') if(COption::GetOptionString("main", "set_p3p_header", "Y")=="Y") $license
Определения include.php:158
GetFileExtension($path)
Определения tools.php:2972
IsModuleInstalled($module_id)
Определения tools.php:5301
GetScriptFileExt()
Определения tools.php:2912
GetMessage($name, $aReplace=null)
Определения tools.php:3397
getLocalPath($path, $baseFolder="/bitrix")
Определения tools.php:5092
$event
Определения prolog_after.php:141
$aUserOpt
Определения prolog_auth_admin.php:23
$daysToExpire
Определения prolog_main_admin.php:364
$delta
Определения prolog_main_admin.php:363
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
die
Определения quickway.php:367
const SITE_ID
Определения sonet_set_content_view.php:12
$GLOBALS['_____370096793']
Определения update_client.php:1