Last active
April 5, 2021 11:32
-
-
Save if0rest/06c7dd49af532106b0d7dc8422a63666 to your computer and use it in GitHub Desktop.
Include init.php in Bitrix if GET-param set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
if (isset($_GET['useinit']) && !empty($_GET['useinit'])) | |
{ | |
session_start(); | |
$initStatus = strval($_GET['useinit']); | |
if ($initStatus == 'N') | |
{ | |
if (isset($_SESSION['USE_INIT'])) | |
unset($_SESSION['USE_INIT']); | |
} | |
elseif ($initStatus == 'Y') | |
{ | |
$_SESSION['USE_INIT'] = 'Y'; | |
} | |
} | |
if (isset($_SESSION['USE_INIT']) && $_SESSION['USE_INIT'] == 'Y') | |
{ | |
if (file_exists($_SERVER["DOCUMENT_ROOT"]."/local/php_interface/init.php")) | |
require_once($_SERVER["DOCUMENT_ROOT"]."/local/php_interface/init.php"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment