diff --git a/appinfo/app.php b/appinfo/app.php
index 6e415c3b..1403c4ae 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -14,6 +14,7 @@ namespace OCA\Passman\AppInfo;
use OCP\Util;
use OCP\BackgroundJob;
+use OCP\App;
use OCA\Passman\Notifier;
use OCA\Passman\Activity;
require_once __DIR__ . '/autoload.php';
@@ -49,3 +50,4 @@ $manager->registerExtension(function() {
* The string has to match the app's folder name
*/
Util::addTranslations('passman');
+\OCP\App::registerAdmin('passman', 'templates/admin.settings');
\ No newline at end of file
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 550fbc66..f700dc9f 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -40,8 +40,9 @@ For an demo of this app visit [https://demo.passman.cc](https://demo.passman.cc)
sqlitemysql
+
- OCA\Passman\Settings\Admin
+ OCA\Passman\Controller\SettingsController
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 8a90558c..5413b79f 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -67,6 +67,11 @@ return [
['name' => 'share#updateSharedCredentialACL', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'PATCH'],
['name' => 'internal#getAppVersion', 'url' => '/api/v2/version', 'verb' => 'GET'],
+ //Settings
+ ['name' => 'settings#getSettings', 'url' => '/api/v2/settings', 'verb' => 'GET'],
+ ['name' => 'settings#saveUserSetting', 'url' => '/api/v2/settings/{key}/{value}', 'verb' => 'POST'],
+ ['name' => 'settings#saveAdminSetting', 'url' => '/api/v2/settings/{key}/{value}/admin1/admin2', 'verb' => 'POST'],
+
//Translations
['name' => 'translation#getLanguageStrings', 'url' => '/api/v2/language', 'verb' => 'GET'],
@@ -76,8 +81,5 @@ return [
['name' => 'internal#read', 'url' => '/api/internal/notifications/read/{credential_id}', 'verb' => 'DELETE'],
['name' => 'internal#getAppVersion', 'url' => '/api/internal/version', 'verb' => 'GET'],
['name' => 'internal#generatePerson', 'url' => '/api/internal/generate_person', 'verb' => 'GET'],
- ['name' => 'internal#save_settings', 'url' => '/api/internal/settings/{key}/{value}', 'verb' => 'POST'],
- ['name' => 'internal#get_settings', 'url' => '/api/internal/settings', 'verb' => 'GET'],
-
]
];
\ No newline at end of file
diff --git a/controller/credentialcontroller.php b/controller/credentialcontroller.php
index 2ab356d3..51645fb7 100644
--- a/controller/credentialcontroller.php
+++ b/controller/credentialcontroller.php
@@ -11,13 +11,11 @@
namespace OCA\Passman\Controller;
-use OCA\Files_External\NotFoundException;
use OCA\Passman\Db\SharingACL;
+use OCA\Passman\Service\SettingsService;
use OCA\Passman\Utility\NotFoundJSONResponse;
-use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
-use OCP\IConfig;
use OCP\IRequest;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\ApiController;
@@ -26,7 +24,7 @@ use OCA\Passman\Activity;
use OCA\Passman\Service\ActivityService;
use OCA\Passman\Service\CredentialRevisionService;
use OCA\Passman\Service\ShareService;
-use OCP\IUser;
+
class CredentialController extends ApiController {
private $userId;
@@ -34,7 +32,7 @@ class CredentialController extends ApiController {
private $activityService;
private $credentialRevisionService;
private $sharingService;
- private $config;
+ private $settings;
public function __construct($AppName,
IRequest $request,
@@ -43,7 +41,7 @@ class CredentialController extends ApiController {
ActivityService $activityService,
CredentialRevisionService $credentialRevisionService,
ShareService $sharingService,
- IConfig $config
+ SettingsService $settings
) {
parent::__construct($AppName, $request);
$this->userId = $userId;
@@ -51,7 +49,7 @@ class CredentialController extends ApiController {
$this->activityService = $activityService;
$this->credentialRevisionService = $credentialRevisionService;
$this->sharingService = $sharingService;
- $this->config = $config;
+ $this->settings = $settings;
}
@@ -151,7 +149,7 @@ class CredentialController extends ApiController {
} else {
return new DataResponse(['msg' => 'Not authorized'], Http::STATUS_UNAUTHORIZED);
}
- if ($this->config->getAppValue('passman', 'user_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'user_sharing_enabled', 1) === '0') {
+ if ($this->settings->isEnabled('user_sharing_enabled')) {
return new DataResponse(['msg' => 'Not authorized'], Http::STATUS_UNAUTHORIZED);
}
}
diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php
new file mode 100644
index 00000000..50a2ac7c
--- /dev/null
+++ b/controller/settingscontroller.php
@@ -0,0 +1,96 @@
+
+ * @copyright Sander Brand 2016
+ */
+
+namespace OCA\Passman\Controller;
+
+use OCP\IL10N;
+use OCP\Settings\ISettings;
+use OCP\AppFramework\Http\TemplateResponse;
+use OCP\AppFramework\Http\JSONResponse;
+use OCP\AppFramework\ApiController;
+use OCP\IRequest;
+use OCA\Passman\Service\SettingsService;
+
+class SettingsController extends ApiController {
+ private $userId;
+ private $settings;
+
+ public function __construct(
+ $AppName,
+ IRequest $request,
+ $userId,
+ SettingsService $settings,
+ IL10N $l) {
+ parent::__construct($AppName, $request);
+ $this->settings = $settings;
+ $this->l = $l;
+ $this->userId = $userId;
+ }
+
+ /**
+ * @return TemplateResponse
+ */
+ public function getForm() {
+ return new TemplateResponse('passman', 'part.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;
+ }
+
+ /**
+ * Get all settings
+ *
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ */
+ public function getSettings() {
+ $settings = $this->settings->getAppSettings();
+ return new JSONResponse($settings);
+ }
+
+ /**
+ * Save a user setting
+ *
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ */
+ public function saveUserSetting($key, $value) {
+ $this->settings->setUserSetting($key, $value);
+ return new JSONResponse('OK');
+ }
+
+
+ /**
+ * Save a app setting
+ *
+ * @NoCSRFRequired
+ */
+ public function saveAdminSetting($key, $value) {
+ $this->settings->setAppSetting($key, $value);
+ return new JSONResponse('OK');
+ }
+
+}
\ No newline at end of file
diff --git a/controller/sharecontroller.php b/controller/sharecontroller.php
index f8c137c2..38121e6b 100644
--- a/controller/sharecontroller.php
+++ b/controller/sharecontroller.php
@@ -16,6 +16,7 @@ use OCA\Passman\Db\Vault;
use OCA\Passman\Service\CredentialService;
use OCA\Passman\Service\FileService;
use OCA\Passman\Service\NotificationService;
+use OCA\Passman\Service\SettingsService;
use OCA\Passman\Service\ShareService;
use OCA\Passman\Utility\NotFoundJSONResponse;
use OCA\Passman\Utility\Utils;
@@ -44,7 +45,7 @@ class ShareController extends ApiController {
private $credentialService;
private $notificationService;
private $fileService;
- private $config;
+ private $settings;
private $limit = 50;
private $offset = 0;
@@ -60,7 +61,7 @@ class ShareController extends ApiController {
CredentialService $credentialService,
NotificationService $notificationService,
FileService $fileService,
- IConfig $config
+ SettingsService $config
) {
parent::__construct($AppName, $request);
@@ -73,14 +74,9 @@ class ShareController extends ApiController {
$this->credentialService = $credentialService;
$this->notificationService = $notificationService;
$this->fileService = $fileService;
- $this->config = $config;
+ $this->settings = $config;
}
- private function isSharingEnabled() {
- if ($this->config->getAppValue('passman', 'link_sharing_enabled', 1) === 0 || $this->config->getAppValue('passman', 'link_sharing_enabled', 1) === '0') {
- return new JSONResponse(array());
- }
- }
/**
* @param $item_id
@@ -91,8 +87,10 @@ class ShareController extends ApiController {
* @NoCSRFRequired
*/
public function createPublicShare($item_id, $item_guid, $permissions, $expire_timestamp, $expire_views) {
- $this->isSharingEnabled();
+ if (!$this->settings->isEnabled('link_sharing_enabled')) {
+ return new JSONResponse(array());
+ }
try {
$credential = $this->credentialService->getCredentialByGUID($item_guid);
@@ -130,7 +128,9 @@ class ShareController extends ApiController {
* @NoCSRFRequired
*/
public function applyIntermediateShare($item_id, $item_guid, $vaults, $permissions) {
- $this->isSharingEnabled();
+ if (!$this->settings->isEnabled('user_sharing_enabled')) {
+ return new JSONResponse(array());
+ }
/**
* Assemble notification
*/
@@ -223,7 +223,9 @@ class ShareController extends ApiController {
* @NoCSRFRequired
*/
public function unshareCredential($item_guid) {
- $this->isSharingEnabled();
+ if (!$this->settings->isEnabled('user_sharing_enabled')) {
+ return new JSONResponse(array());
+ }
$acl_list = $this->shareService->getCredentialAclList($item_guid);
$request_list = $this->shareService->getShareRequestsByGuid($item_guid);
foreach ($acl_list as $ACL) {
@@ -338,6 +340,9 @@ class ShareController extends ApiController {
* @NoCSRFRequired
*/
public function getPendingRequests() {
+ if (!$this->settings->isEnabled('user_sharing_enabled')) {
+ return new JSONResponse(array());
+ }
try {
$requests = $this->shareService->getUserPendingRequests($this->userId->getUID());
$results = array();
@@ -374,7 +379,9 @@ class ShareController extends ApiController {
* @NoCSRFRequired
*/
public function getVaultItems($vault_guid) {
- $this->isSharingEnabled();
+ if (!$this->settings->isEnabled('user_sharing_enabled')) {
+ return new JSONResponse(array());
+ }
try {
return new JSONResponse($this->shareService->getSharedItems($this->userId->getUID(), $vault_guid));
@@ -426,7 +433,9 @@ class ShareController extends ApiController {
* @PublicPage
*/
public function getPublicCredentialData($credential_guid) {
- $this->isSharingEnabled();
+ if (!$this->settings->isEnabled('user_sharing_enabled')) {
+ return new JSONResponse(array());
+ }
//@TODO Check expire date
$acl = $this->shareService->getACL(null, $credential_guid);
diff --git a/js/app/services/settingsservice.js b/js/app/services/settingsservice.js
index 16cf4d29..7db91069 100644
--- a/js/app/services/settingsservice.js
+++ b/js/app/services/settingsservice.js
@@ -38,7 +38,7 @@
defaultVaultPass: null
};
- $http.get(OC.generateUrl('apps/passman/api/internal/settings')).then(function (response) {
+ $http.get(OC.generateUrl('apps/passman/api/v2/settings')).then(function (response) {
if (response.data) {
settings = angular.merge(settings, response.data);
$rootScope.$broadcast('settings_loaded');
diff --git a/js/settings-admin.js b/js/settings-admin.js
index 4adb8bb1..960753b2 100644
--- a/js/settings-admin.js
+++ b/js/settings-admin.js
@@ -60,7 +60,7 @@ $(document).ready(function () {
setAdminKey: function (key, value) {
var request = $.ajax({
- url: this._baseUrl + '/' + key + '/' + value,
+ url: this._baseUrl + '/' + key + '/' + value +'/admin1/admin2',
method: 'POST'
});
request.done(function () {
@@ -84,7 +84,7 @@ $(document).ready(function () {
};
- var settings = new Settings(OC.generateUrl('apps/passman/api/internal/settings'));
+ var settings = new Settings(OC.generateUrl('apps/passman/api/v2/settings'));
settings.load();
// ADMIN SETTINGS
@@ -121,4 +121,8 @@ $(document).ready(function () {
settings.setAdminKey('vault_key_strength', $(this).val());
});
+ if($('form[name="passman_settings"]').length === 2){
+ $('form[name="passman_settings"]')[1].remove();
+ }
+
});
diff --git a/l10n/de.js b/l10n/de.js
index 7cb1f13b..266bc11b 100644
--- a/l10n/de.js
+++ b/l10n/de.js
@@ -10,7 +10,6 @@ OC.L10N.register(
"Please fill in a label!" : "Bitte Beschriftung hinzufügen!",
"Please fill in a value!" : "Bitte einen Wert hinzufügen!",
"Error loading file" : "Fehler beim Laden der Datei",
- "An error happend during decryption" : "Ein Fehler ist beim Entschlüsseln aufgetreten",
"Credential created!" : "Anmeldeinformation erstellt!",
"Credential deleted" : "Anmeldeinformation gelöscht",
"Credential updated" : "Anmeldeinformation aktualisiert",
@@ -44,6 +43,10 @@ OC.L10N.register(
"Credential unshared" : "Anmeldeinformation wird nicht mehr geteilt",
"Credential shared" : "Anmeldeinformation wird geteilt",
"Saved!" : "Gespeichert!",
+ "Poor" : "Mangelhaft",
+ "Weak" : "Schwach",
+ "Good" : "Gut",
+ "Strong" : "Stark",
"Toggle visibility" : "Sichtbarkeit umschalten",
"Copy to clipboard" : "In die Zwischenablage kopieren",
"Copied to clipboard!" : "In die Zwischenablage kopiert!",
@@ -224,6 +227,7 @@ OC.L10N.register(
"Click here to request it" : "Hier klicken um es anzufordern",
"Loading..." : "Lade...",
"Awwhh.... credential not found. Maybe it expired" : "Oh... Zugangsdaten nicht gefunden. Vielleicht sind sie abgelaufen",
+ "Error while saving field" : "Fehler beim Speichern des Feldes",
"A Passman item has been created, modified or deleted" : "Ein Passman-Element wurde erstellt, modifiziert oder gelöscht",
"A Passman item has expired" : "Ein Passman-Element ist abgelaufen",
"A Passman item has been shared" : "Ein Passman-Element wurde geteilt",
@@ -252,6 +256,15 @@ OC.L10N.register(
"%s shared \"%s\" with you. Click here to accept" : "%s teilt \"%s\" mit dir. Um dies zu akzeptieren, klicke hier",
"%s has declined your share request for \"%s\"." : "%s hat das Teilen von \"%s\" mit dir abgelehnt.",
"%s has accepted your share request for \"%s\"." : "%s hat das Teilen von \"%s\" mit dir akzeptiert.",
+ "Unable to get version info" : "Versionsinfo konnte nicht ermittelt werden",
+ "Passman Settings" : "Passman-Einstellungen",
+ "Github version:" : "Github-Version:",
+ "A newer version of passman is available" : "Es ist eine neuere Version von Passman verfügbar",
+ "Allow users on this server to share passwords with a link" : "Erlaube Benutzern dieses Servers das Teilen von Passwörtern via Link",
+ "Allow users on this server to share passwords with other users" : "Erlaube Benutzern dieses Servers das Teilen von Passwörtern mit anderen Benutzern",
+ "Check for new versions" : "Nach neuerer Version suchen",
+ "Enable HTTPS check" : "HTTPS-Prüfung aktivieren",
+ "Disable context menu" : "Kontextmenü deaktivieren",
"Connection to server lost" : "Verbindung zum Server verloren",
"Problem loading page, reloading in 5 seconds" : "Problem beim Laden der Seite, Seite wird in 5 Sekunden nochmals geladen",
"Saving..." : "Speichere…",
diff --git a/l10n/de.json b/l10n/de.json
index a7be49b9..9d6eeecb 100644
--- a/l10n/de.json
+++ b/l10n/de.json
@@ -8,7 +8,6 @@
"Please fill in a label!" : "Bitte Beschriftung hinzufügen!",
"Please fill in a value!" : "Bitte einen Wert hinzufügen!",
"Error loading file" : "Fehler beim Laden der Datei",
- "An error happend during decryption" : "Ein Fehler ist beim Entschlüsseln aufgetreten",
"Credential created!" : "Anmeldeinformation erstellt!",
"Credential deleted" : "Anmeldeinformation gelöscht",
"Credential updated" : "Anmeldeinformation aktualisiert",
@@ -42,6 +41,10 @@
"Credential unshared" : "Anmeldeinformation wird nicht mehr geteilt",
"Credential shared" : "Anmeldeinformation wird geteilt",
"Saved!" : "Gespeichert!",
+ "Poor" : "Mangelhaft",
+ "Weak" : "Schwach",
+ "Good" : "Gut",
+ "Strong" : "Stark",
"Toggle visibility" : "Sichtbarkeit umschalten",
"Copy to clipboard" : "In die Zwischenablage kopieren",
"Copied to clipboard!" : "In die Zwischenablage kopiert!",
@@ -222,6 +225,7 @@
"Click here to request it" : "Hier klicken um es anzufordern",
"Loading..." : "Lade...",
"Awwhh.... credential not found. Maybe it expired" : "Oh... Zugangsdaten nicht gefunden. Vielleicht sind sie abgelaufen",
+ "Error while saving field" : "Fehler beim Speichern des Feldes",
"A Passman item has been created, modified or deleted" : "Ein Passman-Element wurde erstellt, modifiziert oder gelöscht",
"A Passman item has expired" : "Ein Passman-Element ist abgelaufen",
"A Passman item has been shared" : "Ein Passman-Element wurde geteilt",
@@ -250,6 +254,15 @@
"%s shared \"%s\" with you. Click here to accept" : "%s teilt \"%s\" mit dir. Um dies zu akzeptieren, klicke hier",
"%s has declined your share request for \"%s\"." : "%s hat das Teilen von \"%s\" mit dir abgelehnt.",
"%s has accepted your share request for \"%s\"." : "%s hat das Teilen von \"%s\" mit dir akzeptiert.",
+ "Unable to get version info" : "Versionsinfo konnte nicht ermittelt werden",
+ "Passman Settings" : "Passman-Einstellungen",
+ "Github version:" : "Github-Version:",
+ "A newer version of passman is available" : "Es ist eine neuere Version von Passman verfügbar",
+ "Allow users on this server to share passwords with a link" : "Erlaube Benutzern dieses Servers das Teilen von Passwörtern via Link",
+ "Allow users on this server to share passwords with other users" : "Erlaube Benutzern dieses Servers das Teilen von Passwörtern mit anderen Benutzern",
+ "Check for new versions" : "Nach neuerer Version suchen",
+ "Enable HTTPS check" : "HTTPS-Prüfung aktivieren",
+ "Disable context menu" : "Kontextmenü deaktivieren",
"Connection to server lost" : "Verbindung zum Server verloren",
"Problem loading page, reloading in 5 seconds" : "Problem beim Laden der Seite, Seite wird in 5 Sekunden nochmals geladen",
"Saving..." : "Speichere…",
diff --git a/l10n/de_DE.js b/l10n/de_DE.js
index 523ce6cc..72c5da45 100644
--- a/l10n/de_DE.js
+++ b/l10n/de_DE.js
@@ -10,7 +10,6 @@ OC.L10N.register(
"Please fill in a label!" : "Bitte Beschriftung hinzufügen!",
"Please fill in a value!" : "Bitte einen Wert hinzufügen!",
"Error loading file" : "Fehler beim Laden der Datei",
- "An error happend during decryption" : "Ein Fehler ist beim Entschlüsseln aufgetreten",
"Credential created!" : "Anmeldeinformation erstellt!",
"Credential deleted" : "Anmeldeinformation gelöscht",
"Credential updated" : "Anmeldeinformation aktualisiert",
@@ -44,6 +43,10 @@ OC.L10N.register(
"Credential unshared" : "Anmeldeinformation wird nicht mehr geteilt",
"Credential shared" : "Anmeldeinformation wird geteilt",
"Saved!" : "Gespeichert!",
+ "Poor" : "mangelhaft",
+ "Weak" : "Schwach",
+ "Good" : "Gut",
+ "Strong" : "Stark",
"Toggle visibility" : "Sichtbarkeit umschalten",
"Copy to clipboard" : "In die Zwischenablage kopieren",
"Copied to clipboard!" : "In die Zwischenablage kopiert!",
@@ -224,6 +227,7 @@ OC.L10N.register(
"Click here to request it" : "Hier klicken um es anzufordern",
"Loading..." : "Lade...",
"Awwhh.... credential not found. Maybe it expired" : "Oh... Zugangsdaten nicht gefunden. Vielleicht sind sie abgelaufen",
+ "Error while saving field" : "Fehler beim Speichern des Feldes",
"A Passman item has been created, modified or deleted" : "Ein Passman-Element wurde erstellt, modifiziert oder gelöscht",
"A Passman item has expired" : "Ein Passman-Element ist abgelaufen",
"A Passman item has been shared" : "Ein Passman-Element wurde geteilt",
@@ -252,6 +256,15 @@ OC.L10N.register(
"%s shared \"%s\" with you. Click here to accept" : "%s teilt \"%s\" mit Ihnen. Um dies zu akzeptieren, klicken Sie bitte hier",
"%s has declined your share request for \"%s\"." : "%s hat das Teilen von \"%s\" mit Ihnen abgelehnt.",
"%s has accepted your share request for \"%s\"." : "%s hat das Teilen von \"%s\" mit Ihnen akzeptiert.",
+ "Unable to get version info" : "Versionsinfo konnte nicht ermittelt werden",
+ "Passman Settings" : "Passman-Einstellungen",
+ "Github version:" : "Github-Version:",
+ "A newer version of passman is available" : "Es ist eine neuere Version von Passman verfügbar",
+ "Allow users on this server to share passwords with a link" : "Erlaube Benutzern dieses Servers das Teilen von Passwörtern via Link",
+ "Allow users on this server to share passwords with other users" : "Erlaube Benutzern dieses Servers das Teilen von Passwörtern mit anderen Benutzern",
+ "Check for new versions" : "Nach neuerer Version suchen",
+ "Enable HTTPS check" : "HTTPS-Prüfung aktivieren",
+ "Disable context menu" : "Kontextmenü deaktivieren",
"Connection to server lost" : "Verbindung zum Server verloren",
"Problem loading page, reloading in 5 seconds" : "Problem beim Laden der Seite, Seite wird in 5 Sekunden erneut geladen",
"Saving..." : "Speichere...",
diff --git a/l10n/de_DE.json b/l10n/de_DE.json
index db6d4da7..586deb07 100644
--- a/l10n/de_DE.json
+++ b/l10n/de_DE.json
@@ -8,7 +8,6 @@
"Please fill in a label!" : "Bitte Beschriftung hinzufügen!",
"Please fill in a value!" : "Bitte einen Wert hinzufügen!",
"Error loading file" : "Fehler beim Laden der Datei",
- "An error happend during decryption" : "Ein Fehler ist beim Entschlüsseln aufgetreten",
"Credential created!" : "Anmeldeinformation erstellt!",
"Credential deleted" : "Anmeldeinformation gelöscht",
"Credential updated" : "Anmeldeinformation aktualisiert",
@@ -42,6 +41,10 @@
"Credential unshared" : "Anmeldeinformation wird nicht mehr geteilt",
"Credential shared" : "Anmeldeinformation wird geteilt",
"Saved!" : "Gespeichert!",
+ "Poor" : "mangelhaft",
+ "Weak" : "Schwach",
+ "Good" : "Gut",
+ "Strong" : "Stark",
"Toggle visibility" : "Sichtbarkeit umschalten",
"Copy to clipboard" : "In die Zwischenablage kopieren",
"Copied to clipboard!" : "In die Zwischenablage kopiert!",
@@ -222,6 +225,7 @@
"Click here to request it" : "Hier klicken um es anzufordern",
"Loading..." : "Lade...",
"Awwhh.... credential not found. Maybe it expired" : "Oh... Zugangsdaten nicht gefunden. Vielleicht sind sie abgelaufen",
+ "Error while saving field" : "Fehler beim Speichern des Feldes",
"A Passman item has been created, modified or deleted" : "Ein Passman-Element wurde erstellt, modifiziert oder gelöscht",
"A Passman item has expired" : "Ein Passman-Element ist abgelaufen",
"A Passman item has been shared" : "Ein Passman-Element wurde geteilt",
@@ -250,6 +254,15 @@
"%s shared \"%s\" with you. Click here to accept" : "%s teilt \"%s\" mit Ihnen. Um dies zu akzeptieren, klicken Sie bitte hier",
"%s has declined your share request for \"%s\"." : "%s hat das Teilen von \"%s\" mit Ihnen abgelehnt.",
"%s has accepted your share request for \"%s\"." : "%s hat das Teilen von \"%s\" mit Ihnen akzeptiert.",
+ "Unable to get version info" : "Versionsinfo konnte nicht ermittelt werden",
+ "Passman Settings" : "Passman-Einstellungen",
+ "Github version:" : "Github-Version:",
+ "A newer version of passman is available" : "Es ist eine neuere Version von Passman verfügbar",
+ "Allow users on this server to share passwords with a link" : "Erlaube Benutzern dieses Servers das Teilen von Passwörtern via Link",
+ "Allow users on this server to share passwords with other users" : "Erlaube Benutzern dieses Servers das Teilen von Passwörtern mit anderen Benutzern",
+ "Check for new versions" : "Nach neuerer Version suchen",
+ "Enable HTTPS check" : "HTTPS-Prüfung aktivieren",
+ "Disable context menu" : "Kontextmenü deaktivieren",
"Connection to server lost" : "Verbindung zum Server verloren",
"Problem loading page, reloading in 5 seconds" : "Problem beim Laden der Seite, Seite wird in 5 Sekunden erneut geladen",
"Saving..." : "Speichere...",
diff --git a/l10n/es.js b/l10n/es.js
index 64155db8..028a4dd1 100644
--- a/l10n/es.js
+++ b/l10n/es.js
@@ -10,7 +10,6 @@ OC.L10N.register(
"Please fill in a label!" : "¡Por favor llene en una etiqueta!",
"Please fill in a value!" : "¡Por favor llene en un valor!",
"Error loading file" : "Error al cargar el archivo",
- "An error happend during decryption" : "Un error sucedió durante el descifrado ",
"Credential created!" : "¡Credencial creada!",
"Credential deleted" : "Credencial eliminada",
"Credential updated" : "Credencial actualziada",
diff --git a/l10n/es.json b/l10n/es.json
index 66528756..94de08f0 100644
--- a/l10n/es.json
+++ b/l10n/es.json
@@ -8,7 +8,6 @@
"Please fill in a label!" : "¡Por favor llene en una etiqueta!",
"Please fill in a value!" : "¡Por favor llene en un valor!",
"Error loading file" : "Error al cargar el archivo",
- "An error happend during decryption" : "Un error sucedió durante el descifrado ",
"Credential created!" : "¡Credencial creada!",
"Credential deleted" : "Credencial eliminada",
"Credential updated" : "Credencial actualziada",
diff --git a/l10n/fr.js b/l10n/fr.js
index a4a36d70..54b205b4 100644
--- a/l10n/fr.js
+++ b/l10n/fr.js
@@ -10,7 +10,6 @@ OC.L10N.register(
"Please fill in a label!" : "Veuillez remplir une étiquette !",
"Please fill in a value!" : "Veuillez remplir une valeur !",
"Error loading file" : "Erreur lors du chargement du fichier",
- "An error happend during decryption" : "Une erreur est survenue lors du décryptage",
"Credential created!" : "Information d'identification créée !",
"Credential deleted" : "Information d'identification supprimée",
"Credential updated" : "Information d'identification mise à jour",
@@ -44,6 +43,10 @@ OC.L10N.register(
"Credential unshared" : "Arrêt du partage de l'information d'identification ",
"Credential shared" : "Information d'identification partagée",
"Saved!" : "Sauvegardé !",
+ "Poor" : "Médiocre",
+ "Weak" : "Faible",
+ "Good" : "Bon",
+ "Strong" : "Fort",
"Toggle visibility" : "Activer la visibilité",
"Copy to clipboard" : "Copier dans le presse-papier",
"Copied to clipboard!" : "Copié dans le presse-papier !",
@@ -204,6 +207,7 @@ OC.L10N.register(
"Click here to request it" : "Cliquez ici pour le demander",
"Loading..." : "Chargement...",
"Awwhh.... credential not found. Maybe it expired" : "Awwhh.... information d'identification non trouvée. Il est peut être expiré",
+ "Error while saving field" : "Erreur lors de la sauvegarde du champ",
"A Passman item has been created, modified or deleted" : "Un élément Passman a été créé, modifié ou supprimé",
"A Passman item has expired" : "Un élément Passman a expiré",
"A Passman item has been shared" : "Un élément Passman a été partagé",
@@ -232,6 +236,14 @@ OC.L10N.register(
"%s shared \"%s\" with you. Click here to accept" : "%s a partagé \"%s\" avec vous. Cliquez ici pour accepter",
"%s has declined your share request for \"%s\"." : "%s a refusé votre demande de partage pour \"%s\"",
"%s has accepted your share request for \"%s\"." : "%s a accepté votre demande de partage pour \"%s\"",
+ "Unable to get version info" : "Impossible d'obtenir l'information de la version",
+ "Passman Settings" : "Paramètres de Passman",
+ "Github version:" : "Version Github :",
+ "A newer version of passman is available" : "Une version plus récente de Passman est disponible",
+ "Allow users on this server to share passwords with a link" : "Autoriser les utilisateurs de ce serveur à partager par lien des mots de passe",
+ "Allow users on this server to share passwords with other users" : "Autoriser les utilisateurs de ce serveur à partager des mots de passe avec d'autres utilisateurs",
+ "Check for new versions" : "Vérifier la présence de nouvelles versions",
+ "Enable HTTPS check" : "Activer la vérification HTTPS",
"Connection to server lost" : "Connexion au serveur perdu",
"Problem loading page, reloading in 5 seconds" : "Problème de chargement de la page, actualisation dans 5 secondes",
"Saving..." : "Enregistrement…",
diff --git a/l10n/fr.json b/l10n/fr.json
index 278d87bd..6ab7aab3 100644
--- a/l10n/fr.json
+++ b/l10n/fr.json
@@ -8,7 +8,6 @@
"Please fill in a label!" : "Veuillez remplir une étiquette !",
"Please fill in a value!" : "Veuillez remplir une valeur !",
"Error loading file" : "Erreur lors du chargement du fichier",
- "An error happend during decryption" : "Une erreur est survenue lors du décryptage",
"Credential created!" : "Information d'identification créée !",
"Credential deleted" : "Information d'identification supprimée",
"Credential updated" : "Information d'identification mise à jour",
@@ -42,6 +41,10 @@
"Credential unshared" : "Arrêt du partage de l'information d'identification ",
"Credential shared" : "Information d'identification partagée",
"Saved!" : "Sauvegardé !",
+ "Poor" : "Médiocre",
+ "Weak" : "Faible",
+ "Good" : "Bon",
+ "Strong" : "Fort",
"Toggle visibility" : "Activer la visibilité",
"Copy to clipboard" : "Copier dans le presse-papier",
"Copied to clipboard!" : "Copié dans le presse-papier !",
@@ -202,6 +205,7 @@
"Click here to request it" : "Cliquez ici pour le demander",
"Loading..." : "Chargement...",
"Awwhh.... credential not found. Maybe it expired" : "Awwhh.... information d'identification non trouvée. Il est peut être expiré",
+ "Error while saving field" : "Erreur lors de la sauvegarde du champ",
"A Passman item has been created, modified or deleted" : "Un élément Passman a été créé, modifié ou supprimé",
"A Passman item has expired" : "Un élément Passman a expiré",
"A Passman item has been shared" : "Un élément Passman a été partagé",
@@ -230,6 +234,14 @@
"%s shared \"%s\" with you. Click here to accept" : "%s a partagé \"%s\" avec vous. Cliquez ici pour accepter",
"%s has declined your share request for \"%s\"." : "%s a refusé votre demande de partage pour \"%s\"",
"%s has accepted your share request for \"%s\"." : "%s a accepté votre demande de partage pour \"%s\"",
+ "Unable to get version info" : "Impossible d'obtenir l'information de la version",
+ "Passman Settings" : "Paramètres de Passman",
+ "Github version:" : "Version Github :",
+ "A newer version of passman is available" : "Une version plus récente de Passman est disponible",
+ "Allow users on this server to share passwords with a link" : "Autoriser les utilisateurs de ce serveur à partager par lien des mots de passe",
+ "Allow users on this server to share passwords with other users" : "Autoriser les utilisateurs de ce serveur à partager des mots de passe avec d'autres utilisateurs",
+ "Check for new versions" : "Vérifier la présence de nouvelles versions",
+ "Enable HTTPS check" : "Activer la vérification HTTPS",
"Connection to server lost" : "Connexion au serveur perdu",
"Problem loading page, reloading in 5 seconds" : "Problème de chargement de la page, actualisation dans 5 secondes",
"Saving..." : "Enregistrement…",
diff --git a/l10n/it.js b/l10n/it.js
index faa06f21..8e2756c1 100644
--- a/l10n/it.js
+++ b/l10n/it.js
@@ -10,7 +10,6 @@ OC.L10N.register(
"Please fill in a label!" : "Aggiungi un'etichetta!",
"Please fill in a value!" : "Aggiungi un valore!",
"Error loading file" : "Errore durante il caricamento del file",
- "An error happend during decryption" : "Si è verificato un errore durante la decifratura",
"Credential created!" : "Credenziali create!",
"Credential deleted" : "Credenziali eliminate",
"Credential updated" : "Credenziali aggiornate",
diff --git a/l10n/it.json b/l10n/it.json
index 12a1ee14..7026d7f2 100644
--- a/l10n/it.json
+++ b/l10n/it.json
@@ -8,7 +8,6 @@
"Please fill in a label!" : "Aggiungi un'etichetta!",
"Please fill in a value!" : "Aggiungi un valore!",
"Error loading file" : "Errore durante il caricamento del file",
- "An error happend during decryption" : "Si è verificato un errore durante la decifratura",
"Credential created!" : "Credenziali create!",
"Credential deleted" : "Credenziali eliminate",
"Credential updated" : "Credenziali aggiornate",
diff --git a/l10n/nl.js b/l10n/nl.js
index 267c1b7f..d7fb0351 100644
--- a/l10n/nl.js
+++ b/l10n/nl.js
@@ -10,7 +10,6 @@ OC.L10N.register(
"Please fill in a label!" : "Voeg een label toe!",
"Please fill in a value!" : "Geef een waarde op!",
"Error loading file" : "Fout bij laden bestand",
- "An error happend during decryption" : "Er trad een fout op bij ontsleutelen",
"Credential created!" : "Inloggegevens aangemaakt!",
"Credential deleted" : "Inloggegevens verwijderd",
"Credential updated" : "Inloggegevens bijgewerkt",
@@ -44,6 +43,10 @@ OC.L10N.register(
"Credential unshared" : "Delen inloggegevens gestopt",
"Credential shared" : "Inloggegevens gedeeld",
"Saved!" : "Opgeslagen!",
+ "Poor" : "Slecht",
+ "Weak" : "Zwak",
+ "Good" : "Goed",
+ "Strong" : "Sterk",
"Toggle visibility" : "Omschakelen zichtbaarheid",
"Copy to clipboard" : "Kopiëren naar het klembord",
"Copied to clipboard!" : "Gekopieerd naar het klembord!",
@@ -224,6 +227,7 @@ OC.L10N.register(
"Click here to request it" : "Klik hier om het aan te vragen",
"Loading..." : "Laden...",
"Awwhh.... credential not found. Maybe it expired" : "Uhmmm.... inloggegeven niet gevonden. Misschien verlopen",
+ "Error while saving field" : "Fout bij opslaan veld",
"A Passman item has been created, modified or deleted" : "Er is een Passman object gemaakt, gewijzigd of verwijderd",
"A Passman item has expired" : "Er is een Passman object vervallen",
"A Passman item has been shared" : "Er is een Passman object gedeeld",
@@ -252,6 +256,15 @@ OC.L10N.register(
"%s shared \"%s\" with you. Click here to accept" : "%s deelde \"%s\" met je. Klik hier om te accepteren",
"%s has declined your share request for \"%s\"." : "%s weigerde je aanvraag om \"%s\" te delen.",
"%s has accepted your share request for \"%s\"." : "%s accepteerde je aanvraag om \"%s\" te delen.",
+ "Unable to get version info" : "Kon de versieinformatie niet ophalen",
+ "Passman Settings" : "Passman instellingen",
+ "Github version:" : "Github versie:",
+ "A newer version of passman is available" : "Er is een meer recente versie van passman beschikbaar",
+ "Allow users on this server to share passwords with a link" : "Toestaan dat gebruikers op deze server wachtwoorden delen via een link",
+ "Allow users on this server to share passwords with other users" : "Toestaan dat gebruikers op deze server wachtwoorden met andere gebruikers delen",
+ "Check for new versions" : "Controleren op nieuwe versies",
+ "Enable HTTPS check" : "Inschakelen HTTPS controle",
+ "Disable context menu" : "Deactiveren contextmenu",
"Connection to server lost" : "Verbinding met server verloren",
"Problem loading page, reloading in 5 seconds" : "Probleem met het laden van de pagina, wordt ververst in 5 seconden",
"Saving..." : "Opslaan...",
diff --git a/l10n/nl.json b/l10n/nl.json
index cd07a07a..206edc13 100644
--- a/l10n/nl.json
+++ b/l10n/nl.json
@@ -8,7 +8,6 @@
"Please fill in a label!" : "Voeg een label toe!",
"Please fill in a value!" : "Geef een waarde op!",
"Error loading file" : "Fout bij laden bestand",
- "An error happend during decryption" : "Er trad een fout op bij ontsleutelen",
"Credential created!" : "Inloggegevens aangemaakt!",
"Credential deleted" : "Inloggegevens verwijderd",
"Credential updated" : "Inloggegevens bijgewerkt",
@@ -42,6 +41,10 @@
"Credential unshared" : "Delen inloggegevens gestopt",
"Credential shared" : "Inloggegevens gedeeld",
"Saved!" : "Opgeslagen!",
+ "Poor" : "Slecht",
+ "Weak" : "Zwak",
+ "Good" : "Goed",
+ "Strong" : "Sterk",
"Toggle visibility" : "Omschakelen zichtbaarheid",
"Copy to clipboard" : "Kopiëren naar het klembord",
"Copied to clipboard!" : "Gekopieerd naar het klembord!",
@@ -222,6 +225,7 @@
"Click here to request it" : "Klik hier om het aan te vragen",
"Loading..." : "Laden...",
"Awwhh.... credential not found. Maybe it expired" : "Uhmmm.... inloggegeven niet gevonden. Misschien verlopen",
+ "Error while saving field" : "Fout bij opslaan veld",
"A Passman item has been created, modified or deleted" : "Er is een Passman object gemaakt, gewijzigd of verwijderd",
"A Passman item has expired" : "Er is een Passman object vervallen",
"A Passman item has been shared" : "Er is een Passman object gedeeld",
@@ -250,6 +254,15 @@
"%s shared \"%s\" with you. Click here to accept" : "%s deelde \"%s\" met je. Klik hier om te accepteren",
"%s has declined your share request for \"%s\"." : "%s weigerde je aanvraag om \"%s\" te delen.",
"%s has accepted your share request for \"%s\"." : "%s accepteerde je aanvraag om \"%s\" te delen.",
+ "Unable to get version info" : "Kon de versieinformatie niet ophalen",
+ "Passman Settings" : "Passman instellingen",
+ "Github version:" : "Github versie:",
+ "A newer version of passman is available" : "Er is een meer recente versie van passman beschikbaar",
+ "Allow users on this server to share passwords with a link" : "Toestaan dat gebruikers op deze server wachtwoorden delen via een link",
+ "Allow users on this server to share passwords with other users" : "Toestaan dat gebruikers op deze server wachtwoorden met andere gebruikers delen",
+ "Check for new versions" : "Controleren op nieuwe versies",
+ "Enable HTTPS check" : "Inschakelen HTTPS controle",
+ "Disable context menu" : "Deactiveren contextmenu",
"Connection to server lost" : "Verbinding met server verloren",
"Problem loading page, reloading in 5 seconds" : "Probleem met het laden van de pagina, wordt ververst in 5 seconden",
"Saving..." : "Opslaan...",
diff --git a/l10n/pt_BR.js b/l10n/pt_BR.js
index 107ca8f9..6810d65a 100644
--- a/l10n/pt_BR.js
+++ b/l10n/pt_BR.js
@@ -10,7 +10,6 @@ OC.L10N.register(
"Please fill in a label!" : "Preencha o rótulo!",
"Please fill in a value!" : "Preencha um valor!",
"Error loading file" : "Erro ao carregar o arquivo",
- "An error happend during decryption" : "Ocorreu um erro durante a descriptografia",
"Credential created!" : "Credencial criada!",
"Credential deleted" : "Credential excluída",
"Credential updated" : "Credencial atualizada",
diff --git a/l10n/pt_BR.json b/l10n/pt_BR.json
index d9411e0b..4a88b9b6 100644
--- a/l10n/pt_BR.json
+++ b/l10n/pt_BR.json
@@ -8,7 +8,6 @@
"Please fill in a label!" : "Preencha o rótulo!",
"Please fill in a value!" : "Preencha um valor!",
"Error loading file" : "Erro ao carregar o arquivo",
- "An error happend during decryption" : "Ocorreu um erro durante a descriptografia",
"Credential created!" : "Credencial criada!",
"Credential deleted" : "Credential excluída",
"Credential updated" : "Credencial atualizada",
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index ca9cdc3a..711365ba 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 OCA\Passman\Service\SettingsService;
use OCP\IConfig;
use OCP\IDBConnection;
@@ -72,7 +73,7 @@ class Application extends App {
$c->query('CredentialService'),
$c->query('NotificationService'),
$c->query('FileService'),
- $c->query('IConfig')
+ $c->query('SettingsService')
);
});
@@ -112,6 +113,7 @@ class Application extends App {
$container->registerAlias('Utils', Utils::class);
$container->registerAlias('IDBConnection', IDBConnection::class);
$container->registerAlias('IConfig', IConfig::class);
+ $container->registerAlias('SettingsService', SettingsService::class);
}
/**
diff --git a/lib/Service/SettingsService.php b/lib/Service/SettingsService.php
new file mode 100644
index 00000000..c61af779
--- /dev/null
+++ b/lib/Service/SettingsService.php
@@ -0,0 +1,114 @@
+.
+ *
+ */
+
+namespace OCA\Passman\Service;
+
+use OCP\IConfig;
+
+
+class SettingsService {
+
+ private $userId;
+ private $config;
+ private $appName;
+ public $settings;
+
+ private $numeric_settings = array(
+ 'link_sharing_enabled',
+ 'user_sharing_enabled',
+ 'vault_key_strength',
+ 'check_version',
+ 'https_check',
+ 'disable_contextmenu'
+ );
+
+ public function __construct($UserId, IConfig $config, $AppName) {
+ $this->userId = $UserId;
+ $this->config = $config;
+ $this->appName = $AppName;
+ }
+
+ /**
+ * Get all app settings
+ *
+ * @return array
+ */
+ public function getAppSettings() {
+ $this->settings = array(
+ 'link_sharing_enabled' => intval($this->config->getAppValue('passman', 'link_sharing_enabled', 1)),
+ 'user_sharing_enabled' => intval($this->config->getAppValue('passman', 'user_sharing_enabled', 1)),
+ 'vault_key_strength' => intval($this->config->getAppValue('passman', 'vault_key_strength', 3)),
+ 'check_version' => intval($this->config->getAppValue('passman', 'check_version', 1)),
+ 'https_check' => intval($this->config->getAppValue('passman', 'https_check', 1)),
+ 'disable_contextmenu' => intval($this->config->getAppValue('passman', 'disable_contextmenu', 1)),
+ );
+ return $this->settings;
+ }
+
+ /**
+ * Get a app setting
+ *
+ * @param $key string
+ * @param null $default_value The default value if key does not exist
+ * @return mixed
+ */
+ public function getAppSetting($key, $default_value = null) {
+ $value = $this->config->getAppValue('passman', $key, $default_value);
+ if (in_array($key, $this->numeric_settings)) {
+ $value = intval($value);
+ }
+ return $value;
+ }
+
+ /**
+ * Set a app setting
+ *
+ * @param $key string Setting name
+ * @param $value mixed Value of the setting
+ */
+ public function setAppSetting($key, $value) {
+ $this->config->setAppValue('passman', $key, $value);
+ }
+
+ /**
+ * Set a user setting
+ *
+ * @param $key string Setting name
+ * @param $value mixed Value of the setting
+ */
+
+ public function setUserSetting($key, $value){
+ return $this->config->setUserValue($this->userId, $this->appName, $key, $value);
+ }
+
+ /**
+ * Check if an setting is enabled (value of 1)
+ *
+ * @param $setting
+ * @return bool
+ */
+ public function isEnabled($setting){
+ $value = intval($this->config->getAppValue('passman', $setting, false));
+ return ($value === 1);
+ }
+}
\ No newline at end of file
diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php
deleted file mode 100644
index 90f27ab4..00000000
--- a/lib/Settings/Admin.php
+++ /dev/null
@@ -1,70 +0,0 @@
-.
- *
- */
-
-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;
- }
-
-}
diff --git a/templates/admin.settings.php b/templates/admin.settings.php
new file mode 100644
index 00000000..b5280153
--- /dev/null
+++ b/templates/admin.settings.php
@@ -0,0 +1,4 @@
+fetchPage();
\ No newline at end of file
diff --git a/templates/settings-admin.php b/templates/part.admin.php
similarity index 97%
rename from templates/settings-admin.php
rename to templates/part.admin.php
index 4ca60bf0..ac5f4d2e 100644
--- a/templates/settings-admin.php
+++ b/templates/part.admin.php
@@ -25,7 +25,7 @@ if ($checkVersion) {
}
?>
-