From 77d262f5fbb9f62fafa4f566e1a5f7481100df6a Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 23 Feb 2024 05:56:56 +0300 Subject: [PATCH 01/20] Added translation using Weblate (Thai) --- Messages/th.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 Messages/th.php diff --git a/Messages/th.php b/Messages/th.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/Messages/th.php @@ -0,0 +1 @@ + Date: Thu, 30 May 2024 09:23:55 +0000 Subject: [PATCH 02/20] Translated using Weblate (Thai) Currently translated at 69.2% (9 of 13 strings) Translation: MIKOPBX/ModulePT1CCore Translate-URL: https://weblate.mikopbx.com/projects/mikopbx/modulept1ccore/th/ --- Messages/th.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Messages/th.php b/Messages/th.php index b3d9bbc..7358c73 100644 --- a/Messages/th.php +++ b/Messages/th.php @@ -1 +1,12 @@ 'โมดูลสำหรับจัดการการโทรจากคอมพิวเตอร์', + 'module_pt1c_coreConnected' => 'เชื่อมต่อโมดูลแล้ว', + 'module_pt1c_coreDisconnected' => 'ปิดใช้งานโมดูลแล้ว', + 'module_pt1c_coreUpdateStatus' => 'อัพเดทสถานะ', + 'module_pt1c_core_WikiDocsRussian' => 'เอกสาร Wiki สำหรับการตั้งค่าโมดูล', + 'module_pt1c_core_WebinarLinkRussian' => 'การสัมมนาผ่านเว็บเกี่ยวกับการตั้งค่าโมดูล', + 'module_pt1c_core_Forum' => 'ฟอรั่ม', + 'module_pt1c_core_LinksRussian' => 'ลิงค์ที่มีประโยชน์ (รัสเซีย)', + 'fw_modulept1ccoreDescription' => 'CTI CLIENT - แผงโทรศัพท์ 1.0 สำหรับ 1C', +]; From 4fcc692690f9717accffaf69cbd44c82636c41b0 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 30 Jul 2024 10:24:12 +0300 Subject: [PATCH 03/20] Added translation using Weblate (Hungarian) --- Messages/hu.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 Messages/hu.php diff --git a/Messages/hu.php b/Messages/hu.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/Messages/hu.php @@ -0,0 +1 @@ + Date: Tue, 30 Jul 2024 12:41:33 +0000 Subject: [PATCH 04/20] Translated using Weblate (Hungarian) Currently translated at 84.6% (11 of 13 strings) Translation: MIKOPBX/ModulePT1CCore Translate-URL: https://weblate.mikopbx.com/projects/mikopbx/modulept1ccore/hu/ --- Messages/hu.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Messages/hu.php b/Messages/hu.php index b3d9bbc..d41927e 100644 --- a/Messages/hu.php +++ b/Messages/hu.php @@ -1 +1,14 @@ 'Telefonpanel 1.0 1C-hez', + 'SubHeaderModulePT1CCore' => 'Modul a számítógépes hívásvezérléshez', + 'module_pt1c_coreConnected' => 'Modul csatlakoztatva', + 'module_pt1c_coreDisconnected' => 'Modul letiltva', + 'module_pt1c_coreUpdateStatus' => 'Állapotfrissítés', + 'module_pt1c_core_WebinarLinkRussian' => 'Webinárium a modul beállításáról', + 'module_pt1c_core_Forum' => 'Fórum', + 'module_pt1c_core_LinksRussian' => 'Hasznos linkek (orosz)', + 'f2b_Jail_module_p_t1_c_core' => 'Hibák a CTI-ügyfelek vagy 1C-panelek engedélyezése során', + 'module_pt1c_core_WikiDocsRussian' => 'Wiki dokumentáció a modul konfigurálásáról', + 'fw_modulept1ccoreDescription' => 'CTI CLIENT - Telefonos panel 1.0 az 1C számára', +]; From f4739336b2344dfda60a8a0a7a9356d41a98174d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juh=C3=A1sz=20B=C3=A9la?= Date: Thu, 22 Aug 2024 07:12:24 +0000 Subject: [PATCH 05/20] Translated using Weblate (Hungarian) Currently translated at 100.0% (13 of 13 strings) Translation: MIKOPBX/ModulePT1CCore Translate-URL: https://weblate.mikopbx.com/projects/mikopbx/modulept1ccore/hu/ --- Messages/hu.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Messages/hu.php b/Messages/hu.php index d41927e..94616c9 100644 --- a/Messages/hu.php +++ b/Messages/hu.php @@ -1,14 +1,23 @@ 'Telefonpanel 1.0 1C-hez', - 'SubHeaderModulePT1CCore' => 'Modul a számítógépes hívásvezérléshez', + 'SubHeaderModulePT1CCore' => 'Modul a hívások kezelésére számítógépről', 'module_pt1c_coreConnected' => 'Modul csatlakoztatva', 'module_pt1c_coreDisconnected' => 'Modul letiltva', 'module_pt1c_coreUpdateStatus' => 'Állapotfrissítés', 'module_pt1c_core_WebinarLinkRussian' => 'Webinárium a modul beállításáról', 'module_pt1c_core_Forum' => 'Fórum', 'module_pt1c_core_LinksRussian' => 'Hasznos linkek (orosz)', - 'f2b_Jail_module_p_t1_c_core' => 'Hibák a CTI-ügyfelek vagy 1C-panelek engedélyezése során', - 'module_pt1c_core_WikiDocsRussian' => 'Wiki dokumentáció a modul konfigurálásáról', - 'fw_modulept1ccoreDescription' => 'CTI CLIENT - Telefonos panel 1.0 az 1C számára', + 'f2b_Jail_module_p_t1_c_core' => 'Hibák a CTI-kliensek vagy az 1C-panelek engedélyezése során', + 'module_pt1c_core_WikiDocsRussian' => 'Wiki dokumentáció a modul beállításához', + 'fw_modulept1ccoreDescription' => 'CTI CLIENT - Telefonpanel 1.0 1C-hez', + /** + * Copyright (C) MIKO LLC - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited + * Proprietary and confidential + * Written by Nikolay Beketov, 6 2018 + * + */ + 'repModulePT1CCore' => 'Telefonpanel 1.0, 1C:Enterprise – %repesent%', + 'mo_ModuleModulePT1CCore' => 'Telefonpanel 1.0 1C-hez', ]; From 3428ae1ea560ee0ee2d8b826e5da38ce2ec0874b Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 6 Sep 2024 07:00:34 +0300 Subject: [PATCH 06/20] Added translation using Weblate (Finnish) --- Messages/fi.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 Messages/fi.php diff --git a/Messages/fi.php b/Messages/fi.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/Messages/fi.php @@ -0,0 +1 @@ + Date: Mon, 16 Sep 2024 05:02:23 +0300 Subject: [PATCH 07/20] Added translation using Weblate (languages (generated) (languages)) --- Messages/languages.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 Messages/languages.php diff --git a/Messages/languages.php b/Messages/languages.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/Messages/languages.php @@ -0,0 +1 @@ + Date: Tue, 1 Oct 2024 15:52:27 +0700 Subject: [PATCH 08/20] Update for PHP 8.3 and Phalcon 5.8 --- App/Controllers/ModulePT1CCoreController.php | 3 +- App/Forms/ModulePT1CCoreForm.php | 6 -- Lib/MikoPBXVersion.php | 84 ++++++++++++++++++++ Lib/PT1CCoreMain.php | 4 - Lib/RestAPI/Controllers/GetController.php | 1 - composer.json | 7 +- 6 files changed, 90 insertions(+), 15 deletions(-) create mode 100644 Lib/MikoPBXVersion.php diff --git a/App/Controllers/ModulePT1CCoreController.php b/App/Controllers/ModulePT1CCoreController.php index a747f17..6c3ca8e 100644 --- a/App/Controllers/ModulePT1CCoreController.php +++ b/App/Controllers/ModulePT1CCoreController.php @@ -5,12 +5,13 @@ * Proprietary and confidential * Written by Alexey Portnov, 11 2018 */ + + namespace Modules\ModulePT1CCore\App\Controllers; use MikoPBX\AdminCabinet\Controllers\BaseController; use MikoPBX\Modules\PbxExtensionUtils; use Modules\ModulePT1CCore\App\Forms\ModulePT1CCoreForm; use Modules\ModulePT1CCore\Models\ModulePT1CCore; -use MikoPBX\Common\Models\Providers; class ModulePT1CCoreController extends BaseController { diff --git a/App/Forms/ModulePT1CCoreForm.php b/App/Forms/ModulePT1CCoreForm.php index d221448..cabb6d7 100644 --- a/App/Forms/ModulePT1CCoreForm.php +++ b/App/Forms/ModulePT1CCoreForm.php @@ -9,13 +9,7 @@ namespace Modules\ModulePT1CCore\App\Forms; use Phalcon\Forms\Form; -use Phalcon\Forms\Element\Text; -use Phalcon\Forms\Element\Numeric; -use Phalcon\Forms\Element\Password; -use Phalcon\Forms\Element\Check; -use Phalcon\Forms\Element\TextArea; use Phalcon\Forms\Element\Hidden; -use Phalcon\Forms\Element\Select; class ModulePT1CCoreForm extends Form diff --git a/Lib/MikoPBXVersion.php b/Lib/MikoPBXVersion.php new file mode 100644 index 0000000..85d8f9f --- /dev/null +++ b/Lib/MikoPBXVersion.php @@ -0,0 +1,84 @@ +'); + } + + /** + * Return Di interface for the current version of PBX + * @return \Phalcon\Di\DiInterface|null + */ + public static function getDefaultDi():\Phalcon\Di\DiInterface|null + { + if (self::isPhalcon5Version()) { + return \Phalcon\Di\Di::getDefault(); + } else { + return \Phalcon\Di::getDefault(); + } + } + + /** + * Return Validation class for the current version of PBX + * @return class-string<\Phalcon\Filter\Validation>|class-string<\Phalcon\Validation> + */ + public static function getValidationClass():string + { + if (self::isPhalcon5Version()) { + return \Phalcon\Filter\Validation::class; + } else { + return \Phalcon\Validation::class; + } + } + + /** + * Return Uniqueness class for the current version of PBX + * @return class-string<\Phalcon\Filter\Validation\Validator\Uniqueness>|class-string<\Phalcon\Validation\Validator\Uniqueness> + */ + public static function getUniquenessClass():string + { + if (self::isPhalcon5Version()) { + return \Phalcon\Filter\Validation\Validator\Uniqueness::class; + } else { + return \Phalcon\Validation\Validator\Uniqueness::class; + } + } + + /** + * Return Text class for the current version of PBX + * + * @return class-string<\MikoPBX\Common\Library\Text>|class-string<\Phalcon\Text> + */ + public static function getTextClass():string + { + if (self::isPhalcon5Version()) { + return \MikoPBX\Common\Library\Text::class; + } else { + return \Phalcon\Text::class; + } + } + + /** + * Return Logger class for the current version of PBX + * + * @return class-string<\Phalcon\Logger\Logger>|class-string<\Phalcon\Logger> + */ + public static function getLoggerClass():string + { + if (self::isPhalcon5Version()) { + return \Phalcon\Logger\Logger::class; + } else { + return \Phalcon\Logger::class; + } + } +} \ No newline at end of file diff --git a/Lib/PT1CCoreMain.php b/Lib/PT1CCoreMain.php index 311cb49..e69a496 100644 --- a/Lib/PT1CCoreMain.php +++ b/Lib/PT1CCoreMain.php @@ -2,11 +2,7 @@ namespace Modules\ModulePT1CCore\Lib; - -use MikoPBX\Core\System\Util; -use MikoPBX\Core\Workers\Cron\WorkerSafeScriptsCore; use MikoPBX\Modules\PbxExtensionBase; -use MikoPBX\Modules\PbxExtensionUtils; use MikoPBX\PBXCoreREST\Lib\PBXApiResult; class PT1CCoreMain extends PbxExtensionBase diff --git a/Lib/RestAPI/Controllers/GetController.php b/Lib/RestAPI/Controllers/GetController.php index c4fcdc6..3d7f2b0 100644 --- a/Lib/RestAPI/Controllers/GetController.php +++ b/Lib/RestAPI/Controllers/GetController.php @@ -8,7 +8,6 @@ namespace Modules\ModulePT1CCore\Lib\RestAPI\Controllers; use MikoPBX\Core\System\BeanstalkClient; -use MikoPBX\Core\System\Util; use MikoPBX\Core\Workers\WorkerCdr; use MikoPBX\PBXCoreREST\Controllers\BaseController; diff --git a/composer.json b/composer.json index 710a6b6..9c9cb81 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "mikopbx/modulept1ccore", "description": "ModulePT1CCore", "require": { + "php": "^7.4 || ^8.0", "mikopbx/core": ">=2020.2.757" }, "autoload": { @@ -29,7 +30,7 @@ "wiki": "https://wiki.mikopbx.com", "issues": "https://github.com/mikopbx/Core/issues", "source": "https://github.com/mikopbx/Core", - "forum": "https://qa.askozia.ru", + "forum": "https://qa.mikopbx.ru", "chat": "https://t.me/mikopbx_dev" }, "authors": [ @@ -42,7 +43,7 @@ { "name": "Nikolay Beketov", "email": "nbek@miko.ru", - "homepage": "http://facebook.com/jorikfon", + "homepage": "https://www.linkedin.com/in/nikolay-beketov", "role": "Developer" } ], @@ -55,7 +56,7 @@ "config": { "sort-packages": true, "platform": { - "php": "7.4.6" + "php": "^7.4 || ^8.0" } } } From cdbf9650ba11770bf165a44d9202f22cdaffe762 Mon Sep 17 00:00:00 2001 From: Nikolay Beketov Date: Mon, 7 Oct 2024 18:20:50 +0700 Subject: [PATCH 09/20] Update for PHP 8.3 and Phalcon 5.8 --- Lib/MikoPBXVersion.php | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/Lib/MikoPBXVersion.php b/Lib/MikoPBXVersion.php index 85d8f9f..a6c67bc 100644 --- a/Lib/MikoPBXVersion.php +++ b/Lib/MikoPBXVersion.php @@ -1,6 +1,24 @@ . + */ namespace Modules\ModulePT1CCore\Lib; + use MikoPBX\Common\Models\PbxSettings; class MikoPBXVersion @@ -9,7 +27,7 @@ class MikoPBXVersion * Return true if current version of PBX based on Phalcon 5+ * @return bool */ - public static function isPhalcon5Version():bool + public static function isPhalcon5Version(): bool { $pbxVersion = PbxSettings::getValueByKey('PBXVersion'); return version_compare($pbxVersion, '2024.2.30', '>'); @@ -19,7 +37,7 @@ public static function isPhalcon5Version():bool * Return Di interface for the current version of PBX * @return \Phalcon\Di\DiInterface|null */ - public static function getDefaultDi():\Phalcon\Di\DiInterface|null + public static function getDefaultDi() { if (self::isPhalcon5Version()) { return \Phalcon\Di\Di::getDefault(); @@ -32,7 +50,7 @@ public static function getDefaultDi():\Phalcon\Di\DiInterface|null * Return Validation class for the current version of PBX * @return class-string<\Phalcon\Filter\Validation>|class-string<\Phalcon\Validation> */ - public static function getValidationClass():string + public static function getValidationClass(): string { if (self::isPhalcon5Version()) { return \Phalcon\Filter\Validation::class; @@ -45,7 +63,7 @@ public static function getValidationClass():string * Return Uniqueness class for the current version of PBX * @return class-string<\Phalcon\Filter\Validation\Validator\Uniqueness>|class-string<\Phalcon\Validation\Validator\Uniqueness> */ - public static function getUniquenessClass():string + public static function getUniquenessClass(): string { if (self::isPhalcon5Version()) { return \Phalcon\Filter\Validation\Validator\Uniqueness::class; @@ -59,7 +77,7 @@ public static function getUniquenessClass():string * * @return class-string<\MikoPBX\Common\Library\Text>|class-string<\Phalcon\Text> */ - public static function getTextClass():string + public static function getTextClass(): string { if (self::isPhalcon5Version()) { return \MikoPBX\Common\Library\Text::class; @@ -73,7 +91,7 @@ public static function getTextClass():string * * @return class-string<\Phalcon\Logger\Logger>|class-string<\Phalcon\Logger> */ - public static function getLoggerClass():string + public static function getLoggerClass(): string { if (self::isPhalcon5Version()) { return \Phalcon\Logger\Logger::class; @@ -81,4 +99,4 @@ public static function getLoggerClass():string return \Phalcon\Logger::class; } } -} \ No newline at end of file +} From e6bbcf806b59124726fa17837f390f7b41361d26 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 19 Nov 2024 02:03:52 +0300 Subject: [PATCH 10/20] Added translation using Weblate (Croatian) --- Messages/hr.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 Messages/hr.php diff --git a/Messages/hr.php b/Messages/hr.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/Messages/hr.php @@ -0,0 +1 @@ + Date: Thu, 5 Jun 2025 14:52:40 +0300 Subject: [PATCH 11/20] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D1=81=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D1=83=20=D0=B2=20GitHub?= =?UTF-8?q?=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 15 +++++++++++++++ Lib/RestAPI/Controllers/PostController.php | 2 +- module.json | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..199e0e6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,15 @@ +name: Build and Publish + +on: + push: + branches: + - master + - develop + workflow_dispatch: + +jobs: + build: + uses: mikopbx/.github-workflows/.github/workflows/extension-publish.yml@master + with: + initial_version: "1.39" + secrets: inherit \ No newline at end of file diff --git a/Lib/RestAPI/Controllers/PostController.php b/Lib/RestAPI/Controllers/PostController.php index a0fd90c..f98c331 100644 --- a/Lib/RestAPI/Controllers/PostController.php +++ b/Lib/RestAPI/Controllers/PostController.php @@ -26,7 +26,7 @@ namespace Modules\ModulePT1CCore\Lib\RestAPI\Controllers; -use MikoPBX\Common\Providers\BeanstalkConnectionWorkerApiProvider; +// use MikoPBX\Common\Providers\BeanstalkConnectionWorkerApiProvider; //DEPRICATED use MikoPBX\Core\System\Util; use MikoPBX\PBXCoreREST\Controllers\BaseController; use MikoPBX\PBXCoreREST\Lib\FilesManagementProcessor; diff --git a/module.json b/module.json index 82cccf8..c0ba5e0 100644 --- a/module.json +++ b/module.json @@ -7,5 +7,10 @@ "wiki_links": { "ru": {"https://wiki.mikopbx.com/module-p-t1-c-core": "https://wiki.miko.ru/astpanel"}, "en": {"https://wiki.mikopbx.com/module-p-t1-c-core": "https://wiki.miko.ru/astpanel"} + }, + "release_settings": { + "publish_release": true, + "changelog_enabled": true, + "create_github_release": true } } From 7955315892158a893145dc988628cfd1bd1e22d5 Mon Sep 17 00:00:00 2001 From: SUMONCHAI WONGPITAK Date: Fri, 13 Jun 2025 02:02:36 +0000 Subject: [PATCH 12/20] Translated using Weblate (Thai) Currently translated at 100.0% (13 of 13 strings) Translation: MIKOPBX/ModulePT1CCore Translate-URL: https://weblate.mikopbx.com/projects/mikopbx/modulept1ccore/th/ --- Messages/th.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Messages/th.php b/Messages/th.php index 7358c73..1895770 100644 --- a/Messages/th.php +++ b/Messages/th.php @@ -9,4 +9,15 @@ 'module_pt1c_core_Forum' => 'ฟอรั่ม', 'module_pt1c_core_LinksRussian' => 'ลิงค์ที่มีประโยชน์ (รัสเซีย)', 'fw_modulept1ccoreDescription' => 'CTI CLIENT - แผงโทรศัพท์ 1.0 สำหรับ 1C', + /** + * Copyright (C) MIKO LLC - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited + * Proprietary and confidential + * Written by Nikolay Beketov, 6 2018 + * + */ + 'repModulePT1CCore' => 'แผงโทรศัพท์ 1.0 สำหรับ 1C: Enterprise - %repesent%', + 'mo_ModuleModulePT1CCore' => 'แผงโทรศัพท์ 1.0 สำหรับ 1C: Enterprise', + 'BreadcrumbModulePT1CCore' => 'แผงโทรศัพท์ 1.0 สำหรับ 1C: Enterprise', + 'f2b_Jail_module_p_t1_c_core' => 'ข้อผิดพลาดในการตรวจสอบสิทธิ์ของลูกค้า CTI หรือแผง 1C', ]; From b83bce43752be8ceb0111d4f94c8d1f95da37963 Mon Sep 17 00:00:00 2001 From: boffart <5922739+boffart@users.noreply.github.com> Date: Thu, 10 Jul 2025 10:26:16 +0300 Subject: [PATCH 13/20] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D0=BB=20REST=20API=20=D0=B4=D0=BB=D1=8F=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D0=B5=D0=B9=20=D1=80=D0=B0=D0=B7=D0=B3=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/PT1CCoreConf.php | 1 + Lib/RestAPI/Controllers/GetController.php | 54 +++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/Lib/PT1CCoreConf.php b/Lib/PT1CCoreConf.php index 34a28ac..4e2e964 100644 --- a/Lib/PT1CCoreConf.php +++ b/Lib/PT1CCoreConf.php @@ -194,6 +194,7 @@ public function createNginxLocations(): string public function getPBXCoreRESTAdditionalRoutes(): array { return [ + [GetController::class, 'getRecordsPathByIdAction', '/pbxcore/api/cdr/records-path', 'get', '/', true], [GetController::class, 'getDataAction', '/pbxcore/api/cdr/get_data', 'get', '/', true], [GetController::class, 'recordsAction', '/pbxcore/api/cdr/records', 'get', '/', true], [PostController::class,'callAction', '/pbxcore/api/fax/upload/{actionName}', 'post','/', true], diff --git a/Lib/RestAPI/Controllers/GetController.php b/Lib/RestAPI/Controllers/GetController.php index 3d7f2b0..b15e423 100644 --- a/Lib/RestAPI/Controllers/GetController.php +++ b/Lib/RestAPI/Controllers/GetController.php @@ -10,6 +10,8 @@ use MikoPBX\Core\System\BeanstalkClient; use MikoPBX\Core\Workers\WorkerCdr; use MikoPBX\PBXCoreREST\Controllers\BaseController; +use Modules\ModuleCleanRecords\Models\CdrRecordsData; +use Modules\ModuleNotifier\Lib\Providers\CdrDbProvider; class GetController extends BaseController { @@ -60,6 +62,58 @@ public function getDataAction(): void $this->response->sendRaw(); } + /** + * Получаем список файлов записей по идентификаторам. + * curl 'http://127.0.0.1/pbxcore/api/cdr/records-path?id[]=mikopbx-1751624009.210&id[]=mikopbx-1751622380.183&id[]=mikopbx-1751377388.208' + * @return void + */ + public function getRecordsPathByIdAction(): void + { + $id = $this->request->get('id'); + if(is_string($id)){ + $id = [$id]; + } + $result = array_fill_keys($id, []); + $filter = [ + 'columns' => 'linkedid,recordingfile,start,answer,src_num,dst_num', + 'linkedid IN ({linkedid:array}) AND recordingfile <> ""', + 'bind' => [ + 'linkedid' => $id + ], + 'miko_result_in_file' => true, + ]; + + $client = new BeanstalkClient(WorkerCdr::SELECT_CDR_TUBE); + $message = $client->request(json_encode($filter), 2); + if ($message === false) { + $this->response->setContent(''); + } else { + $filename = json_decode($message, true); + $arr_data = []; + if (is_string($filename) && file_exists($filename)) { + $arr_data = json_decode(file_get_contents($filename), true); + @unlink($filename); + } + foreach ($arr_data as $cdrData){ + if(!file_exists($cdrData['recordingfile'])){ + continue; + } + // Создаём объект DateTime + $date = \DateTime::createFromFormat('Y-m-d H:i:s.u', $cdrData['start']); + $formatted = $date->format('Y-m-d_H-i-s'); + $result[$cdrData['linkedid']][] = [ + 'file' => $cdrData['recordingfile'], + 'start' => $formatted, + 'src' => $cdrData['src_num'], + 'dst' => $cdrData['dst_num'] + ]; + } + + } + print_r(json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); + $this->response->sendRaw(); + } + /** * Скачивание записи разговора. * /pbxcore/api/cdr/records MIKO AJAM From 6bef3e1e644731b1de44953498fcadd0896073b2 Mon Sep 17 00:00:00 2001 From: boffart <5922739+boffart@users.noreply.github.com> Date: Thu, 17 Jul 2025 15:45:11 +0300 Subject: [PATCH 14/20] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83?= =?UTF-8?q?=D0=B5=D0=BC=D1=8B=D0=B5=20use?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/RestAPI/Controllers/GetController.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/RestAPI/Controllers/GetController.php b/Lib/RestAPI/Controllers/GetController.php index b15e423..e85daef 100644 --- a/Lib/RestAPI/Controllers/GetController.php +++ b/Lib/RestAPI/Controllers/GetController.php @@ -10,8 +10,6 @@ use MikoPBX\Core\System\BeanstalkClient; use MikoPBX\Core\Workers\WorkerCdr; use MikoPBX\PBXCoreREST\Controllers\BaseController; -use Modules\ModuleCleanRecords\Models\CdrRecordsData; -use Modules\ModuleNotifier\Lib\Providers\CdrDbProvider; class GetController extends BaseController { From 5350658492e3c22920ecf955a836223b989f0c85 Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 29 Sep 2025 09:00:02 +0300 Subject: [PATCH 15/20] Added translation using Weblate (Hebrew) --- Messages/he.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 Messages/he.php diff --git a/Messages/he.php b/Messages/he.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/Messages/he.php @@ -0,0 +1 @@ + Date: Tue, 30 Sep 2025 04:50:32 +0300 Subject: [PATCH 16/20] Added translation using Weblate (Persian) --- Messages/fa.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 Messages/fa.php diff --git a/Messages/fa.php b/Messages/fa.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/Messages/fa.php @@ -0,0 +1 @@ + Date: Fri, 19 Dec 2025 10:05:18 +0300 Subject: [PATCH 17/20] =?UTF-8?q?#963=20=D0=9F=D0=BE=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=84=D0=B8=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/PT1CCoreConf.php | 16 +++++++++++++++- module.json | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Lib/PT1CCoreConf.php b/Lib/PT1CCoreConf.php index 4e2e964..6597abd 100644 --- a/Lib/PT1CCoreConf.php +++ b/Lib/PT1CCoreConf.php @@ -206,7 +206,7 @@ public function getPBXCoreRESTAdditionalRoutes(): array * * @return string */ - public function generateFail2BanJails():string + public function generateFail2BanFilters():string { return "[INCLUDES]\n" . "before = common.conf\n" . @@ -217,6 +217,20 @@ public function generateFail2BanJails():string "ignoreregex =\n"; } + /** + * Generates additional fail2ban jail conf rules + * Detects auth failures for: + * - REST API login attempts + * - Media file access attempts + * - WebSocket connection attempts + * + * @return string + */ + public function generateFail2BanJails(): string + { + return "#"; + } + /** * Returns array of additional firewall rules for module * diff --git a/module.json b/module.json index c0ba5e0..1760da8 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "moduleUniqueID":"ModulePT1CCore", "support_email": "help@miko.ru", "version": "%ModuleVersion%", - "min_pbx_version": "2023.2.150", + "min_pbx_version": "2025.1.1", "wiki_links": { "ru": {"https://wiki.mikopbx.com/module-p-t1-c-core": "https://wiki.miko.ru/astpanel"}, "en": {"https://wiki.mikopbx.com/module-p-t1-c-core": "https://wiki.miko.ru/astpanel"} From eccc029659feb5f3e7b65687f73d81f76494ec76 Mon Sep 17 00:00:00 2001 From: Alexey Portnov Date: Fri, 13 Mar 2026 03:34:09 +0800 Subject: [PATCH 18/20] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D0=BB=20REST=20API=20CDR:=20=D1=84=D0=B8=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BF=D0=BE=20src?= =?UTF-8?q?/dst,=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82=20=D0=BE=D1=82?= =?UTF-8?q?=D0=B2=D0=B5=D1=82=D0=B0=20xml/json/1c,=20=D0=B1=D0=B5=D0=B7?= =?UTF-8?q?=D0=BE=D0=BF=D0=B0=D1=81=D0=BD=D0=BE=D1=81=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GET /cdr/get_data: добавлены параметры dst[], src[] для фильтрации по номерам - GET /cdr/get_data: параметр format (xml/json/1c) для выбора формата ответа - GET /cdr/records: валидация пути через realpath + whitelist директорий - Контроллер настроек: CSRF-защита, whitelist полей для mass assignment - AGI: параметризованные запросы вместо строковой интерполяции - AGI: PHP cURL API вместо exec("curl ...") - Генерация http_auth: bin2hex + chmod 0600 --- App/Controllers/ModulePT1CCoreController.php | 43 ++++--- App/Views/index.volt | 4 + Lib/PT1CCoreConf.php | 5 +- Lib/RestAPI/Controllers/GetController.php | 126 ++++++++++++++++--- agi-bin/DialPlanAppsMikoPBX.php | 49 ++++++-- 5 files changed, 179 insertions(+), 48 deletions(-) diff --git a/App/Controllers/ModulePT1CCoreController.php b/App/Controllers/ModulePT1CCoreController.php index 6c3ca8e..8b710f5 100644 --- a/App/Controllers/ModulePT1CCoreController.php +++ b/App/Controllers/ModulePT1CCoreController.php @@ -55,11 +55,33 @@ public function indexAction(): void /** * Save settings AJAX action */ + /** + * Whitelist of fields allowed for mass assignment. + */ + private const ALLOWED_FIELDS = [ + 'interception_extension', + 'conference_extension', + 'get_peer_info_extension', + 'get_auth_extension', + 'get_statuses_extension', + 'get_cdr_extension', + 'listen_recordings_extension', + 'get_recordings_extension', + ]; + public function saveAction() :void { if ( ! $this->request->isPost()) { return; } + + // CSRF protection (compatible with Phalcon 4 and 5) + if ($this->di->has('security') && !$this->security->checkToken()) { + $this->flash->error('Invalid CSRF token'); + $this->view->success = false; + return; + } + $data = $this->request->getPost(); $record = ModulePT1CCore::findFirst(); @@ -67,24 +89,9 @@ public function saveAction() :void $record = new ModulePT1CCore(); } $this->db->begin(); - foreach ($record as $key => $value) { - switch ($key) { - case 'id': - break; - case 'checkbox_field': - case 'toggle_field': - if (array_key_exists($key, $data)) { - $record->$key = ($data[$key] === 'on') ? '1' : '0'; - } else { - $record->$key = '0'; - } - break; - default: - if (array_key_exists($key, $data)) { - $record->$key = $data[$key]; - } else { - $record->$key = ''; - } + foreach (self::ALLOWED_FIELDS as $key) { + if (array_key_exists($key, $data)) { + $record->$key = $data[$key]; } } diff --git a/App/Views/index.volt b/App/Views/index.volt index 3881180..117b731 100644 --- a/App/Views/index.volt +++ b/App/Views/index.volt @@ -1,6 +1,10 @@
{{ t._("module_pt1c_coreDisconnected") }}
{{ form.render('id') }} + {% if security is defined %} + {{ security.getToken() }} + {{ security.getTokenKey() }} + {% endif %}

{{ t._('module_pt1c_core_LinksRussian') }}