From 80973c77a852e3696d2f759c9be15d93bb6704f4 Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Thu, 29 Dec 2016 01:51:19 +0000 Subject: [PATCH 1/2] [tx-robot] updated from transifex --- l10n/fr.js | 20 ++++++++++++++++++++ l10n/fr.json | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/l10n/fr.js b/l10n/fr.js index b6642449..a4a36d70 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -20,6 +20,7 @@ OC.L10N.register( "Decrypting credentials" : "Décryptage des informations d'identification", "Done" : "Fait", "File read successfully!" : "Fichier lu avec succès !", + "Credential has no label, skipping" : "L'information d'identification n'a pas d'étiquette, ignorée", "Adding {{credential}}" : "{{credential}} en cours d'ajout", "Added {{credential}}" : "{{credential}} ajouté", "Parsed {{num}} credentials, starting to import" : "{{num}} informations d'identification analysées, commence à importer", @@ -99,6 +100,7 @@ OC.L10N.register( "About Passman" : "À propos de Passman", "Version" : "Version", "Donate to support development" : "Donner pour aider le développement", + "Bookmarklet" : "Bookmarklet", "Save your passwords with 1 click!" : "Sauvegardez vos mots de passe en 1 clic !", "Drag below button to your bookmark toolbar." : "Glissez le bouton ci-dessous dans la barre d'outils de vos favoris.", "Import type" : "Type d'importation", @@ -136,9 +138,16 @@ OC.L10N.register( "10 / second" : "10 / seconde", "10k / second" : "10k / seconde", "10B / second" : "10B / seconde", + "Dictionary name" : "Nom du dictionnaire", "Rank" : "Rang", + "Reversed" : "Inversé", + "Uppercase variations" : "Variations en majuscules", + "l33t-variations" : "Variations l33t", + "Showing revisions of" : "Montrer les révisions de", + "Revision of" : "Révisions de", "by" : "par", "No revisions found." : "Pas de révision trouvée.", + "Label" : "Étiquette", "Restore revision" : "Restaurer la révision", "Delete revision" : "Supprimer la révision", "Edit credential" : "Éditer le rapport d'identification", @@ -146,7 +155,10 @@ OC.L10N.register( "Save" : "Sauvegarder", "Cancel" : "Annuler", "Settings" : "Paramètres", + "Share credential {{credential}}" : "Partage l'information d'identification {{credential}}", "Unshare" : "Ne plus partager", + "Showing deleted since" : "Montrer ceux supprimés depuis", + "Search credential..." : "Rechercher l'information d'identification...", "Account" : "Compte", "Password" : "Mot de passe", "OTP" : "OTP", @@ -161,7 +173,11 @@ OC.L10N.register( "Share" : "Partager", "Recover" : "Restaurer", "Destroy" : "Détruire", + "You have incoming share requests." : "Vous avez des nouvelles demandes de partage.", + "If you want to the credential in a other vault," : "Si vous souhaitez obtenir les informations d'identification dans un autre coffre-fort,", + "logout of this vault and login to the vault you want the shared credential in." : "déconnectez-vous de ce coffre-fort et connectez-vous au coffre-fort dans lequel vous voulez les informations d'identification partagées.", "Permissions" : "Permissions", + "Received from" : "Reçu de", "Date" : "Date", "Accept" : "Accepter", "Decline" : "Refuser", @@ -174,6 +190,7 @@ OC.L10N.register( "Your sharing key's will have a strength of 1024 bit, which you can change later in settings." : "Votre clé de partage aura un poids de 1024 octet, ce qui pourra être modifié plus tard dans les paramètres.", "Create vault" : "Créer un coffre-fort", "Go back to vaults" : "Retourner aux coffres-forts", + "Please input the password for" : "Veuillez entrer le mot de passe pour", "Set this vault as default." : "Choisir ce coffre-fort par défaut.", "Login automatically to this vault." : "Se connecter automatiquement à ce coffre-fort.", "Decrypt vault" : "Déchiffrer le coffre-fort", @@ -183,7 +200,10 @@ OC.L10N.register( "Deleted credentials" : "Supprimer les informations d'identification", "Logout" : "Se déconnecter", "Donate" : "Donner", + "Someone has shared a credential with you." : "Quelqu'un a partagé une information d'identification avec vous.", + "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é", "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é", diff --git a/l10n/fr.json b/l10n/fr.json index 2492d33d..278d87bd 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -18,6 +18,7 @@ "Decrypting credentials" : "Décryptage des informations d'identification", "Done" : "Fait", "File read successfully!" : "Fichier lu avec succès !", + "Credential has no label, skipping" : "L'information d'identification n'a pas d'étiquette, ignorée", "Adding {{credential}}" : "{{credential}} en cours d'ajout", "Added {{credential}}" : "{{credential}} ajouté", "Parsed {{num}} credentials, starting to import" : "{{num}} informations d'identification analysées, commence à importer", @@ -97,6 +98,7 @@ "About Passman" : "À propos de Passman", "Version" : "Version", "Donate to support development" : "Donner pour aider le développement", + "Bookmarklet" : "Bookmarklet", "Save your passwords with 1 click!" : "Sauvegardez vos mots de passe en 1 clic !", "Drag below button to your bookmark toolbar." : "Glissez le bouton ci-dessous dans la barre d'outils de vos favoris.", "Import type" : "Type d'importation", @@ -134,9 +136,16 @@ "10 / second" : "10 / seconde", "10k / second" : "10k / seconde", "10B / second" : "10B / seconde", + "Dictionary name" : "Nom du dictionnaire", "Rank" : "Rang", + "Reversed" : "Inversé", + "Uppercase variations" : "Variations en majuscules", + "l33t-variations" : "Variations l33t", + "Showing revisions of" : "Montrer les révisions de", + "Revision of" : "Révisions de", "by" : "par", "No revisions found." : "Pas de révision trouvée.", + "Label" : "Étiquette", "Restore revision" : "Restaurer la révision", "Delete revision" : "Supprimer la révision", "Edit credential" : "Éditer le rapport d'identification", @@ -144,7 +153,10 @@ "Save" : "Sauvegarder", "Cancel" : "Annuler", "Settings" : "Paramètres", + "Share credential {{credential}}" : "Partage l'information d'identification {{credential}}", "Unshare" : "Ne plus partager", + "Showing deleted since" : "Montrer ceux supprimés depuis", + "Search credential..." : "Rechercher l'information d'identification...", "Account" : "Compte", "Password" : "Mot de passe", "OTP" : "OTP", @@ -159,7 +171,11 @@ "Share" : "Partager", "Recover" : "Restaurer", "Destroy" : "Détruire", + "You have incoming share requests." : "Vous avez des nouvelles demandes de partage.", + "If you want to the credential in a other vault," : "Si vous souhaitez obtenir les informations d'identification dans un autre coffre-fort,", + "logout of this vault and login to the vault you want the shared credential in." : "déconnectez-vous de ce coffre-fort et connectez-vous au coffre-fort dans lequel vous voulez les informations d'identification partagées.", "Permissions" : "Permissions", + "Received from" : "Reçu de", "Date" : "Date", "Accept" : "Accepter", "Decline" : "Refuser", @@ -172,6 +188,7 @@ "Your sharing key's will have a strength of 1024 bit, which you can change later in settings." : "Votre clé de partage aura un poids de 1024 octet, ce qui pourra être modifié plus tard dans les paramètres.", "Create vault" : "Créer un coffre-fort", "Go back to vaults" : "Retourner aux coffres-forts", + "Please input the password for" : "Veuillez entrer le mot de passe pour", "Set this vault as default." : "Choisir ce coffre-fort par défaut.", "Login automatically to this vault." : "Se connecter automatiquement à ce coffre-fort.", "Decrypt vault" : "Déchiffrer le coffre-fort", @@ -181,7 +198,10 @@ "Deleted credentials" : "Supprimer les informations d'identification", "Logout" : "Se déconnecter", "Donate" : "Donner", + "Someone has shared a credential with you." : "Quelqu'un a partagé une information d'identification avec vous.", + "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é", "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é", From 9ab74be344d3f7eaacd66c24727180aaacb6e317 Mon Sep 17 00:00:00 2001 From: brantje Date: Thu, 29 Dec 2016 00:07:27 +0100 Subject: [PATCH 2/2] Check if shared_key exists Remove value set by php Replace DoesNotExistException with Exeption --- controller/credentialcontroller.php | 8 ++++---- controller/filecontroller.php | 2 +- controller/sharecontroller.php | 32 ++++++++++++++--------------- controller/vaultcontroller.php | 4 ++-- lib/Db/CredentialMapper.php | 4 +++- templates/settings-admin.php | 2 +- 6 files changed, 27 insertions(+), 25 deletions(-) diff --git a/controller/credentialcontroller.php b/controller/credentialcontroller.php index fdc391fb..2ab356d3 100644 --- a/controller/credentialcontroller.php +++ b/controller/credentialcontroller.php @@ -192,7 +192,7 @@ class CredentialController extends ApiController { try { $acl_list = $this->sharingService->getCredentialAclList($storedCredential->getGuid()); - } catch (DoesNotExistException $exception) { + } catch (\Exception $exception) { // Just check if we have an acl list } if (!empty($acl_list)) { @@ -270,7 +270,7 @@ class CredentialController extends ApiController { public function getRevision($credential_guid) { try { $credential = $this->credentialService->getCredentialByGUID($credential_guid); - } catch (DoesNotExistException $ex) { + } catch (\Exception $ex) { return new NotFoundJSONResponse(); } @@ -306,13 +306,13 @@ class CredentialController extends ApiController { $revision = null; try { $this->credentialService->getCredentialByGUID($credential_guid, $this->userId); - } catch (DoesNotExistException $e) { + } catch (\Exception $e) { return new NotFoundJSONResponse(); } try { $revision = $this->credentialRevisionService->getRevision($revision_id); - } catch (DoesNotExistException $exception) { + } catch (\Exception $exception) { return new NotFoundJSONResponse(); } diff --git a/controller/filecontroller.php b/controller/filecontroller.php index 618133ea..d3c29ea5 100644 --- a/controller/filecontroller.php +++ b/controller/filecontroller.php @@ -62,7 +62,7 @@ class FileController extends ApiController { public function updateFile($file_id, $file_data, $filename, $mimetype, $size){ try{ $file = $this->fileService->getFile($file_id, $this->userId); - } catch (DoesNotExistException $doesNotExistException){ + } catch (\Exception $doesNotExistException){ } if($file){ diff --git a/controller/sharecontroller.php b/controller/sharecontroller.php index aa061432..f8c137c2 100644 --- a/controller/sharecontroller.php +++ b/controller/sharecontroller.php @@ -96,13 +96,13 @@ class ShareController extends ApiController { try { $credential = $this->credentialService->getCredentialByGUID($item_guid); - } catch (DoesNotExistException $exception) { + } catch (\Exception $exception) { return new NotFoundResponse(); } try { $acl = $this->shareService->getACL(null, $item_guid); - } catch (DoesNotExistException $exception) { + } catch (\Exception $exception) { $acl = new SharingACL(); } @@ -145,14 +145,14 @@ class ShareController extends ApiController { if (count($shareRequests) > 0) { return new JSONResponse(array('error' => 'User got already pending requests')); } - } catch (DoesNotExistException $exception) { + } catch (\Exception $exception) { // no need to catch this } $acl = null; try { $acl = $this->shareService->getCredentialAclForUser($first_vault['user_id'], $item_guid); - } catch (DoesNotExistException $exception) { + } catch (\Exception $exception) { // no need to catch this } @@ -247,12 +247,12 @@ class ShareController extends ApiController { $sr = null; try { $acl = $this->shareService->getCredentialAclForUser($user_id, $item_guid); - } catch (DoesNotExistException $e) { + } catch (\Exception $e) { } try { $sr = array_pop($this->shareService->getPendingShareRequestsForCredential($item_guid, $user_id)); - } catch (DoesNotExistException $e) { + } catch (\Exception $e) { // no need to catch this } @@ -307,7 +307,7 @@ class ShareController extends ApiController { public function savePendingRequest($item_guid, $target_vault_guid, $final_shared_key) { try { $sr = $this->shareService->getRequestByGuid($item_guid, $target_vault_guid); - } catch (DoesNotExistException $ex) { + } catch (\Exception $ex) { return new NotFoundResponse(); } @@ -348,7 +348,7 @@ class ShareController extends ApiController { array_push($results, $result); } return new JSONResponse($results); - } catch (DoesNotExistException $ex) { + } catch (\Exception $ex) { return new NotFoundResponse(); } } @@ -362,7 +362,7 @@ class ShareController extends ApiController { public function getRevisions($item_guid) { try { return new JSONResponse($this->shareService->getItemHistory($this->userId, $item_guid)); - } catch (DoesNotExistException $ex) { + } catch (\Exception $ex) { return new NotFoundJSONResponse(); } } @@ -378,7 +378,7 @@ class ShareController extends ApiController { try { return new JSONResponse($this->shareService->getSharedItems($this->userId->getUID(), $vault_guid)); - } catch (DoesNotExistException $ex) { + } catch (\Exception $ex) { return new NotFoundResponse(); } } @@ -413,7 +413,7 @@ class ShareController extends ApiController { $this->shareService->cleanItemRequestsForUser($sr); return new JSONResponse(array('result' => true)); - } catch (DoesNotExistException $ex) { + } catch (\Exception $ex) { return new NotFoundJSONResponse(); } } @@ -447,7 +447,7 @@ class ShareController extends ApiController { try { $credential = $this->shareService->getSharedItem(null, $credential_guid); return new JSONResponse($credential); - } catch (DoesNotExistException $ex) { + } catch (\Exception $ex) { return new NotFoundJSONResponse(); } } @@ -472,7 +472,7 @@ class ShareController extends ApiController { } else { return new NotFoundResponse(); } - } catch (DoesNotExistException $ex) { + } catch (\Exception $ex) { return new JSONResponse(array()); } } @@ -488,7 +488,7 @@ class ShareController extends ApiController { public function getFile($item_guid, $file_guid) { try { $credential = $this->credentialService->getCredentialByGUID($item_guid); - } catch (DoesNotExistException $e) { + } catch (\Exception $e) { return new NotFoundJSONResponse(); } $userId = ($this->userId) ? $this->userId->getUID() : null; @@ -511,7 +511,7 @@ class ShareController extends ApiController { public function updateSharedCredentialACL($item_guid, $user_id, $permission) { try { $credential = $this->credentialService->getCredentialByGUID($item_guid); - } catch (DoesNotExistException $exception) { + } catch (\Exception $exception) { return new NotFoundJSONResponse(); } if ($this->userId->getUID() === $credential->getUserId()) { @@ -520,7 +520,7 @@ class ShareController extends ApiController { $acl = $this->shareService->getACL($user_id, $item_guid); $acl->setPermissions($permission); return $this->shareService->updateCredentialACL($acl); - } catch (DoesNotExistException $exception) { + } catch (\Exception $exception) { } diff --git a/controller/vaultcontroller.php b/controller/vaultcontroller.php index 40f051c1..c206a39e 100644 --- a/controller/vaultcontroller.php +++ b/controller/vaultcontroller.php @@ -86,7 +86,7 @@ class VaultController extends ApiController { $vault = null; try { $vault = $this->vaultService->getByGuid($vault_guid, $this->userId); - } catch (DoesNotExistException $e) { + } catch (\Exception $e) { return new NotFoundJSONResponse(); } $result = array(); @@ -136,7 +136,7 @@ class VaultController extends ApiController { $vault = null; try { $vault = $this->vaultService->getByGuid($vault_guid, $this->userId); - } catch (DoesNotExistException $e) { + } catch (\Exception $e) { } diff --git a/lib/Db/CredentialMapper.php b/lib/Db/CredentialMapper.php index 32303ca8..5d3443f6 100644 --- a/lib/Db/CredentialMapper.php +++ b/lib/Db/CredentialMapper.php @@ -131,7 +131,9 @@ class CredentialMapper extends Mapper { $credential->setCustomFields($raw_credential['custom_fields']); $credential->setOtp($raw_credential['otp']); $credential->setHidden($raw_credential['hidden']); - $credential->setSharedKey($raw_credential['shared_key']); + if(isset($raw_credential['shared_key'])) { + $credential->setSharedKey($raw_credential['shared_key']); + } return parent::insert($credential); } diff --git a/templates/settings-admin.php b/templates/settings-admin.php index 5642a9d0..4ca60bf0 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -52,7 +52,7 @@ if ($checkVersion) {

/> + value="1" />