Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/passman.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorbrantje <brantje@gmail.com>2016-12-28 20:54:54 +0300
committerbrantje <brantje@gmail.com>2016-12-28 23:34:59 +0300
commit858195834d6af9d1c4a5717816a5d1a431686fdc (patch)
treeed71ef6f12976d4e9f21faa7254fae26b3775158 /lib
parent3d31b2809385bd77b0e074711f27ddb68a8140b0 (diff)
Add settings page, non functional
Implement disable context menu Implemement disable http warning Implement vault key strength setting Implement share settings Implement version check setting
Diffstat (limited to 'lib')
-rw-r--r--lib/AppInfo/Application.php5
-rw-r--r--lib/Settings/Admin.php70
2 files changed, 74 insertions, 1 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index c2840294..ca9cdc3a 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -36,6 +36,7 @@ use OCA\Passman\Service\FileService;
use OCA\Passman\Service\VaultService;
use OCA\Passman\Utility\Utils;
use OCA\Passman\Service\NotificationService;
+use OCP\IConfig;
use OCP\IDBConnection;
use OCP\AppFramework\App;
@@ -70,7 +71,8 @@ class Application extends App {
$c->query('ShareService'),
$c->query('CredentialService'),
$c->query('NotificationService'),
- $c->query('FileService')
+ $c->query('FileService'),
+ $c->query('IConfig')
);
});
@@ -109,6 +111,7 @@ class Application extends App {
$container->registerAlias('ShareService', ShareService::class);
$container->registerAlias('Utils', Utils::class);
$container->registerAlias('IDBConnection', IDBConnection::class);
+ $container->registerAlias('IConfig', IConfig::class);
}
/**
diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php
new file mode 100644
index 00000000..90f27ab4
--- /dev/null
+++ b/lib/Settings/Admin.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Nextcloud - passman
+ *
+ * @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com)
+ * @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es)
+ * @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\Passman\Settings;
+
+
+use OCP\AppFramework\Http\TemplateResponse;
+use OCP\IConfig;
+use OCP\IL10N;
+use OCP\Settings\ISettings;
+
+class Admin implements ISettings {
+
+ private $config;
+ private $l;
+
+ public function __construct(
+ IConfig $config,
+ IL10N $l) {
+ $this->config = $config;
+ $this->l = $l;
+ }
+
+ /**
+ * @return TemplateResponse
+ */
+ public function getForm() {
+
+ return new TemplateResponse('passman', 'settings-admin');
+ }
+
+ /**
+ * @return string the section ID, e.g. 'sharing'
+ */
+ public function getSection() {
+ return 'additional';
+ }
+
+ /**
+ * @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 0;
+ }
+
+}