From 64437da2ab9d7477fd88298feb8daa5470a517ac Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 15 Oct 2024 16:43:42 +0300 Subject: [PATCH 1/3] Aggregation programs URL rename for cargo section --- .../index.php | 2 +- urlrewrite.php | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) rename programs/{gruzovye-avtomobili-v-lizing => gruzovaya-tekhnika-v-lizing}/index.php (96%) diff --git a/programs/gruzovye-avtomobili-v-lizing/index.php b/programs/gruzovaya-tekhnika-v-lizing/index.php similarity index 96% rename from programs/gruzovye-avtomobili-v-lizing/index.php rename to programs/gruzovaya-tekhnika-v-lizing/index.php index 6afc5f7..d2215e6 100644 --- a/programs/gruzovye-avtomobili-v-lizing/index.php +++ b/programs/gruzovaya-tekhnika-v-lizing/index.php @@ -22,7 +22,7 @@ require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); "IBLOCK_ID_RULES" => IBLOCK_ID_PROGRAMS_AGGREGATION_RULES_CARGO, "IBLOCK_ID_PROGRAMS_AGGREGATION" => IBLOCK_ID_PROGRAMS_AGGREGATION_CARGO, "IBLOCK_ID_PROGRAMS_AGGREGATION_BRANDS" => IBLOCK_ID_PROGRAMS_AGGREGATION_BRANDS_CARGO, - "PATH" => "gruzovye-avtomobili-v-lizing", + "PATH" => "gruzovaya-tekhnika-v-lizing", "SPECIAL_OFFERS_TITLE" => "Акции и скидки на грузовую технику в лизинг", ] ); diff --git a/urlrewrite.php b/urlrewrite.php index d5927ab..782e665 100644 --- a/urlrewrite.php +++ b/urlrewrite.php @@ -34,10 +34,10 @@ $arUrlRewrite=array ( ), 9 => array ( - 'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/brand-([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/\\??.*$#', + 'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/brand-([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/\\??.*$#', 'RULE' => 'BRAND=$1&TYPE=$2', 'ID' => '', - 'PATH' => '/programs/gruzovye-avtomobili-v-lizing/index.php', + 'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php', 'SORT' => 5, ), 18 => @@ -58,10 +58,10 @@ $arUrlRewrite=array ( ), 11 => array ( - 'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/\\??.*$#', + 'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/\\??.*$#', 'RULE' => 'GROUP=$1&TYPE=$2', 'ID' => '', - 'PATH' => '/programs/gruzovye-avtomobili-v-lizing/index.php', + 'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php', 'SORT' => 5, ), 14 => @@ -82,10 +82,10 @@ $arUrlRewrite=array ( ), 10 => array ( - 'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/brand-([a-zA-Z0-9_-]+)/\\??.*$#', + 'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/brand-([a-zA-Z0-9_-]+)/\\??.*$#', 'RULE' => 'BRAND=$1', 'ID' => '', - 'PATH' => '/programs/special/index.php', + 'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php', 'SORT' => 5, ), 15 => @@ -106,10 +106,10 @@ $arUrlRewrite=array ( ), 12 => array ( - 'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/([a-zA-Z0-9_-]+)/\\??.*$#', + 'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/([a-zA-Z0-9_-]+)/\\??.*$#', 'RULE' => 'GROUP=$1', 'ID' => '', - 'PATH' => '/programs/gruzovye-avtomobili-v-lizing/index.php', + 'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php', 'SORT' => 5, ), 7 => @@ -130,10 +130,10 @@ $arUrlRewrite=array ( ), 13 => array ( - 'CONDITION' => '#^/programs/gruzovye-avtomobili-v-lizing/\\??.*$#', + 'CONDITION' => '#^/programs/gruzovaya-tekhnika-v-lizing/\\??.*$#', 'RULE' => '', 'ID' => '', - 'PATH' => '/programs/gruzovye-avtomobili-v-lizing/index.php', + 'PATH' => '/programs/gruzovaya-tekhnika-v-lizing/index.php', 'SORT' => 5, ), 8 => From 2a3a4ea45b664200373a5d23a7c9fbd1da14a09e Mon Sep 17 00:00:00 2001 From: merelendor Date: Fri, 29 Nov 2024 14:34:31 +0300 Subject: [PATCH 2/3] update for API account section, add HTTP status codes for negative response, security fix for empty email code --- api/index.php | 72 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 13 deletions(-) diff --git a/api/index.php b/api/index.php index 1451af9..0d93efa 100644 --- a/api/index.php +++ b/api/index.php @@ -512,6 +512,7 @@ switch($PARAM_1) } else { + http_response_code(409); print json_encode([ "status" => "error", "error" => "company_already_registered", @@ -566,6 +567,7 @@ switch($PARAM_1) //echo "
".print_r($arFields, true)."
"; //echo $error; + http_response_code(400); print json_encode([ "status" => "error", "error" => "wrong_payload", @@ -577,6 +579,7 @@ switch($PARAM_1) } else { + http_response_code(409); print json_encode([ "status" => "error", "error" => "company_already_registered", @@ -675,6 +678,7 @@ switch($PARAM_1) { //new company + http_response_code(404); print json_encode([ "status" => "error", "error" => "no_company_for_update", @@ -728,6 +732,7 @@ switch($PARAM_1) } else { + http_response_code(400); print json_encode([ "status" => "error", "error" => "wrong_payload", @@ -741,6 +746,7 @@ switch($PARAM_1) { //no company + http_response_code(404); print json_encode([ "status" => "error", "error" => "no_company_for_update", @@ -791,6 +797,7 @@ switch($PARAM_1) { if(!in_array($auth['acc_number'], $existed_accounts)) { + http_response_code(401); print json_encode([ "status" => "error", "error" => "access_denied", @@ -836,6 +843,7 @@ switch($PARAM_1) } else { + http_response_code(404); print json_encode([ "status" => "error", "error" => "unknown account", @@ -845,6 +853,7 @@ switch($PARAM_1) } catch(\Exception $e) { + http_response_code(401); print json_encode([ "status" => "error", "error" => "wrong_jwt", @@ -855,6 +864,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", @@ -891,6 +901,7 @@ switch($PARAM_1) default: { + http_response_code(400); print json_encode([ "status" => "error", "error" => "wrong_user_uri", @@ -930,6 +941,7 @@ switch($PARAM_1) } catch(\Exception $e) { + http_response_code(401); print json_encode([ "status" => "error", "error" => "wrong_jwt", @@ -940,6 +952,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", @@ -1054,6 +1067,7 @@ switch($PARAM_1) } catch(\Exception $e) { + http_response_code(401); print json_encode([ "status" => "error", "error" => "wrong_jwt", @@ -1064,6 +1078,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", @@ -1141,6 +1156,7 @@ switch($PARAM_1) } catch(\Exception $e) { + http_response_code(401); print json_encode([ "status" => "error", "error" => "wrong_jwt", @@ -1151,6 +1167,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", @@ -1163,6 +1180,7 @@ switch($PARAM_1) default: { + http_response_code(400); print json_encode([ "status" => "error", "error" => "wrong_admin_uri", @@ -2600,24 +2618,37 @@ switch($PARAM_1) if(is_array($ar_user)) { - if(SEND_EMAIL_PASSWORD_RECOVERY_CODE) + if(!empty($REQ['code'])) { - \Bitrix\Main\Mail\Event::send([ - "EVENT_NAME" => "USER_PASSWORD_RECOVERY_CODE", - "LID" => "s1", - "C_FIELDS" => Array( - "EMAIL" => $REQ['email'], - "CODE" => $REQ['code'], - ) + if(SEND_EMAIL_PASSWORD_RECOVERY_CODE) + { + \Bitrix\Main\Mail\Event::send([ + "EVENT_NAME" => "USER_PASSWORD_RECOVERY_CODE", + "LID" => "s1", + "C_FIELDS" => Array( + "EMAIL" => $REQ['email'], + "CODE" => $REQ['code'], + ) + ]); + } + + print json_encode([ + "status" => "success", ]); } - - print json_encode([ - "status" => "success", - ]); + else + { + http_response_code(400); + print json_encode([ + "status" => "error", + "error" => "empty_code", + "message" => "Empty code", + ]); + } } else { + http_response_code(404); print json_encode([ "status" => "error", "error" => "wrong_email", @@ -2627,6 +2658,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", @@ -2655,6 +2687,7 @@ switch($PARAM_1) if($user->LAST_ERROR) { + http_response_code(400); print json_encode([ "status" => "error", "error" => "wrong_payload", @@ -2670,6 +2703,7 @@ switch($PARAM_1) } else { + http_response_code(404); print json_encode([ "status" => "error", "error" => "wrong_email", @@ -2679,6 +2713,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", @@ -2718,6 +2753,7 @@ switch($PARAM_1) if($user->LAST_ERROR) { + http_response_code(400); print json_encode([ "status" => "error", "error" => "wrong_payload", @@ -2725,7 +2761,7 @@ switch($PARAM_1) ]); } else - { + { print json_encode([ "status" => "success", ]); @@ -2733,6 +2769,7 @@ switch($PARAM_1) } else { + http_response_code(404); print json_encode([ "status" => "error", "error" => "unknow_user", @@ -2742,6 +2779,7 @@ switch($PARAM_1) } else { + http_response_code(404); print json_encode([ "status" => "error", "error" => "wrong_email", @@ -2751,6 +2789,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", @@ -2792,6 +2831,7 @@ switch($PARAM_1) if($user->LAST_ERROR) { + http_response_code(400); print json_encode([ "status" => "error", "error" => "wrong_payload", @@ -2807,6 +2847,7 @@ switch($PARAM_1) } else { + http_response_code(404); print json_encode([ "status" => "error", "error" => "wrong_company", @@ -2816,6 +2857,7 @@ switch($PARAM_1) } else { + http_response_code(404); print json_encode([ "status" => "error", "error" => "wrong_email", @@ -2825,6 +2867,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", @@ -2880,6 +2923,7 @@ switch($PARAM_1) } else { + http_response_code(401); print json_encode([ "status" => "error", "error" => "wrong_credentials", @@ -2934,6 +2978,7 @@ switch($PARAM_1) } else { + http_response_code(404); print json_encode([ "status" => "error", "error" => "unknown_user", @@ -2943,6 +2988,7 @@ switch($PARAM_1) } else { + http_response_code(403); print json_encode([ "status" => "error", "error" => "wrong_source", From 39665a59a1565a9bed6260b59765220314fa23c6 Mon Sep 17 00:00:00 2001 From: merelendor Date: Fri, 29 Nov 2024 14:36:13 +0300 Subject: [PATCH 3/3] typo fix for Vizitka component --- .../vizitka/templates/.default/template.php | 133 +++++++++--------- 1 file changed, 65 insertions(+), 68 deletions(-) diff --git a/local/components/evolution/vizitka/templates/.default/template.php b/local/components/evolution/vizitka/templates/.default/template.php index fb545a4..782e23c 100644 --- a/local/components/evolution/vizitka/templates/.default/template.php +++ b/local/components/evolution/vizitka/templates/.default/template.php @@ -14,72 +14,69 @@ $this->setFrameMode(true); ?>
- -
-
-

-

-

-
-
- - " alt="" /> - - - -
- -
-

- Сохраните контакт на телефон -

- .png" /> -
-
-
- -
-
-
-
-

- Упс! Такой
визитки
не существует
-

-
-
-

- Просто позвоните
по номеру
8 800 333 75 75
-

-
-
-

- или отправьте
заявку на лизинг
из формы ниже
-

-
-
+ +
+
+

+

+

+
+
+ + " alt="" /> + + +
-
- - \ No newline at end of file + +
+

+ Сохраните контакт на телефон +

+ .png" /> +
+
+ +
+ +
+
+
+
+

+ Упс! Такой
визитки
не существует
+

+
+
+

+ Просто позвоните
по номеру
8 800 333 75 75
+

+
+
+

+ или отправьте
заявку на лизинг
из формы ниже
+

+
+
+
+
+ \ No newline at end of file