1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* MikoPBX - free phone system for small business |
4
|
|
|
* Copyright © 2017-2023 Alexey Portnov and Nikolay Beketov |
5
|
|
|
* |
6
|
|
|
* This program is free software: you can redistribute it and/or modify |
7
|
|
|
* it under the terms of the GNU General Public License as published by |
8
|
|
|
* the Free Software Foundation; either version 3 of the License, or |
9
|
|
|
* (at your option) any later version. |
10
|
|
|
* |
11
|
|
|
* This program is distributed in the hope that it will be useful, |
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14
|
|
|
* GNU General Public License for more details. |
15
|
|
|
* |
16
|
|
|
* You should have received a copy of the GNU General Public License along with this program. |
17
|
|
|
* If not, see <https://www.gnu.org/licenses/>. |
18
|
|
|
*/ |
19
|
|
|
|
20
|
|
|
namespace MikoPBX\AdminCabinet\Controllers; |
21
|
|
|
|
22
|
|
|
use GuzzleHttp\Client as GuzzleHttpClient; |
23
|
|
|
use MikoPBX\AdminCabinet\Forms\LicensingActivateCouponForm; |
24
|
|
|
use MikoPBX\AdminCabinet\Forms\LicensingChangeLicenseKeyForm; |
25
|
|
|
use MikoPBX\AdminCabinet\Forms\LicensingGetKeyForm; |
26
|
|
|
use MikoPBX\Common\Models\PbxSettings; |
27
|
|
|
use MikoPBX\Common\Providers\UrlProvider; |
28
|
|
|
use Phalcon\Http\Response; |
29
|
|
|
|
30
|
|
|
class LicensingController extends BaseController |
31
|
|
|
{ |
32
|
|
|
/** |
33
|
|
|
* Old services still use old controller address |
34
|
|
|
* License key, get new key, activate coupon form |
35
|
|
|
* |
36
|
|
|
*/ |
37
|
|
|
public function modifyAction(): void |
38
|
|
|
{ |
39
|
|
|
// Create a response object |
40
|
|
|
$response = new Response(); |
41
|
|
|
|
42
|
|
|
// Set the redirect URL with a hash fragment |
43
|
|
|
$redirectUrl = 'pbx-extension-modules/index#licensing'; |
44
|
|
|
|
45
|
|
|
// Perform the redirect |
46
|
|
|
$response->redirect($redirectUrl)->send(); |
47
|
|
|
|
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* After some changes on form we will refresh some session cache |
52
|
|
|
*/ |
53
|
|
|
public function saveAction() |
54
|
|
|
{ |
55
|
|
|
$this->session->remove('PBXLicense'); |
56
|
|
|
} |
57
|
|
|
} |