| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,92 @@ |
| 1 |
+<?php |
|
| 2 |
+/** |
|
| 3 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 4 |
+ * |
|
| 5 |
+ * @author Double Bastion LLC |
|
| 6 |
+ * |
|
| 7 |
+ * @license GNU AGPL version 3 or any later version |
|
| 8 |
+ * |
|
| 9 |
+ * This program is free software; you can redistribute it and/or |
|
| 10 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 11 |
+ * License as published by the Free Software Foundation; either |
|
| 12 |
+ * version 3 of the License, or any later version. |
|
| 13 |
+ * |
|
| 14 |
+ * This program is distributed in the hope that it will be useful, |
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 18 |
+ * |
|
| 19 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 20 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 |
+ * |
|
| 22 |
+ */ |
|
| 23 |
+ |
|
| 24 |
+declare(strict_types=1); |
|
| 25 |
+ |
|
| 26 |
+namespace OCA\SIPTripPhone\Controller; |
|
| 27 |
+ |
|
| 28 |
+use OCP\IRequest; |
|
| 29 |
+use OCP\AppFramework\Controller; |
|
| 30 |
+use OCA\SIPTripPhone\Service\SphoneService; |
|
| 31 |
+use OCP\IUserSession; |
|
| 32 |
+use OC\URLGenerator; |
|
| 33 |
+ |
|
| 34 |
+ |
|
| 35 |
+class SphoneController extends Controller {
|
|
| 36 |
+ |
|
| 37 |
+ private $service; |
|
| 38 |
+ private $userId; |
|
| 39 |
+ private $userSession; |
|
| 40 |
+ private $urlGenerator; |
|
| 41 |
+ |
|
| 42 |
+ public function __construct($appName, IRequest $request, SphoneService $service, $userId, IUserSession $userSession, URLGenerator $urlGenerator) {
|
|
| 43 |
+ parent::__construct($appName, $request); |
|
| 44 |
+ $this->service = $service; |
|
| 45 |
+ $this->userId = $userId; |
|
| 46 |
+ $this->userSession = $userSession; |
|
| 47 |
+ $this->urlGenerator = $urlGenerator; |
|
| 48 |
+ } |
|
| 49 |
+ |
|
| 50 |
+ /** |
|
| 51 |
+ * @NoAdminRequired |
|
| 52 |
+ */ |
|
| 53 |
+ public function getappdirectory() {
|
|
| 54 |
+ $apprelpath = $this->urlGenerator->linkTo('sip_trip_phone', 'COPYING.txt');
|
|
| 55 |
+ $apprelpatharr = explode("/", $apprelpath);
|
|
| 56 |
+ $stpappdir = $apprelpatharr[1]; |
|
| 57 |
+ return $stpappdir; |
|
| 58 |
+ } |
|
| 59 |
+ |
|
| 60 |
+ /** |
|
| 61 |
+ * @NoAdminRequired |
|
| 62 |
+ */ |
|
| 63 |
+ public function getsettings() {
|
|
| 64 |
+ |
|
| 65 |
+ return $this->service->getsettings($this->userSession->getUser()->getUID()); |
|
| 66 |
+ } |
|
| 67 |
+ |
|
| 68 |
+ /** |
|
| 69 |
+ * @NoAdminRequired |
|
| 70 |
+ */ |
|
| 71 |
+ public function getsippass() {
|
|
| 72 |
+ |
|
| 73 |
+ return $this->service->getsippass($this->userSession->getUser()->getUID()); |
|
| 74 |
+ } |
|
| 75 |
+ |
|
| 76 |
+ /** |
|
| 77 |
+ * @NoAdminRequired |
|
| 78 |
+ */ |
|
| 79 |
+ public function updatesettings(string $pdisplayname, string $sipusername, string $sipuserpassword, string $stphwssurl, string $siprealm, string $stunserver, int $tracesipmsg, string $voicenumbers, string $defaultvoicenumber) {
|
|
| 80 |
+ |
|
| 81 |
+ return $this->service->updatesettings($this->userSession->getUser()->getUID(), $pdisplayname, $sipusername, $sipuserpassword, $stphwssurl, $siprealm, $stunserver, $tracesipmsg, $voicenumbers, $defaultvoicenumber); |
|
| 82 |
+ |
|
| 83 |
+ } |
|
| 84 |
+ |
|
| 85 |
+ /** |
|
| 86 |
+ * @NoAdminRequired |
|
| 87 |
+ */ |
|
| 88 |
+ public function getcontactsnmbrs() {
|
|
| 89 |
+ |
|
| 90 |
+ return $this->service->getcontactsnmbrs($this->userSession->getUser()->getUID()); |
|
| 91 |
+ } |
|
| 92 |
+} |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,89 +0,0 @@ |
| 1 |
-<?php |
|
| 2 |
-/** |
|
| 3 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 4 |
- * |
|
| 5 |
- * @author Double Bastion LLC |
|
| 6 |
- * |
|
| 7 |
- * @license GNU AGPL version 3 or any later version |
|
| 8 |
- * |
|
| 9 |
- * This program is free software; you can redistribute it and/or |
|
| 10 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 11 |
- * License as published by the Free Software Foundation; either |
|
| 12 |
- * version 3 of the License, or any later version. |
|
| 13 |
- * |
|
| 14 |
- * This program is distributed in the hope that it will be useful, |
|
| 15 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 18 |
- * |
|
| 19 |
- * You should have received a copy of the GNU Affero General Public |
|
| 20 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 |
- * |
|
| 22 |
- */ |
|
| 23 |
- |
|
| 24 |
-declare(strict_types=1); |
|
| 25 |
- |
|
| 26 |
-namespace OCA\SIPTripPhone\Controller; |
|
| 27 |
- |
|
| 28 |
-use OCP\IRequest; |
|
| 29 |
-use OCP\AppFramework\Controller; |
|
| 30 |
-use OCA\SIPTripPhone\Service\SphoneService; |
|
| 31 |
-use OC\URLGenerator; |
|
| 32 |
- |
|
| 33 |
- |
|
| 34 |
-class SphoneController extends Controller {
|
|
| 35 |
- |
|
| 36 |
- private $service; |
|
| 37 |
- private $userId; |
|
| 38 |
- private $urlGenerator; |
|
| 39 |
- |
|
| 40 |
- public function __construct($appName, IRequest $request, SphoneService $service, $userId, URLGenerator $urlGenerator) {
|
|
| 41 |
- parent::__construct($appName, $request); |
|
| 42 |
- $this->service = $service; |
|
| 43 |
- $this->userId = $userId; |
|
| 44 |
- $this->urlGenerator = $urlGenerator; |
|
| 45 |
- } |
|
| 46 |
- |
|
| 47 |
- /** |
|
| 48 |
- * @NoAdminRequired |
|
| 49 |
- */ |
|
| 50 |
- public function getappdirectory($userId) {
|
|
| 51 |
- $apprelpath = $this->urlGenerator->linkTo('sip_trip_phone', 'COPYING.txt');
|
|
| 52 |
- $apprelpatharr = explode("/", $apprelpath);
|
|
| 53 |
- $stpappdir = $apprelpatharr[1]; |
|
| 54 |
- return $stpappdir; |
|
| 55 |
- } |
|
| 56 |
- |
|
| 57 |
- /** |
|
| 58 |
- * @NoAdminRequired |
|
| 59 |
- */ |
|
| 60 |
- public function getsettings($userId) {
|
|
| 61 |
- |
|
| 62 |
- return $this->service->getsettings($this->userId); |
|
| 63 |
- } |
|
| 64 |
- |
|
| 65 |
- /** |
|
| 66 |
- * @NoAdminRequired |
|
| 67 |
- */ |
|
| 68 |
- public function getsippass($userId) {
|
|
| 69 |
- |
|
| 70 |
- return $this->service->getsippass($this->userId); |
|
| 71 |
- } |
|
| 72 |
- |
|
| 73 |
- /** |
|
| 74 |
- * @NoAdminRequired |
|
| 75 |
- */ |
|
| 76 |
- public function updatesettings(string $userId, string $pdisplayname, string $sipusername, string $sipuserpassword, string $stphwssurl, string $siprealm, string $stunserver, int $tracesipmsg, string $voicenumbers, string $defaultvoicenumber) {
|
|
| 77 |
- |
|
| 78 |
- return $this->service->updatesettings($this->userId, $pdisplayname, $sipusername, $sipuserpassword, $stphwssurl, $siprealm, $stunserver, $tracesipmsg, $voicenumbers, $defaultvoicenumber); |
|
| 79 |
- |
|
| 80 |
- } |
|
| 81 |
- |
|
| 82 |
- /** |
|
| 83 |
- * @NoAdminRequired |
|
| 84 |
- */ |
|
| 85 |
- public function getcontactsnmbrs($userId) {
|
|
| 86 |
- |
|
| 87 |
- return $this->service->getcontactsnmbrs($this->userId); |
|
| 88 |
- } |
|
| 89 |
-} |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,89 @@ |
| 1 |
+<?php |
|
| 2 |
+/** |
|
| 3 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 4 |
+ * |
|
| 5 |
+ * @author Double Bastion LLC |
|
| 6 |
+ * |
|
| 7 |
+ * @license GNU AGPL version 3 or any later version |
|
| 8 |
+ * |
|
| 9 |
+ * This program is free software; you can redistribute it and/or |
|
| 10 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 11 |
+ * License as published by the Free Software Foundation; either |
|
| 12 |
+ * version 3 of the License, or any later version. |
|
| 13 |
+ * |
|
| 14 |
+ * This program is distributed in the hope that it will be useful, |
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 18 |
+ * |
|
| 19 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 20 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 |
+ * |
|
| 22 |
+ */ |
|
| 23 |
+ |
|
| 24 |
+declare(strict_types=1); |
|
| 25 |
+ |
|
| 26 |
+namespace OCA\SIPTripPhone\Controller; |
|
| 27 |
+ |
|
| 28 |
+use OCP\IRequest; |
|
| 29 |
+use OCP\AppFramework\Controller; |
|
| 30 |
+use OCA\SIPTripPhone\Service\SphoneService; |
|
| 31 |
+use OC\URLGenerator; |
|
| 32 |
+ |
|
| 33 |
+ |
|
| 34 |
+class SphoneController extends Controller {
|
|
| 35 |
+ |
|
| 36 |
+ private $service; |
|
| 37 |
+ private $userId; |
|
| 38 |
+ private $urlGenerator; |
|
| 39 |
+ |
|
| 40 |
+ public function __construct($appName, IRequest $request, SphoneService $service, $userId, URLGenerator $urlGenerator) {
|
|
| 41 |
+ parent::__construct($appName, $request); |
|
| 42 |
+ $this->service = $service; |
|
| 43 |
+ $this->userId = $userId; |
|
| 44 |
+ $this->urlGenerator = $urlGenerator; |
|
| 45 |
+ } |
|
| 46 |
+ |
|
| 47 |
+ /** |
|
| 48 |
+ * @NoAdminRequired |
|
| 49 |
+ */ |
|
| 50 |
+ public function getappdirectory($userId) {
|
|
| 51 |
+ $apprelpath = $this->urlGenerator->linkTo('sip_trip_phone', 'COPYING.txt');
|
|
| 52 |
+ $apprelpatharr = explode("/", $apprelpath);
|
|
| 53 |
+ $stpappdir = $apprelpatharr[1]; |
|
| 54 |
+ return $stpappdir; |
|
| 55 |
+ } |
|
| 56 |
+ |
|
| 57 |
+ /** |
|
| 58 |
+ * @NoAdminRequired |
|
| 59 |
+ */ |
|
| 60 |
+ public function getsettings($userId) {
|
|
| 61 |
+ |
|
| 62 |
+ return $this->service->getsettings($this->userId); |
|
| 63 |
+ } |
|
| 64 |
+ |
|
| 65 |
+ /** |
|
| 66 |
+ * @NoAdminRequired |
|
| 67 |
+ */ |
|
| 68 |
+ public function getsippass($userId) {
|
|
| 69 |
+ |
|
| 70 |
+ return $this->service->getsippass($this->userId); |
|
| 71 |
+ } |
|
| 72 |
+ |
|
| 73 |
+ /** |
|
| 74 |
+ * @NoAdminRequired |
|
| 75 |
+ */ |
|
| 76 |
+ public function updatesettings(string $userId, string $pdisplayname, string $sipusername, string $sipuserpassword, string $stphwssurl, string $siprealm, string $stunserver, int $tracesipmsg, string $voicenumbers, string $defaultvoicenumber) {
|
|
| 77 |
+ |
|
| 78 |
+ return $this->service->updatesettings($this->userId, $pdisplayname, $sipusername, $sipuserpassword, $stphwssurl, $siprealm, $stunserver, $tracesipmsg, $voicenumbers, $defaultvoicenumber); |
|
| 79 |
+ |
|
| 80 |
+ } |
|
| 81 |
+ |
|
| 82 |
+ /** |
|
| 83 |
+ * @NoAdminRequired |
|
| 84 |
+ */ |
|
| 85 |
+ public function getcontactsnmbrs($userId) {
|
|
| 86 |
+ |
|
| 87 |
+ return $this->service->getcontactsnmbrs($this->userId); |
|
| 88 |
+ } |
|
| 89 |
+} |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,70 +0,0 @@ |
| 1 |
-<?php |
|
| 2 |
-/** |
|
| 3 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 4 |
- * |
|
| 5 |
- * @author Double Bastion LLC |
|
| 6 |
- * |
|
| 7 |
- * @license GNU AGPL version 3 or any later version |
|
| 8 |
- * |
|
| 9 |
- * This program is free software; you can redistribute it and/or |
|
| 10 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 11 |
- * License as published by the Free Software Foundation; either |
|
| 12 |
- * version 3 of the License, or any later version. |
|
| 13 |
- * |
|
| 14 |
- * This program is distributed in the hope that it will be useful, |
|
| 15 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 18 |
- * |
|
| 19 |
- * You should have received a copy of the GNU Affero General Public |
|
| 20 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 |
- * |
|
| 22 |
- */ |
|
| 23 |
- |
|
| 24 |
-declare(strict_types=1); |
|
| 25 |
- |
|
| 26 |
-namespace OCA\SIPTripPhone\Controller; |
|
| 27 |
- |
|
| 28 |
-use OCP\IRequest; |
|
| 29 |
-use OCP\AppFramework\Controller; |
|
| 30 |
-use OCA\SIPTripPhone\Service\SphoneService; |
|
| 31 |
- |
|
| 32 |
- |
|
| 33 |
-class SphoneController extends Controller {
|
|
| 34 |
- |
|
| 35 |
- private $service; |
|
| 36 |
- private $userId; |
|
| 37 |
- |
|
| 38 |
- public function __construct($appName, IRequest $request, SphoneService $service, $userId) {
|
|
| 39 |
- parent::__construct($appName, $request); |
|
| 40 |
- $this->service = $service; |
|
| 41 |
- $this->userId = $userId; |
|
| 42 |
- } |
|
| 43 |
- |
|
| 44 |
- |
|
| 45 |
- /** |
|
| 46 |
- * @NoAdminRequired |
|
| 47 |
- */ |
|
| 48 |
- public function getsettings($userId) {
|
|
| 49 |
- |
|
| 50 |
- return $this->service->getsettings($this->userId); |
|
| 51 |
- } |
|
| 52 |
- |
|
| 53 |
- /** |
|
| 54 |
- * @NoAdminRequired |
|
| 55 |
- */ |
|
| 56 |
- public function getsippass($userId) {
|
|
| 57 |
- |
|
| 58 |
- return $this->service->getsippass($this->userId); |
|
| 59 |
- } |
|
| 60 |
- |
|
| 61 |
- /** |
|
| 62 |
- * @NoAdminRequired |
|
| 63 |
- */ |
|
| 64 |
- public function updatesettings(string $userId, string $pdisplayname, string $sipusername, string $sipuserpassword, string $stphwssurl, string $siprealm, string $stunserver, int $tracesipmsg, string $voicenumbers, string $defaultvoicenumber) {
|
|
| 65 |
- |
|
| 66 |
- return $this->service->updatesettings($this->userId, $pdisplayname, $sipusername, $sipuserpassword, $stphwssurl, $siprealm, $stunserver, $tracesipmsg, $voicenumbers, $defaultvoicenumber); |
|
| 67 |
- |
|
| 68 |
- } |
|
| 69 |
- |
|
| 70 |
-} |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,70 @@ |
| 1 |
+<?php |
|
| 2 |
+/** |
|
| 3 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 4 |
+ * |
|
| 5 |
+ * @author Double Bastion LLC |
|
| 6 |
+ * |
|
| 7 |
+ * @license GNU AGPL version 3 or any later version |
|
| 8 |
+ * |
|
| 9 |
+ * This program is free software; you can redistribute it and/or |
|
| 10 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 11 |
+ * License as published by the Free Software Foundation; either |
|
| 12 |
+ * version 3 of the License, or any later version. |
|
| 13 |
+ * |
|
| 14 |
+ * This program is distributed in the hope that it will be useful, |
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 18 |
+ * |
|
| 19 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 20 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 |
+ * |
|
| 22 |
+ */ |
|
| 23 |
+ |
|
| 24 |
+declare(strict_types=1); |
|
| 25 |
+ |
|
| 26 |
+namespace OCA\SIPTripPhone\Controller; |
|
| 27 |
+ |
|
| 28 |
+use OCP\IRequest; |
|
| 29 |
+use OCP\AppFramework\Controller; |
|
| 30 |
+use OCA\SIPTripPhone\Service\SphoneService; |
|
| 31 |
+ |
|
| 32 |
+ |
|
| 33 |
+class SphoneController extends Controller {
|
|
| 34 |
+ |
|
| 35 |
+ private $service; |
|
| 36 |
+ private $userId; |
|
| 37 |
+ |
|
| 38 |
+ public function __construct($appName, IRequest $request, SphoneService $service, $userId) {
|
|
| 39 |
+ parent::__construct($appName, $request); |
|
| 40 |
+ $this->service = $service; |
|
| 41 |
+ $this->userId = $userId; |
|
| 42 |
+ } |
|
| 43 |
+ |
|
| 44 |
+ |
|
| 45 |
+ /** |
|
| 46 |
+ * @NoAdminRequired |
|
| 47 |
+ */ |
|
| 48 |
+ public function getsettings($userId) {
|
|
| 49 |
+ |
|
| 50 |
+ return $this->service->getsettings($this->userId); |
|
| 51 |
+ } |
|
| 52 |
+ |
|
| 53 |
+ /** |
|
| 54 |
+ * @NoAdminRequired |
|
| 55 |
+ */ |
|
| 56 |
+ public function getsippass($userId) {
|
|
| 57 |
+ |
|
| 58 |
+ return $this->service->getsippass($this->userId); |
|
| 59 |
+ } |
|
| 60 |
+ |
|
| 61 |
+ /** |
|
| 62 |
+ * @NoAdminRequired |
|
| 63 |
+ */ |
|
| 64 |
+ public function updatesettings(string $userId, string $pdisplayname, string $sipusername, string $sipuserpassword, string $stphwssurl, string $siprealm, string $stunserver, int $tracesipmsg, string $voicenumbers, string $defaultvoicenumber) {
|
|
| 65 |
+ |
|
| 66 |
+ return $this->service->updatesettings($this->userId, $pdisplayname, $sipusername, $sipuserpassword, $stphwssurl, $siprealm, $stunserver, $tracesipmsg, $voicenumbers, $defaultvoicenumber); |
|
| 67 |
+ |
|
| 68 |
+ } |
|
| 69 |
+ |
|
| 70 |
+} |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,70 +0,0 @@ |
| 1 |
-<?php |
|
| 2 |
-/** |
|
| 3 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 4 |
- * |
|
| 5 |
- * @author Double Bastion LLC |
|
| 6 |
- * |
|
| 7 |
- * @license GNU AGPL version 3 or any later version |
|
| 8 |
- * |
|
| 9 |
- * This program is free software; you can redistribute it and/or |
|
| 10 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 11 |
- * License as published by the Free Software Foundation; either |
|
| 12 |
- * version 3 of the License, or any later version. |
|
| 13 |
- * |
|
| 14 |
- * This program is distributed in the hope that it will be useful, |
|
| 15 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 18 |
- * |
|
| 19 |
- * You should have received a copy of the GNU Affero General Public |
|
| 20 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 |
- * |
|
| 22 |
- */ |
|
| 23 |
- |
|
| 24 |
-declare(strict_types=1); |
|
| 25 |
- |
|
| 26 |
-namespace OCA\SIPTripPhone\Controller; |
|
| 27 |
- |
|
| 28 |
-use OCP\IRequest; |
|
| 29 |
-use OCP\AppFramework\Controller; |
|
| 30 |
-use OCA\SIPTripPhone\Service\SphoneService; |
|
| 31 |
- |
|
| 32 |
- |
|
| 33 |
-class SphoneController extends Controller {
|
|
| 34 |
- |
|
| 35 |
- private $service; |
|
| 36 |
- private $userId; |
|
| 37 |
- |
|
| 38 |
- public function __construct($appName, IRequest $request, SphoneService $service, $userId) {
|
|
| 39 |
- parent::__construct($appName, $request); |
|
| 40 |
- $this->service = $service; |
|
| 41 |
- $this->userId = $userId; |
|
| 42 |
- } |
|
| 43 |
- |
|
| 44 |
- |
|
| 45 |
- /** |
|
| 46 |
- * @NoAdminRequired |
|
| 47 |
- */ |
|
| 48 |
- public function getsettings($userId) {
|
|
| 49 |
- |
|
| 50 |
- return $this->service->getsettings($this->userId); |
|
| 51 |
- } |
|
| 52 |
- |
|
| 53 |
- /** |
|
| 54 |
- * @NoAdminRequired |
|
| 55 |
- */ |
|
| 56 |
- public function getsippass($userId) {
|
|
| 57 |
- |
|
| 58 |
- return $this->service->getsippass($this->userId); |
|
| 59 |
- } |
|
| 60 |
- |
|
| 61 |
- /** |
|
| 62 |
- * @NoAdminRequired |
|
| 63 |
- */ |
|
| 64 |
- public function updatesettings(string $userId, string $pdisplayname, string $sipusername, string $sipuserpassword, string $stphwssurl, string $siprealm, string $stunserver) {
|
|
| 65 |
- |
|
| 66 |
- return $this->service->updatesettings($this->userId, $pdisplayname, $sipusername, $sipuserpassword, $stphwssurl, $siprealm, $stunserver); |
|
| 67 |
- |
|
| 68 |
- } |
|
| 69 |
- |
|
| 70 |
-} |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,70 @@ |
| 1 |
+<?php |
|
| 2 |
+/** |
|
| 3 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 4 |
+ * |
|
| 5 |
+ * @author Double Bastion LLC |
|
| 6 |
+ * |
|
| 7 |
+ * @license GNU AGPL version 3 or any later version |
|
| 8 |
+ * |
|
| 9 |
+ * This program is free software; you can redistribute it and/or |
|
| 10 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 11 |
+ * License as published by the Free Software Foundation; either |
|
| 12 |
+ * version 3 of the License, or any later version. |
|
| 13 |
+ * |
|
| 14 |
+ * This program is distributed in the hope that it will be useful, |
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 18 |
+ * |
|
| 19 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 20 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 |
+ * |
|
| 22 |
+ */ |
|
| 23 |
+ |
|
| 24 |
+declare(strict_types=1); |
|
| 25 |
+ |
|
| 26 |
+namespace OCA\SIPTripPhone\Controller; |
|
| 27 |
+ |
|
| 28 |
+use OCP\IRequest; |
|
| 29 |
+use OCP\AppFramework\Controller; |
|
| 30 |
+use OCA\SIPTripPhone\Service\SphoneService; |
|
| 31 |
+ |
|
| 32 |
+ |
|
| 33 |
+class SphoneController extends Controller {
|
|
| 34 |
+ |
|
| 35 |
+ private $service; |
|
| 36 |
+ private $userId; |
|
| 37 |
+ |
|
| 38 |
+ public function __construct($appName, IRequest $request, SphoneService $service, $userId) {
|
|
| 39 |
+ parent::__construct($appName, $request); |
|
| 40 |
+ $this->service = $service; |
|
| 41 |
+ $this->userId = $userId; |
|
| 42 |
+ } |
|
| 43 |
+ |
|
| 44 |
+ |
|
| 45 |
+ /** |
|
| 46 |
+ * @NoAdminRequired |
|
| 47 |
+ */ |
|
| 48 |
+ public function getsettings($userId) {
|
|
| 49 |
+ |
|
| 50 |
+ return $this->service->getsettings($this->userId); |
|
| 51 |
+ } |
|
| 52 |
+ |
|
| 53 |
+ /** |
|
| 54 |
+ * @NoAdminRequired |
|
| 55 |
+ */ |
|
| 56 |
+ public function getsippass($userId) {
|
|
| 57 |
+ |
|
| 58 |
+ return $this->service->getsippass($this->userId); |
|
| 59 |
+ } |
|
| 60 |
+ |
|
| 61 |
+ /** |
|
| 62 |
+ * @NoAdminRequired |
|
| 63 |
+ */ |
|
| 64 |
+ public function updatesettings(string $userId, string $pdisplayname, string $sipusername, string $sipuserpassword, string $stphwssurl, string $siprealm, string $stunserver) {
|
|
| 65 |
+ |
|
| 66 |
+ return $this->service->updatesettings($this->userId, $pdisplayname, $sipusername, $sipuserpassword, $stphwssurl, $siprealm, $stunserver); |
|
| 67 |
+ |
|
| 68 |
+ } |
|
| 69 |
+ |
|
| 70 |
+} |