/** * @param array $languageUrlMap - ['language' => 'url', ..., 'default' => 'url'] */ public function route(array $languageUrlMap) { $language = $this->getBestMatch($this->languageList); $languageUrlMap['default'] = $languageUrlMap['default'] ?: '/404.php'; LanguageLink::setRootAlternateHeader($language); LocalRedirect($languageUrlMap[$language] ?: $languageUrlMap['default'], false, '301 Moved Permanently'); }
public function Authorize($identity=false, $var=false) { if($var === false) $var = 'OPENID_IDENTITY_OPENID'; $step = TrCOpenIDClient::GetOpenIDAuthStep($var); if($step > 0) { $obOpenID = new TrCOpenIDClient(); if($step == 2) { return $obOpenID->Authorize(); } elseif($step == 1) { if($identity === false) $identity = $_POST['OPENID_IDENTITY_OPENID']; $return_to = TrCSocServUtil::GetCurUrl("auth_service_id=".urlencode($_REQUEST["auth_service_id"])); if($url = $obOpenID->GetRedirectUrl($identity, $return_to)) LocalRedirect($url, true); else return false; } } return false; }
function registerUser($userInfo) { $errors = array(); $result = ''; if (empty($userInfo['name'])) { $errors[] = 'Вы не ввели имя'; } if (empty($userInfo['email'])) { $errors[] = 'Вы не ввели email'; } if (empty($userInfo['phone'])) { $errors[] = 'Вы не ввели телефон'; } if (empty($errors)) { $user = new CUser(); $password = make_password(8); $arFields = array("NAME" => $userInfo['name'], "EMAIL" => $userInfo['email'], "LOGIN" => $userInfo['email'], "ACTIVE" => "Y", "GROUP_ID" => array(6), "PASSWORD" => $password, "CONFIRM_PASSWORD" => $password, "PERSONAL_PHONE" => $userInfo['phone']); $ID = $user->Add($arFields); if (intval($ID) > 0) { $result = "Вы успешно зарегистрированы."; $arEventField = array("NAME" => $userInfo['name'], "EMAIL" => $userInfo['email'], "PASSWORD" => $password); CEvent::SendImmediate("NEW_REG", "s1", $arEventField); unset($_POST['user']); global $USER; global $APPLICATION; $USER->Authorize($ID); LocalRedirect($APPLICATION->GetCurPageParam('', array('user[name]', 'user[email]', 'ELEMENT_CODE', 'code'))); } else { $errors[] = $user->LAST_ERROR; } } return $errors; }
protected function processBeforeAction($actionName) { if ($actionName != 'start' && $this->request->getQuery('document_action') != 'start') { //todo hack. SocServ set backurl! if (strpos($_SERVER['HTTP_REFERER'], 'tools/oauth') !== false) { $uri = \CHTTP::urlDeleteParams($this->request->getRequestUri(), array("sessid", "document_action")); $uri = \CHTTP::urlAddParams($uri, array('document_action' => 'start')); //restart process after authorization in social services LocalRedirect($uri); } } if ($this->isActionWithExistsFile()) { $this->initializeData(); $this->checkReadPermissions(); } if ($actionName != 'start') { if (!$this->initializeDocumentService()) { $this->sendJsonErrorResponse(); } if (!$this->documentHandler->checkAccessibleTokenService()) { $this->errorCollection->add(array(new Error(Loc::getMessage('DISK_DOC_CONTROLLER_ERROR_COULD_NOT_WORK_WITH_TOKEN_SERVICE', array('#NAME#' => $this->documentHandler->getName())), self::ERROR_COULD_NOT_WORK_WITH_TOKEN_SERVICE))); $this->errorCollection->add($this->documentHandler->getErrors()); $this->sendJsonErrorResponse(); } if (!$this->documentHandler->queryAccessToken()->hasAccessToken() || $this->documentHandler->isRequiredAuthorization()) { $this->sendNeedAuth(); } } return true; }
public function Authorize($identity=false, $var=false) { if($var === false) $var = 'OPENID_IDENTITY_OPENID'; $step = COpenIDClient::GetOpenIDAuthStep($var); if($step > 0) { $obOpenID = new COpenIDClient(); if($step == 2) { return $obOpenID->Authorize(); } elseif($step == 1) { if($identity === false) $identity = $_REQUEST['OPENID_IDENTITY_OPENID']; CSocServAuthManager::SetUniqueKey(); $return_to = CSocServUtil::GetCurUrl("auth_service_id=".urlencode($_REQUEST["auth_service_id"])."&check_key=".$_SESSION["UNIQUE_KEY"]); if($url = $obOpenID->GetRedirectUrl($identity, $return_to)) LocalRedirect($url, true); else return false; } } return false; }
public function execute($context) { // ищем оцениваемого по ключу респондента $assess = $this->registry->getDbHelper('MembersHelper')->findAssessByRespondentKey($context['respondent']['private_access_key']); if (!$assess) { $this->component->arResult['error'] = 'Неверный ключ'; } else { // проверяем статус оцениваемого if ($assess['status'] != \Ecoplay\Helper\Db\MembersHelper::ASSESS_STATUS_ASSESS) { // редиректим в лк $respondentMember = $this->registry->getDbHelper('MembersHelper')->findById($context['respondent']['project_memberID']); LocalRedirect('/enter/' . $respondentMember['private_lk_access_key'] . '/'); } // ключ не ЛК, значит ищем сеанс для этого ключа $seance = $this->registry->getDbHelper('SeancesHelper')->findSeanceByAccessKey($context['respondent']['private_access_key']); if (!$seance) { $seance = $this->registry->getModel('Blanks')->createSeance($context['respondent']['private_access_key']); } if (!$seance) { $this->component->arResult['error'] = 'Неверный ключ'; } else { LocalRedirect('/s/' . $seance['seance_key'] . '/'); } } }
public function Authorize($identity = false, $var = false) { if ($var === false) { $var = 'OPENID_IDENTITY_OPENID'; } $step = COpenIDClient::GetOpenIDAuthStep($var); if ($step > 0) { $obOpenID = new COpenIDClient(); if ($step == 2) { return $obOpenID->Authorize(); } elseif ($step == 1) { if ($identity === false) { $identity = $_REQUEST['OPENID_IDENTITY_OPENID']; } CSocServAuthManager::SetUniqueKey(); $return_to = CSocServUtil::GetCurUrl("auth_service_id=" . urlencode($_REQUEST["auth_service_id"]) . "&check_key=" . $_SESSION["UNIQUE_KEY"], array("SEF_APPLICATION_CUR_PAGE_URL", "auth_service_error", "auth_service_id", "login")); if ($url = $obOpenID->GetRedirectUrl($identity, $return_to)) { LocalRedirect($url, true); } else { LocalRedirect(CSocServUtil::GetCurUrl("auth_service_id=" . urlencode($_REQUEST["auth_service_id"]) . "&auth_service_error=1")); } return false; } } return false; }
function RedirectToSite($site) { if(strlen($site)<=0) return false; $db_site = CSite::GetByID($site); if($arSite = $db_site->Fetch()) { $arSite["DIR"] = RTrim($arSite["DIR"], ' \/'); if(strlen($arSite["DIR"])>0) LocalRedirect((strlen($arSite["SERVER_NAME"])>0?"http://".$arSite["SERVER_NAME"]:"").$arSite["DIR"].$_SERVER["REQUEST_URI"], true); } }
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')))); } }
public function execute($context) { // проверяем, возможно сеанс уже существует $seance = $this->registry->getDbHelper('TestsSeancesHelper')->findSeanceByAccessKey($context['respondent']['private_access_key']); if (!$seance) { $seance = $this->registry->getModel('Tests')->createSeance($context['respondent']); } if (!$seance) { $this->component->arResult['error'] = 'Неверный ключ'; } else { LocalRedirect('/s/' . $seance['seance_key'] . '/'); } }
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; }
public static function ServicesRedirect() { if (isset($_REQUEST["add_service"]) && $_REQUEST["add_service"]) { $service = DrclinicsHelper::getServices($_REQUEST["add_service"]); $service = end($service); if ($service) { $section = self::getSefviceMediaspect($service["ID"], $service["IBLOCK_SECTION_ID"]); if ($section) { self::ServicesSession($service["ID"], "add"); LocalRedirect($section["SECTION_PAGE_URL"]); } } } }
public function execute($context) { if ($context['respondent']['status'] != \Ecoplay\Helper\Db\MembersHelper::RESPONDENT_STATUS_ACTIVE) { $this->component->arResult['error'] = 'Неверный ключ'; } else { // ключ не ЛК, значит ищем сеанс для этого ключа $seance = $this->registry->getDbHelper('SeancesHelper')->findSeanceByAccessKey($context['respondent']['private_access_key']); if (!$seance) { $seance = $this->registry->getModel('Blanks')->createSeance($context['respondent']['private_access_key']); } if (!$seance) { $this->component->arResult['error'] = 'Неверный ключ'; } else { LocalRedirect('/s/' . $seance['seance_key'] . '/'); } } }
public function OnBeforePrologHandler() { global $USER; $rsUser = CUser::GetByID($USER->GetId()); $arUser = $rsUser->Fetch(); $uri = $_SERVER['REQUEST_URI']; if ($pos = strpos($_SERVER['REQUEST_URI'], '?')) { $uri = substr($_SERVER['REQUEST_URI'], 0, $pos); } if ($arUser['ID'] > 0 && $arUser['UF_RULES'] != '1' && $uri != '/licenzionnoe-soglasheniye/' && $uri != '/personal/registration/license_agreement.php') { $backUrl = ''; if (isset($_GET['backurl'])) { $backUrl = '?backurl=' . $_GET['backurl']; } LocalRedirect("/licenzionnoe-soglasheniye/" . $backUrl); } }
public function execute($context) { // проверяем валидность ключа if ($context['groupKey']['is_registration_available']) { LocalRedirect('/g/' . $context['groupKey']['access_key'] . '/'); } $seanceValid = false; $groupKeyValid = true; // проверяем наличие ключа сеанса в куке if (isset($_COOKIE['gk' . $context['groupKey']['group_keyID'] . '_seance_key'])) { $seance = $this->registry->getDbHelper('SeancesHelper')->findSeanceByKey($_COOKIE['gk' . $context['groupKey']['group_keyID'] . '_seance_key']); if ($seance && $seance['state'] != \Ecoplay\Helper\Db\BlanksHelper::SEANCE_STATE_COMPLETE) { $seanceValid = true; } } if (!$seanceValid) { // проверяем возможность регистрации по ключу $existCnt = $this->registry->getDbHelper('TestsHelper')->getGroupKeyRespondentsCount($context['project']['projectID'], $context['groupKey']['group_keyID']); if ($context['groupKey']['fact_count'] && $existCnt >= $context['groupKey']['fact_count']) { $groupKeyValid = false; $this->component->IncludeComponentTemplate('linear/limit', '/bitrix/components/ecoplay/group.key.enter/templates/.default'); } elseif ($context['groupKey']['status'] != \Ecoplay\Helper\Db\TestsHelper::GROUP_KEY_STATUS_ACTIVE) { $groupKeyValid = false; $this->component->IncludeComponentTemplate('linear/disabled', '/bitrix/components/ecoplay/group.key.enter/templates/.default'); } else { // ключ валидный, места есть - создаем участника, респондента, сеанс и кладем его в куку $memberKey = $this->registry->getModel('Auth')->generateUid('prep_projects_members', 'private_lk_access_key'); $name = 'Авторегистрация ' . date('H:i d.m.Y') . ' по ключу #' . $context['groupKey']['group_keyID'] . ' ' . $context['groupKey']['name']; $langID = $this->registry->getModel('Projects')->getDefaultLangID($context['project']); $memberID = $this->registry->getDbHelper('MembersHelper')->addMember($name, '', '', '', $context['project']['projectID'], $memberKey, $langID, 1, 'new', '', $context['groupKey']['group_keyID'], 1); $eventListener = new EventListener($this->registry, $context['project'], $_SERVER["DOCUMENT_ROOT"] . '/'); $eventListener->executeEvent('MemberAdded', array('memberID' => $memberID), true); $respondentKey = $this->registry->getModel('Auth')->generateUid('prep_respondents', 'private_access_key'); $respondentID = $this->registry->getDbHelper('MembersHelper')->addRespondent(array('project_memberID' => $memberID, 'active' => 1, 'projectID' => $context['project']['projectID'], 'sessionID' => $context['groupKey']['sessionID'], 'stat1_assessID' => 0, 'status' => \Ecoplay\Helper\Db\MembersHelper::RESPONDENT_STATUS_ACTIVE, 'private_access_key' => $respondentKey, 'stat1_roleID' => 0, 'last_email' => '0000-00-00 00:00:00', 'langID' => 0, 'last_entrance' => '0000-00-00 00:00:00', 'deny_deletion' => 0, 'addedd_by_assess' => 0, 'need_remind' => 0)); $seance = $this->registry->getModel('Blanks')->createSeance($respondentKey); setcookie('gk' . $context['groupKey']['group_keyID'] . '_seance_key', $seance['seance_key'], strtotime('+1 years')); } } if ($groupKeyValid) { $this->component->arParams['MODE'] = 'key'; $factory = new \Ecoplay\Controller\Factory($context['project'], $this->registry, $_SERVER["DOCUMENT_ROOT"] . '/'); $controller = $factory->getBlankViewerController($this->component); $controller->execute(array('seance' => $seance, 'project' => $context['project'], 'APPLICATION' => $context['APPLICATION'], 'anonym' => true)); } }
public function addProductById() { $request = Application::getInstance()->getContext()->getRequest(); if (!$request->isAjaxRequest() && !$request->isPost()) { return $this->pageNotFound(); } if (!(int) $request->get('id') || !(int) $request->get('quantity')) { return $this->pageNotFound(); } /** @var \TAO\Bundle\Shop\Bundle $shop */ $shop = \TAO::bundle('Shop'); $product = $shop->getProductById((int) $request->get('id')); $shop->addProductToCart($product, (int) $request->get('quantity')); if ($request->isAjaxRequest()) { return 'ok'; } LocalRedirect($request->get('backurl') ? urldecode($request->get('backurl')) : $shop->cartUrl()); }
public function execute($context) { $this->component->arResult['member'] = $context['member']; $this->component->arResult['project'] = $context['project']; if (!$context['project']['allow_subordinates_controlling'] || !$this->registry->getDbHelper('MembersHelper')->isHaveSubordinates($context['member']['email'], $context['project']['projectID'])) { LocalRedirect('/enter/' . $context['member']['private_lk_access_key'] . '/'); } $availableLanguages = $this->registry->getDbHelper('TranslationHelper')->getLanguagesByIDs(json_decode($context['project']['~languages'])); $this->component->arResult['languages'] = $availableLanguages; // обработка языка if (isset($_POST['language']) && array_key_exists(intval($_POST['language']), $availableLanguages)) { $langID = intval($_POST['language']); $this->registry->getDbHelper('MembersHelper')->editMember($context['member']['projects_memberID'], array('langID' => $langID)); } else { $langID = $context['member']['langID']; } $this->component->arResult['langID'] = $langID; // Шапка ЛК $translator = new \Ecoplay\Model\Translation($this->registry->getDbConnect(), $availableLanguages[$langID]['abbr'], $_SERVER["DOCUMENT_ROOT"] . '/lang/'); $this->component->arResult['translator'] = $translator; $projectViewSettings = $context['project']['param_lk'] ? (array) json_decode($context['project']['~param_lk']) : array(); $this->component->arResult['projectViewSettings'] = $projectViewSettings; $assess = $this->registry->getDbHelper('MembersHelper')->findFirstAssessByMemberID($context['project']['projectID'], $context['member']['projects_memberID']); $addonCss = false; if ($assess) { $addonCss = $this->registry->getDbHelper('ProjectsHelper')->findCSSBySessionsIDs(array($assess['sessionID'])); } if (!$addonCss && $context['project']['myCSS_path']) { $addonCss = $context['project']['myCSS_path']; } $context['APPLICATION']->IncludeComponent("ecoplay:front.header", '', array('TRANSLATOR' => $translator, 'MODE' => 'subordinates', 'MEMEBER_KEY' => $context['member']['private_lk_access_key'], 'NAME' => $translator->translateObject($context['member']['name'], 'member_name', $context['member']['projects_memberID'], $langID) . ' ' . $translator->translateObject($context['member']['surname'], 'member_surname', $context['member']['projects_memberID'], $langID), 'SETTINGS' => $projectViewSettings, 'ADDON_CSS' => $addonCss)); // выбор языка $this->component->includeComponentTemplate('languages'); $this->component->arResult['TEXT'] = $translator->translateObject($context['project']['~lk_subordinates_text'], 'project_lk_subordinates_text', $context['project']['projectID'], $langID); // ищем участников по структуре $subordinatesMembers = $this->registry->getDbHelper('MembersHelper')->getSubordinatesMembers($context['member']['email'], $context['project']['projectID']); $subordinatesAssess = $this->registry->getDbHelper('MembersHelper')->getAssessByMembersIDs($context['project']['projectID'], array_keys($subordinatesMembers)); $this->component->arResult['assess'] = $subordinatesAssess; $this->component->arResult['members'] = $subordinatesMembers; $this->component->IncludeComponentTemplate(); $context['APPLICATION']->IncludeComponent("ecoplay:front.footer", '', array('TRANSLATOR' => $translator, 'SETTINGS' => $projectViewSettings)); }
public function execute($context) { // логируем посещение $respondent = $this->registry->getDbHelper('MembersHelper')->findRespondentById($context['seance']['respondentID']); $validRespondent = false; if ($respondent['status'] == \Ecoplay\Helper\Db\MembersHelper::RESPONDENT_STATUS_ACTIVE || $respondent['status'] == \Ecoplay\Helper\Db\MembersHelper::RESPONDENT_STATUS_COMPLETE && $context['project']['allow_edit_seance_answers_at_complete']) { $validRespondent = true; } if (!$validRespondent) { $respondentMember = $this->registry->getDbHelper('MembersHelper')->findById($respondent['project_memberID']); LocalRedirect('/enter/' . $respondentMember['private_lk_access_key'] . '/'); } if ($context['seance']['state'] == \Ecoplay\Helper\Db\BlanksHelper::SEANCE_STATE_COMPLETE && !$context['project']['allow_edit_seance_answers_at_complete']) { $this->component->arResult['error'] = "Опрос по Вашему ключу уже пройден"; $this->registry->getModel('Stat')->addHit($context['seance']['sessionID'], $respondent['project_memberID']); } else { // показываем бланк $context['APPLICATION']->IncludeComponent("ecoplay:behavior.blank.viewer", "", array('MODE' => 'key', 'SEANCE_ID' => $context['seance']['seanceID'], 'SEANCE_KEY' => $context['seance']['seance_key'])); } }
public function execute($context) { // проверяем чтобы опрашиваемый был в нужном статусе $assess = $this->registry->getDbHelper('MembersHelper')->findAssessById($context['seance']['stat1_assessID']); if ($assess['status'] != \Ecoplay\Helper\Db\MembersHelper::ASSESS_STATUS_ASSESS) { // редиректим в лк $respondent = $this->registry->getDbHelper('MembersHelper')->findRespondentById($context['seance']['respondentID']); $respondentMember = $this->registry->getDbHelper('MembersHelper')->findById($respondent['project_memberID']); LocalRedirect('/enter/' . $respondentMember['private_lk_access_key'] . '/'); } // логируем посещение $respondent = $this->registry->getDbHelper('MembersHelper')->findRespondentById($context['seance']['respondentID']); $this->registry->getModel('Stat')->addHit($context['seance']['sessionID'], $respondent['project_memberID']); if ($context['seance']['state'] == \Ecoplay\Helper\Db\BlanksHelper::SEANCE_STATE_COMPLETE) { $this->component->arResult['error'] = "Опрос по Вашему ключу уже пройден"; } else { // показываем бланк $context['APPLICATION']->IncludeComponent("ecoplay:behavior.blank.viewer", "", array('MODE' => 'key', 'SEANCE_ID' => $context['seance']['seanceID'], 'SEANCE_KEY' => $context['seance']['seance_key'])); } }
function DoInstall() { if (!check_bitrix_sessid()) { return false; } global $APPLICATION; if (IsModuleInstalled("iblock")) { $step = IntVal($_REQUEST["step"]); if ($step < 2) { $APPLICATION->IncludeAdminFile(GetMessage("PHOTO_INSTALL"), $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/photogallery/install/step1.php"); } elseif ($step == 2) { $APPLICATION->IncludeAdminFile(GetMessage("PHOTO_INSTALL"), $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/photogallery/install/step2.php"); } elseif ($step == 3) { $this->InstallDB(); $this->InstallEvents(); $this->InstallFiles(); LocalRedirect("module_admin.php?lang=" . LANGUAGE_ID); } } elseif (!IsModuleInstalled("photogallery")) { $this->InstallDB(); $this->InstallEvents(); $this->InstallFiles(); } }
function BasketButtonAction($orderData = array()) { global $APPLICATION; if ($_POST["paypal"] == "Y") { $url = "https://api-3t." . $this->domain . "paypal.com/nvp"; $arFields = array("METHOD" => "SetExpressCheckout", "VERSION" => "98.0", "USER" => $this->username, "PWD" => $this->pwd, "SIGNATURE" => $this->signature, "AMT" => $orderData["AMOUNT"], "CURRENCYCODE" => $this->currency, "RETURNURL" => $this->serverName . $orderData["PATH_TO_ORDER"], "CANCELURL" => $this->serverName . $APPLICATION->GetCurPageParam("paypal=Y&paypal_error=Y", array("paypal", "paypal_error")), "PAYMENTACTION" => "Authorization"); $arFields["RETURNURL"] .= (strpos($arFields["RETURNURL"], "?") === false ? "?" : "&") . "paypal=Y"; $ht = new CHTTP(); if ($res = $ht->Post($url, $arFields)) { $result = $this->parseResult($res); if (strlen($result["TOKEN"]) > 0) { $url = "https://www." . $this->domain . "paypal.com/webscr?cmd=_express-checkout&token=" . $result["TOKEN"]; if ($orderData["ORDER_REQUEST"] == "Y") { return $url; } LocalRedirect($url); } } else { $GLOBALS["APPLICATION"]->ThrowException(GetMessage("PPL_ERROR"), "CSalePaySystemPrePayment_action_error"); return false; } } return true; }
$notify_title_tmp = str_replace(array("\r\n", "\n"), " ", $newName); $notify_title_new = TruncateText($notify_title_tmp, 100); $notify_title_new_out = TruncateText($notify_title_tmp, 255); $arNotifyParams = array("LOG_ID" => $logID, "GROUP_ID" => intval($arParams['SOCNET_GROUP_ID']), "NOTIFY_MESSAGE" => "", "FROM_USER_ID" => $arSoFields["USER_ID"], "URL" => $arSoFields["URL"], "MESSAGE" => GetMessage("WIKI_SONET_IM_RENAME", array("#title_old#" => $notify_title_old, "#title_new#" => "<a href=\"#URL#\" class=\"bx-notifier-item-action\">" . $notify_title_new . "</a>")), "MESSAGE_OUT" => GetMessage("WIKI_SONET_IM_RENAME", array("#title_old#" => $notify_title_old_out, "#title_new#" => $notify_title_new_out)) . " (#URL#)", "EXCLUDE_USERS" => array($arSoFields["USER_ID"])); CSocNetSubscription::NotifyGroup($arNotifyParams); } } } $arParams['ELEMENT_NAME'] = $newName; break; } if (empty($arResult['ERROR_MESSAGE'])) { if (!isset($_POST['apply'])) { LocalRedirect(CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('wiki_page_cache_clear' => 'Y'))); } else { LocalRedirect(CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => $arResult['WIKI_oper']) : array())); } } else { $arParams['ELEMENT_NAME'] = $arResult['ELEMENT']['NAME']; } } else { $arResult['ERROR_MESSAGE'] = GetMessage('WIKI_SESS_TIMEOUT'); $arResult['ELEMENT']['DETAIL_TEXT'] = $arResult['ELEMENT']['~DETAIL_TEXT'] = $arResult['ALLOW_HTML'] == 'Y' && $_POST['POST_MESSAGE_TYPE'] == 'html' ? $_POST['POST_MESSAGE_HTML'] : $_POST['POST_MESSAGE']; } } else { if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['preview'])) { if (check_bitrix_sessid()) { if (isset($_POST['POST_TITLE'])) { $arResult['ELEMENT']['NAME_LOCALIZE'] = CWikiUtils::htmlspecialchars_decode($_POST['POST_TITLE']); $sCatName = ''; if (CWikiUtils::IsCategoryPage($arFields['NAME'], $sCatName)) {
} else { //$currentSum += ($arItemsList["BASKET_PRICE"] - $arItemsList["BASKET_DISCOUNT_PRICE"]) * $arItemsList["BASKET_QUANTITY"]; $currentSum += $arItemsList["BASKET_PRICE"] * $arItemsList["BASKET_QUANTITY"]; } } while ($arItemsList = $dbItemsList->Fetch()); $arResult["ROWS"][] = array("NAME" => $currentBasketName, "QUANTITY" => $currentQuantity, "SUM" => $currentSum, "CURRENCY" => $affiliateCurrency, "SUM_FORMAT" => SaleFormatCurrency($currentSum, $affiliateCurrency)); $totalQuantity += $currentQuantity; $totalSum += $currentSum; $arResult["TOTAL"] = array("QUANTITY" => $totalQuantity, "SUM" => $totalSum, "CURRENCY" => $affiliateCurrency, "SUM_FORMAT" => SaleFormatCurrency($totalSum, $affiliateCurrency)); } $arResult["FILTER_ID"] = rand(0, 10000); } else { $arResult = false; } $this->IncludeComponentTemplate(); } else { LocalRedirect($arParams["REGISTER_PAGE"] . "?REDIRECT_PAGE=" . UrlEncode($APPLICATION->GetCurPage())); die; } } else { LocalRedirect($arParams["REGISTER_PAGE"] . "?REDIRECT_PAGE=" . UrlEncode($APPLICATION->GetCurPage())); die; } } else { ?> <b><?php echo ShowError(GetMessage("SPCAS1_NO_SHOP")); ?> </b> <?php }
function getData(&$arResult) { global $APPLICATION, $USER; //$arResult = $this->__prepareDataForTpl(); $arResult["WEB_FORM_ID"] = $this->WEB_FORM_ID; $arResult["WEB_FORM_NAME"] = $this->WEB_FORM_NAME; if ($this->RESULT_ID > 0) { $arResult["RESULT_ID"] = $this->RESULT_ID; } $arResult["F_RIGHT"] = $this->F_RIGHT; if (strlen($_REQUEST["web_form_submit"]) > 0 || strlen($_REQUEST["web_form_apply"]) > 0) { $this->arrVALUES = $_REQUEST; if ($this->RESULT_ID) { $this->__form_validate_errors = CForm::Check($this->WEB_FORM_ID, $this->arrVALUES, $this->RESULT_ID); } else { $this->__form_validate_errors = CForm::Check($this->WEB_FORM_ID, $this->arrVALUES); } if (!$this->isFormErrors()) { if (check_bitrix_sessid()) { $return = false; if ($this->RESULT_ID) { CFormResult::Update($this->RESULT_ID, $this->arrVALUES, $this->arParams["EDIT_ADDITIONAL"]); $this->strFormNote = GetMessage("FORM_DATA_SAVED"); if (strlen($_REQUEST["web_form_submit"]) > 0 && !(defined("ADMIN_SECTION") && ADMIN_SECTION === true)) { if ($this->arParams["SEF_MODE"] == "Y") { LocalRedirect($this->arParams["LIST_URL"] . "?strFormNote=" . urlencode($this->strFormNote)); } else { LocalRedirect($this->arParams["LIST_URL"] . (strpos($this->arParams["LIST_URL"], "?") === false ? "?" : "&") . "WEB_FORM_ID=" . $this->WEB_FORM_ID . "&strFormNote=" . urlencode($this->strFormNote)); } die; } if (strlen($_REQUEST["web_form_apply"]) > 0 && !(defined("ADMIN_SECTION") && ADMIN_SECTION === true) && $this->arParams["SEF_MODE"] == "Y") { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! LocalRedirect($this->arParams["EDIT_URL"] . (strpos($this->arParams["EDIT_URL"], "?") === false ? "?" : "&") . "strFormNote=" . urlencode($this->strFormNote)); die; } if (defined("ADMIN_SECTION") && ADMIN_SECTION === true) { if (strlen($_REQUEST["web_form_submit"]) > 0) { LocalRedirect(BX_ROOT . "/admin/form_result_list.php?lang=" . LANG . "&WEB_FORM_ID=" . $this->WEB_FORM_ID . "&strFormNote=" . urlencode($this->strFormNote)); } elseif (strlen($_REQUEST["web_form_apply"]) > 0) { LocalRedirect(BX_ROOT . "/admin/form_result_edit.php?lang=" . LANG . "&WEB_FORM_ID=" . $this->WEB_FORM_ID . "&RESULT_ID=" . $this->RESULT_ID . "&strFormNote=" . urlencode($this->strFormNote)); } die; } } else { if ($this->RESULT_ID = CFormResult::Add($this->WEB_FORM_ID, $this->arrVALUES)) { $this->strFormNote = GetMessage("FORM_DATA_SAVED1") . $this->RESULT_ID . GetMessage("FORM_DATA_SAVED2"); CFormResult::SetEvent($this->RESULT_ID); CFormResult::Mail($this->RESULT_ID); if ($this->F_RIGHT >= 15) { if (strlen($_REQUEST["web_form_submit"]) > 0 && strlen($this->arParams["LIST_URL"]) > 0) { if ($this->arParams["SEF_MODE"] == "Y") { LocalRedirect($this->arParams["LIST_URL"] . "?strFormNote=" . urlencode($this->strFormNote)); } else { LocalRedirect($this->arParams["LIST_URL"] . (strpos($this->arParams["LIST_URL"], "?") === false ? "?" : "&") . "WEB_FORM_ID=" . $this->WEB_FORM_ID . "&RESULT_ID=" . $this->RESULT_ID . "&strFormNote=" . urlencode($this->strFormNote)); } die; } elseif (strlen($_REQUEST["web_form_apply"]) > 0 && strlen($this->arParams["EDIT_URL"]) > 0) { if ($this->arParams["SEF_MODE"] == "Y") { LocalRedirect(str_replace("#RESULT_ID#", $this->RESULT_ID . $this->arParams["EDIT_URL"]) . "?strFormNote=" . urlencode($this->strFormNote)); } else { LocalRedirect($this->arParams["EDIT_URL"] . (strpos($this->arParams["EDIT_URL"], "?") === false ? "?" : "&") . "RESULT_ID=" . $this->RESULT_ID . "&strFormNote=" . urlencode($this->strFormNote)); } die; } $arResult["return"] = true; } else { LocalRedirect($APPLICATION->GetCurPage() . "?WEB_FORM_ID=" . $this->WEB_FORM_ID . "&strFormNote=" . urlencode($this->strFormNote)); die; } } else { $this->__form_validate_errors = $GLOBALS["strError"]; } } } } } return $arResult; }
// add fresh vReports CReport::addFreshDefaultReports($vReports, $ownerId); } } } } // create default reports by user request if ($isPost && !empty($_POST['CREATE_DEFAULT'])) { $dReports = call_user_func(array($helperClassName, 'getDefaultReports')); foreach ($dReports as $moduleVer => $vReports) { CReport::addFreshDefaultReports($vReports, $ownerId); } LocalRedirect($arParams['PATH_TO_REPORT_LIST']); } // main action $arResult['list'] = array(); $result = Bitrix\Report\ReportTable::getList(array('order' => array('ID' => 'ASC'), 'select' => array('ID', 'TITLE', 'DESCRIPTION', 'CREATED_DATE'), 'filter' => array('=CREATED_BY' => $USER->GetID(), '=OWNER_ID' => $ownerId))); while ($row = $result->fetch()) { $arResult['list'][] = $row; } // add default reports always if them isn't present if (empty($arResult['list'])) { $dReports = call_user_func(array($helperClassName, 'getDefaultReports')); foreach ($dReports as $moduleVer => $vReports) { CReport::addFreshDefaultReports($vReports, $ownerId); } LocalRedirect($arParams['PATH_TO_REPORT_LIST']); } global $DB; $arResult['dateFormat'] = $DB->DateFormatToPHP(CSite::GetDateFormat("SHORT")); $this->IncludeComponentTemplate();
$saleModulePermissions = $APPLICATION->GetGroupRight("sale"); $arUserGroups = $USER->GetUserGroupArray(); if ($saleModulePermissions == "D") { $APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED")); } require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/lib/helpers/admin/orderedit.php"; $allowedStatusesView = array(); //load order if (!empty($_REQUEST["ID"]) && intval($_REQUEST["ID"]) > 0) { $saleOrder = Bitrix\Sale\Order::load($_REQUEST["ID"]); } if ($saleOrder) { $allowedStatusesView = \Bitrix\Sale\OrderStatus::getStatusesUserCanDoOperations($USER->GetID(), array('view')); } if (!$saleOrder || !in_array($saleOrder->getField("STATUS_ID"), $allowedStatusesView)) { LocalRedirect("/bitrix/admin/sale_order.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_", false)); } $ID = intval($_REQUEST["ID"]); /** @var Bitrix\Sale\Order $saleOrder */ Admin\OrderEdit::initCouponsData($saleOrder->getUserId(), $ID); CUtil::InitJSCore(); $APPLICATION->SetTitle(Loc::getMessage("SALE_OVIEW_TITLE", array("#ID#" => $saleOrder->getId(), "#NUM#" => strlen($saleOrder->getField('ACCOUNT_NUMBER')) > 0 ? $saleOrder->getField('ACCOUNT_NUMBER') : $saleOrder->getId(), "#DATE#" => $saleOrder->getDateInsert()->toString()))); \Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_edit.js"); ob_start(); require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/admin/order_history.php"; $historyContent = ob_get_contents(); ob_end_clean(); require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php"; /* context menu */ $aMenu = array(); $aMenu[] = array("ICON" => "btn_list", "TEXT" => Loc::getMessage("SALE_OVIEW_TO_LIST"), "TITLE" => Loc::getMessage("SALE_OVIEW_TO_LIST_TITLE"), "LINK" => "/bitrix/admin/sale_order.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_"));
} foreach ($GROUP_EXCLUDE as $groupId) { if (is_numeric($groupId)) { $GROUP[] = array('MAILING_ID' => $ID, 'GROUP_ID' => $groupId, 'INCLUDE' => false); } } \Bitrix\Sender\MailingGroupTable::delete(array('MAILING_ID' => $ID)); foreach ($GROUP as $arGroup) { \Bitrix\Sender\MailingGroupTable::add($arGroup); } } if ($res) { if ($apply != "") { LocalRedirect("/bitrix/admin/sender_mailing_edit.php?ID=" . $ID . "&lang=" . LANG . "&" . $tabControl->ActiveTabParam()); } else { LocalRedirect("/bitrix/admin/sender_mailing_admin.php?lang=" . LANG); } } else { if (!empty($arError)) { $message = new CAdminMessage(implode("<br>", $arError)); } $bVarsFromForm = true; } } else { $GROUP_EXCLUDE = $GROUP_INCLUDE = array(); $groupDb = \Bitrix\Sender\MailingGroupTable::getList(array('select' => array('ID' => 'GROUP_ID', 'INCLUDE'), 'filter' => array('MAILING_ID' => $ID))); while ($arGroup = $groupDb->fetch()) { if ($arGroup['INCLUDE']) { $GROUP_INCLUDE[] = $arGroup['ID']; } else { $GROUP_EXCLUDE[] = $arGroup['ID'];
} elseif ($_REQUEST["ACTION"] == "CHANGELISTPROP") { if ($_REQUEST["showHiddenReports"] == "Y") $showHiddenReports = "Y"; else $showHiddenReports = "N"; CUserOptions::SetOption("checklist","show_hidden", $showHiddenReports); LocalRedirect($APPLICATION->GetCurPage()."?lang=".LANG,true); } elseif ($_REQUEST["ACTION"] == "ADDREPORT")//add report { $report_id = $checklist->AddReport(); CCheckListResult::Update($report_id, array('REPORT' => 'Y')); LocalRedirect($APPLICATION->GetCurPage()."?lang=".LANG,true); } elseif ($_REQUEST["ACTION"] == "ADDSENDREPORT")//add report and send to bitrix { if (isset($_REQUEST['report_id'])) { $report_id = intval($_REQUEST['report_id']); $dbReport = CCheckListResult::GetList(Array(),Array("REPORT"=>"Y", "ID" => $report_id)); if ($arReport = $dbReport->Fetch()) { $arFields = array(); if ($_POST["COMPANY_NAME"]) $arFields["COMPANY_NAME"] = $_POST["COMPANY_NAME"]; if ($_POST["CLIENT"]) $arFields["CLIENT"] = $_POST["CLIENT"]; if ($_POST["PHONE"])
/******************************************************************** /Input params ********************************************************************/ // Rapid Access $arParams["SHOW_FORUMS"] == "Y" if ($_GET["rapid_access"] == "Y") { $url = ""; if (strpos($_GET["FID"], "GID_") !== false) { $iGid = intVal(substr($_GET["FID"], 4)); if ($iGid > 0) { $url = str_replace("#GID#", $iGid, $arResult["URL_TEMPLATES"]["FORUMS"]); } } elseif (intVal($_GET["FID"]) > 0) { $url = str_replace("#FID#", intVal($_GET["FID"]), $arResult["URL_TEMPLATES"]["FORUM"]); } $url = empty($url) ? $arResult["URL_TEMPLATES"]["INDEX"] : $url; LocalRedirect($url); } // Show Page if ($this->__page !== "menu") { $sTempatePage = $this->__page; $sTempateFile = $this->__file; $this->__component->IncludeComponentTemplate("menu"); $this->__page = $sTempatePage; $this->__file = $sTempateFile; if ($arParams["SEO_USER"] == "TEXT" && strToLower($this->__page) == "profile_view" && $GLOBALS["USER"]->GetId() != $arResult["UID"] && $GLOBALS["APPLICATION"]->GetGroupRight("forum") < "W") { $APPLICATION->AuthForm(""); } if ($arParams["SHOW_FORUM_USERS"] != "N" && in_array(strToLower($this->__page), array("profile", "profile_view", "subscr_list", "user_post"))) { $GLOBALS["APPLICATION"]->AddChainItem(GetMessage("F_USERS"), CComponentEngine::MakePathFromTemplate($res["~URL_TEMPLATES_USER_LIST"], array())); } } else {
if ($isNewGroup) { $result = Model\VarsGroupTable::add($postData); $groupId = $result->getId(); } else { $result = Model\VarsGroupTable::update($dataGroup['ID'], $postData); $groupId = $dataGroup['ID']; } if (!$result->isSuccess()) { $errorsList = $result->getErrorMessages(); } else { if ($submitTypeApply) { $redirectPath = sprintf('user_vars_group_edit.php?ID=%dlang=%s', $groupId, LANGUAGE_ID); } else { $redirectPath = sprintf('user_vars.php?lang=%s', LANGUAGE_ID); } LocalRedirect($redirectPath); } foreach ($postData as $key => $value) { $dataGroup[$key] = $value; } } $tabControl = new CAdminTabControl('tabControl', $tabsStructur); $context = new CAdminContextMenu($contextMenu); $errorsList = isset($errorsList) ? $errorsList : array(); $dataGroup = array_map('htmlspecialchars', $dataGroup); $prologType = $request->getQuery('mode') == 'list' ? 'prolog_js' : 'prolog'; require sprintf('%s%s', getenv('DOCUMENT_ROOT'), $includePath[$prologType]); $context->show(); if (sizeof($errorsList) > 0) { CAdminMessage::ShowMessage(join(PHP_EOL, $errorsList)); }