diff options
author | Joachim Bauch <bauch@struktur.de> | 2017-07-20 14:40:49 +0300 |
---|---|---|
committer | Joachim Bauch <bauch@struktur.de> | 2017-11-02 13:23:09 +0300 |
commit | be33ec8d9c30b1acd0336976fd64cc0dfff96c27 (patch) | |
tree | ce9b5d73e3e3b34a5dcf44c004f4963c37edb6e2 /lib/Settings | |
parent | d7ef5ef868060f497e6e69617f088c69dfbb6cc3 (diff) |
Implement backend APIs to be used by standalone signaling server.
A standalone signaling server can be configured in the admin UI and is
notified through the BackendController on changes that should be sent to
connected clients.
See #339 for a description of the backend API.
Signed-off-by: Joachim Bauch <bauch@struktur.de>
Diffstat (limited to 'lib/Settings')
-rw-r--r-- | lib/Settings/Admin/SignalingServer.php | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/lib/Settings/Admin/SignalingServer.php b/lib/Settings/Admin/SignalingServer.php new file mode 100644 index 000000000..d700d48ac --- /dev/null +++ b/lib/Settings/Admin/SignalingServer.php @@ -0,0 +1,68 @@ +<?php +/** + * @author Joachim Bauch <mail@joachim-bauch.de> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCA\Spreed\Settings\Admin; + + +use OCP\AppFramework\Http\TemplateResponse; +use OCP\IConfig; +use OCP\Settings\ISettings; + +class SignalingServer implements ISettings { + + /** @var IConfig */ + private $config; + + public function __construct(IConfig $config) { + $this->config = $config; + } + + /** + * @return TemplateResponse + */ + public function getForm() { + $parameters = [ + 'signalingServer' => $this->config->getAppValue('spreed', 'signaling_server'), + 'signalingSecret' => $this->config->getAppValue('spreed', 'signaling_secret'), + ]; + + return new TemplateResponse('spreed', 'settings/admin/signaling-server', $parameters, ''); + } + + /** + * @return string the section ID, e.g. 'sharing' + */ + public function getSection() { + return 'videocalls'; + } + + /** + * @return int whether the form should be rather on the top or bottom of + * the admin section. The forms are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. + * + * E.g.: 70 + */ + public function getPriority() { + return 75; + } + +} |