本文整理汇总了PHP中check_bitrix_sessid函数的典型用法代码示例。如果您正苦于以下问题:PHP check_bitrix_sessid函数的具体用法?PHP check_bitrix_sessid怎么用?PHP check_bitrix_sessid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_bitrix_sessid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Main filtering loop also sets up global vars GET POST COOKIE and some $_SERVER keys
*/
public function process()
{
global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_REQUEST_VARS;
if ($this->currentUserHaveRightsForSkip()) {
if ($_SERVER["REQUEST_METHOD"] === "POST" && check_bitrix_sessid() && empty($_POST['____SECFILTER_CONVERT_JS'])) {
return;
}
}
//Do not touch those variables who did not come from REQUEST
$this->cleanGlobals();
$originalPostVars = $_POST;
$_GET = $this->safeizeArray($_GET, '$_GET');
$_POST = $this->safeizeArray($_POST, '$_POST', '/^File\\d+_\\d+$/');
$_COOKIE = $this->safeizeArray($_COOKIE, '$_COOKIE');
$_SERVER = $this->safeizeServerArray($_SERVER);
$_REQUEST = $_GET;
foreach ($_POST as $k => $v) {
$_REQUEST[$k] = $v;
}
foreach ($_COOKIE as $k => $v) {
$_REQUEST[$k] = $v;
}
$HTTP_GET_VARS = $_GET;
$HTTP_POST_VARS = $_POST;
$HTTP_COOKIE_VARS = $_COOKIE;
$HTTP_REQUEST_VARS = $_REQUEST;
$this->restoreGlobals();
$this->doPostProccessActions($originalPostVars);
}
示例2: checkToken
/**
* @return $this
*/
protected function checkToken()
{
if (!check_bitrix_sessid('token_sid')) {
$this->sendJsonResponse(array('status' => 'error_token_sid', 'token_sid' => bitrix_sessid()), 403);
}
return $this;
}
示例3: checkRequest
protected function checkRequest()
{
if (!$this->getUser() || !$this->getUser()->getId() || !$this->getUser()->IsAuthorized() || $_SERVER['REQUEST_METHOD'] !== 'POST' || !check_bitrix_sessid() || !$this->helper->checkRights()) {
$this->sendJsonAccessDeniedResponse();
}
$action = isset($_REQUEST['action']) && is_string($_REQUEST['action']) ? strtolower($_REQUEST['action']) : '';
if (empty($action)) {
$this->errors[] = array('code' => 0, 'message' => GetMessage('CRM_PRODUCT_SECTION_TREE_AJAX_ERROR_EMPTY_ACTION'));
}
if (!$this->errors) {
switch ($action) {
case 'getinitialtree':
case 'getsubsections':
$this->action = $action;
$catalogId = isset($_REQUEST['catalogId']) ? intval($_REQUEST['catalogId']) : 0;
if ($catalogId <= 0) {
$this->errors[] = array('code' => 0, 'message' => GetMessage('CRM_PRODUCT_SECTION_TREE_AJAX_ERROR_REQUIRED_PARAMETER', array('#PARAM#' => 'catalogId')));
}
$this->catalogId = $catalogId;
$sectionId = isset($_REQUEST['sectionId']) ? intval($_REQUEST['sectionId']) : 0;
if ($sectionId <= 0) {
$this->errors[] = array('code' => 0, 'message' => GetMessage('CRM_PRODUCT_SECTION_TREE_AJAX_ERROR_REQUIRED_PARAMETER', array('#PARAM#' => 'sectionId')));
}
$this->sectionId = $sectionId;
break;
default:
$this->errors[] = array('code' => 0, 'message' => GetMessage('CRM_PRODUCT_SECTION_TREE_AJAX_ERROR_UNKNOWN_ACTION', array('#ACTION#' => $_REQUEST['action'])));
}
}
if ($this->errors) {
$this->sendJsonErrorResponse();
}
}
示例4: toEdit
/**
* @return array
*/
protected function toEdit()
{
/** @global CUser $USER */
global $USER;
if (!$USER->IsAuthorized()) {
return array('status' => 'error', 'error' => 'auth_error');
}
if (!check_bitrix_sessid()) {
return array('status' => 'error', 'error' => 'sessid_check_failed');
}
if ($this->request['action'] !== 'otp_check_activate') {
return array('status' => 'error', 'error' => 'unknown_action');
}
if (!CModule::includeModule('security')) {
return array('status' => 'error', 'error' => 'security_not_installed');
}
try {
$otp = Otp::getByUser($USER->getid());
$binarySecret = pack('H*', $this->request->getPost('secret'));
$otp->regenerate($binarySecret)->syncParameters($this->request->getPost('sync1'), $this->request->getPost('sync2'))->save();
return array('status' => 'ok');
} catch (\Bitrix\Security\Mfa\OtpException $e) {
return array('status' => 'error', 'error' => $e->getMessage());
}
}
示例5: OnBeforeProlog
public static function OnBeforeProlog()
{
if (CSecuritySystemInformation::isCliMode())
return;
if(CSecurityFilterMask::Check(SITE_ID, $_SERVER["REQUEST_URI"]))
return;
if(self::currentUserHaveRightsForSkip())
{
if(
check_bitrix_sessid()
&& (
!isset($_POST['____SECFILTER_CONVERT_JS'])
|| !$_POST['____SECFILTER_CONVERT_JS']
)
)
{
return;
}
}
$filter = new CSecurityFilter;
$filter->process();
}
示例6: execute
public static function execute()
{
global $USER;
$result = array();
$error = false;
if (!CModule::IncludeModule('voximplant')) {
$error = 'Module voximplant is not installed.';
} else {
if (!is_object($USER) || !$USER->IsAuthorized()) {
$error = GetMessage('ACCESS_DENIED');
} else {
if (!CVoxImplantMain::CheckAccess()) {
$error = GetMessage('ACCESS_DENIED');
} else {
if (!check_bitrix_sessid()) {
$error = GetMessage('ACCESS_DENIED');
} else {
if ($_REQUEST["act"] == "edit") {
$result = self::executeEditPhones($error);
} else {
if ($_REQUEST["act"] == "getInfo") {
$result = self::executeGetInfo($error);
} else {
if ($_REQUEST["act"] == "option") {
$result = self::executeSaveOption($error);
}
}
}
}
}
}
}
self::returnJson(array_merge(array('result' => $error === false ? 'ok' : 'error', 'error' => CharsetConverter::ConvertCharset($error, SITE_CHARSET, 'UTF-8')), $result));
}
示例7: checkParams
/**
* проверяет заполнение обязательных параметров
* @throws SystemException
*/
protected function checkParams()
{
if ($this -> arParams['IBLOCK_ID'] <= 0)
throw new Main\ArgumentNullException('IBLOCK_ID');
if (check_bitrix_sessid())
{
return false;
}
}
示例8: __construct
public function __construct($title, $iblockId)
{
global $APPLICATION;
$this->iblock_id = intVal($iblockId);
\CModule::IncludeModule("iblock");
if ($_REQUEST['work_start'] && check_bitrix_sessid()) {
$this->lastID = intVal($_REQUEST['lastid']);
}
$this->arSelect = array("ID", "NAME", "CODE", "IBLOCK_ID");
$this->title = $title;
$APPLICATION->SetTitle($this->title);
}
示例9: ShowPanel
function ShowPanel()
{
global $USER, $APPLICATION;
if (defined("ADMIN_SECTION") && ADMIN_SECTION == true) {
return;
}
if ($USER->IsAdmin()) {
if ($_REQUEST['add_new_site_sol'] == 'sol' && check_bitrix_sessid()) {
$dbrSites = CSite::GetList($by, $ord);
$arSitesID = array();
$arSitesPath = array();
$siteCnt = 0;
while ($arSite = $dbrSites->Fetch()) {
if ($arSite["ACTIVE"] == "Y") {
$siteCnt++;
}
$arSitesID[] = strtolower($arSite["ID"]);
$arSitesPath[] = strtolower($arSite["PATH"]);
}
$newSiteID = "";
while (true) {
$newSiteID = chr(rand(ord("a"), ord("z"))) . chr(rand(ord("a"), ord("z")));
if (!in_array($newSiteID, $arSitesID) && !in_array("/site" . $newSiteID . "/", $arSitesPath) && !file_exists($_SERVER['DOCUMENT_ROOT'] . "/site" . $newSiteID)) {
break;
}
}
$culture = CultureTable::getRow(array('filter' => array("=FORMAT_DATE" => FORMAT_DATE, "=FORMAT_DATETIME" => FORMAT_DATETIME, "=FORMAT_NAME" => CSite::GetDefaultNameFormat(), "=CHARSET" => SITE_CHARSET)));
if ($culture) {
$cultureId = $culture["ID"];
} else {
$addResult = CultureTable::add(array("NAME" => $newSiteID, "CODE" => $newSiteID, "FORMAT_DATE" => FORMAT_DATE, "FORMAT_DATETIME" => FORMAT_DATETIME, "FORMAT_NAME" => CSite::GetDefaultNameFormat(), "CHARSET" => SITE_CHARSET));
$cultureId = $addResult->getId();
}
$arFields = array("LID" => $newSiteID, "ACTIVE" => "Y", "SORT" => 100, "DEF" => "N", "NAME" => $newSiteID, "DIR" => "/site_" . $newSiteID . "/", "SITE_NAME" => $newSiteID, "SERVER_NAME" => $_SERVER["SERVER_NAME"], "EMAIL" => COption::GetOptionString("main", "email_from"), "LANGUAGE_ID" => LANGUAGE_ID, "DOC_ROOT" => "", "CULTURE_ID" => $cultureId);
$obSite = new CSite();
$result = $obSite->Add($arFields);
if ($result) {
LocalRedirect("/bitrix/admin/wizard_install.php?lang=" . LANGUAGE_ID . "&wizardName=bitrix:portal&wizardSiteID=" . $newSiteID . "&" . bitrix_sessid_get());
} else {
echo $obSite->LAST_ERROR;
}
}
$arMenu = array(array("ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape(SITE_DIR) . "?add_new_site_sol=sol&" . bitrix_sessid_get() . "')", "TEXT" => "<b>" . GetMessage("SOL_BUTTON_TEST_TEXT", array("#BR#" => " ")) . "</b>", "TITLE" => GetMessage("SOL_BUTTON_TEST_TITLE")));
$arSites = array();
$dbrSites = CSite::GetList($by, $ord, array("ACTIVE" => "Y"));
while ($arSite = $dbrSites->GetNext()) {
$arSites[] = array("ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($arSite["DIR"]) . "');", "ICON" => $arSite["LID"] == SITE_ID ? "checked" : "", "TEXT" => $arSite["NAME"], "TITLE" => GetMessage("SOL_BUTTON_GOTOSITE") . " " . $arSite["NAME"]);
}
$arMenu[] = array("SEPARATOR" => true);
$arMenu[] = array("TEXT" => GetMessage("SOL_BUTTON_GOTOSITE"), "MENU" => $arSites);
$APPLICATION->AddPanelButton(array("HREF" => SITE_DIR . "?add_new_site_sol=sol&" . bitrix_sessid_get(), "ID" => "solutions_wizard", "ICON" => "bx-panel-install-solution-icon", "TYPE" => "BIG", "ALT" => GetMessage("SOL_BUTTON_TEST_TITLE"), "TEXT" => GetMessage("SOL_BUTTON_TEST_TEXT"), "MAIN_SORT" => 2520, "SORT" => 20, "MENU" => $arMenu, 'HINT' => array('TITLE' => str_replace('#BR#', ' ', GetMessage("SOL_BUTTON_TEST_TEXT")), 'TEXT' => GetMessage('SOL_BUTTON_TEST_TEXT_HINT')), 'HINT_MENU' => array('TITLE' => str_replace('#BR#', ' ', GetMessage("SOL_BUTTON_TEST_TEXT")), 'TEXT' => GetMessage('SOL_BUTTON_TEST_MENU_HINT'))));
}
}
示例10: DoUninstall
public function DoUninstall()
{
if (!check_bitrix_sessid()) {
return false;
}
UnRegisterModule($this->MODULE_ID);
$modPath = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/" . $this->MODULE_ID . "/install/components";
$comPath = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components";
DeleteDirFiles($modPath, $comPath);
DeleteDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/" . $this->MODULE_ID . "/install/images", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/images/maxposter");
LocalRedirect("partner_modules.php?lang=" . LANGUAGE_ID);
return true;
}
示例11: Run
public function Run()
{
if ($_REQUEST['work_start'] && check_bitrix_sessid()) {
if ($this->bCallback) {
call_user_func($this->callback, $this);
} else {
$this->executeStep();
}
echo $this->getCurrentStatusString();
die;
}
$GLOBALS['assistant_filter'] = $this->getFilterHtml();
}
示例12: OnBeforePrologHandler
function OnBeforePrologHandler(){
global $USER_FIELD_MANAGER;
if (isset($_REQUEST['action_button']) && !isset($_REQUEST['action'])) {
$_REQUEST['action'] = $_REQUEST['action_button'];
}
if (!isset($_REQUEST['action'])) {
return;
}
$BID = (isset($_REQUEST['ID']) ? (int)$_REQUEST['ID'] : 0);
if ($_REQUEST['action']=='parsing_in_list' && check_bitrix_sessid() &&
\CModule::IncludeModule('iblock')) {
ParserActions::doParsing($BID,$_REQUEST['IBLOCK_ID']);
}
}
示例13: executeComponent
public function executeComponent()
{
/** @global CMain $APPLICATION */
global $APPLICATION;
$action = $this->request['action'];
$isEdit = $this->request->isPost() && $action && check_bitrix_sessid();
if ($isEdit) {
$this->arResult = $this->toEdit($action);
} else {
$APPLICATION->SetTitle(Loc::getMessage("SECURITY_USER_RECOVERY_CODES_TITLE"));
$this->arResult = $this->toView($action);
}
$this->doPostAction($isEdit, $action);
}
示例14: CModuleOptions
public function CModuleOptions($module_id, $arTabs, $arGroups, $arOptions, $need_access_tab = false)
{
$this->module_id = $module_id;
$this->arTabs = $arTabs;
$this->arGroups = $arGroups;
$this->arOptions = $arOptions;
$this->need_access_tab = $need_access_tab;
if ($need_access_tab) {
$this->arTabs[] = array('DIV' => 'edit_access_tab', 'TAB' => 'Права доступа', 'ICON' => '', 'TITLE' => 'Настройка прав доступа');
}
if ($_REQUEST['update'] == 'Y' && check_bitrix_sessid()) {
$this->SaveOptions();
if ($this->need_access_tab) {
$this->SaveGroupRight();
}
}
$this->GetCurOptionValues();
}
示例15: executeComponent
public function executeComponent()
{
/** @global CMain $APPLICATION */
global $APPLICATION;
$action = $this->request['action'];
$isEdit = $this->request->isPost() && $action && check_bitrix_sessid();
if ($isEdit) {
$result = $this->toEdit($action);
$result = CSecurityJsonHelper::encode($result);
$APPLICATION->RestartBuffer();
header('Content-Type: application/json', true);
echo $result;
die;
} else {
$APPLICATION->SetTitle(Loc::getMessage("SECURITY_USER_RECOVERY_CODES_TITLE"));
$this->arResult = $this->toView($action);
$this->IncludeComponentTemplate($this->templatePage);
}
}