1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
functions.php
См. документацию.
1<?php
2
3use \Bitrix\Main\Application;
4
15
16
17function qiwiLog($data)
18{
19 file_put_contents(__DIR__ . "/log.txt", $data, FILE_APPEND);
20}
21
22if(!function_exists("qiwiWalletGetAuthHeader"))
23{
24 function qiwiWalletGetAuthHeader()
25 {
26 $incomingToken = false;
27 if(isset($_SERVER["REMOTE_USER"]) && $_SERVER["REMOTE_USER"] <> '')
28 $incomingToken = $_SERVER["REMOTE_USER"];
29 elseif(isset($_SERVER["REDIRECT_REMOTE_USER"]) && $_SERVER["REDIRECT_REMOTE_USER"] <> '')
30 $incomingToken = $_SERVER["REDIRECT_REMOTE_USER"];
31 elseif(isset($_SERVER["HTTP_AUTHORIZATION"]) && $_SERVER["HTTP_AUTHORIZATION"] <> '')
32 $incomingToken = $_SERVER["HTTP_AUTHORIZATION"];
33 elseif(function_exists("apache_request_headers"))
34 {
35 $headers = \apache_request_headers();
36
37 if(array_key_exists("Authorization", $headers))
38 $incomingToken = $headers["Authorization"];
39 }
40 return $incomingToken;
41 }
42}
43
44if(!function_exists("qiwiWalletCheckAuth"))
45{
46 function qiwiWalletCheckAuth($login, $password)
47 {
48 if($password == '')
49 return false;
50
51 $header = qiwiWalletGetAuthHeader();
52
53 if(!$header)
54 return false;
55
56 $check = "Basic " . base64_encode("{$login}:{$password}");
57 return $header == $check;
58 }
59}
60
61if(!function_exists("qiwiWalletXmlResponse"))
62{
63 function qiwiWalletXmlResponse($code)
64 {
65 global $APPLICATION;
66 $APPLICATION->RestartBuffer();
67 header("Content-Type: text/xml");
68 header("Pragma: no-cache");
69 $xml = '<?xml version="1.0" encoding="UTF-8"?><result><result_code>' . $code . '</result_code></result>';
70 $siteCharset = Application::getInstance()->getContext()->getCulture()->getCharset();
71 print \CharsetConverter::getInstance()->ConvertCharset($xml, $siteCharset, "utf-8");
72 die();
73 }
74}
global $APPLICATION
Определения include.php:80
$login
Определения change_password.php:8
$data['IS_AVAILABLE']
Определения .description.php:13
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
die
Определения quickway.php:367
$password
Определения result.php:7
const QIWI_WALLET_ERROR_CODE_NOT_FOUND
Определения functions.php:9
const QIWI_WALLET_ERROR_CODE_EXISTS
Определения functions.php:10
qiwiLog($data)
Определения functions.php:17
const QIWI_WALLET_ERROR_CODE_TOO_LOW
Определения functions.php:11
const QIWI_WALLET_ERROR_CODE_NONE
Определения functions.php:5
const QIWI_WALLET_ERROR_CODE_OTHER
Определения functions.php:14
const QIWI_WALLET_ERROR_CODE_AUTH
Определения functions.php:8
const QIWI_WALLET_ERROR_CODE_NO_PURSE
Определения functions.php:13
const QIWI_WALLET_ERROR_CODE_TOO_HIGH
Определения functions.php:12
const QIWI_WALLET_ERROR_CODE_BAD_REQUEST
Определения functions.php:6
const QIWI_WALLET_ERROR_CODE_BUSY
Определения functions.php:7