Merge branch 'smallFixes'

This commit is contained in:
brantje 2016-12-29 12:37:08 +01:00
commit 46f51f14d8
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
8 changed files with 67 additions and 25 deletions

View file

@ -192,7 +192,7 @@ class CredentialController extends ApiController {
try { try {
$acl_list = $this->sharingService->getCredentialAclList($storedCredential->getGuid()); $acl_list = $this->sharingService->getCredentialAclList($storedCredential->getGuid());
} catch (DoesNotExistException $exception) { } catch (\Exception $exception) {
// Just check if we have an acl list // Just check if we have an acl list
} }
if (!empty($acl_list)) { if (!empty($acl_list)) {
@ -270,7 +270,7 @@ class CredentialController extends ApiController {
public function getRevision($credential_guid) { public function getRevision($credential_guid) {
try { try {
$credential = $this->credentialService->getCredentialByGUID($credential_guid); $credential = $this->credentialService->getCredentialByGUID($credential_guid);
} catch (DoesNotExistException $ex) { } catch (\Exception $ex) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }
@ -306,13 +306,13 @@ class CredentialController extends ApiController {
$revision = null; $revision = null;
try { try {
$this->credentialService->getCredentialByGUID($credential_guid, $this->userId); $this->credentialService->getCredentialByGUID($credential_guid, $this->userId);
} catch (DoesNotExistException $e) { } catch (\Exception $e) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }
try { try {
$revision = $this->credentialRevisionService->getRevision($revision_id); $revision = $this->credentialRevisionService->getRevision($revision_id);
} catch (DoesNotExistException $exception) { } catch (\Exception $exception) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }

View file

@ -62,7 +62,7 @@ class FileController extends ApiController {
public function updateFile($file_id, $file_data, $filename, $mimetype, $size){ public function updateFile($file_id, $file_data, $filename, $mimetype, $size){
try{ try{
$file = $this->fileService->getFile($file_id, $this->userId); $file = $this->fileService->getFile($file_id, $this->userId);
} catch (DoesNotExistException $doesNotExistException){ } catch (\Exception $doesNotExistException){
} }
if($file){ if($file){

View file

@ -96,13 +96,13 @@ class ShareController extends ApiController {
try { try {
$credential = $this->credentialService->getCredentialByGUID($item_guid); $credential = $this->credentialService->getCredentialByGUID($item_guid);
} catch (DoesNotExistException $exception) { } catch (\Exception $exception) {
return new NotFoundResponse(); return new NotFoundResponse();
} }
try { try {
$acl = $this->shareService->getACL(null, $item_guid); $acl = $this->shareService->getACL(null, $item_guid);
} catch (DoesNotExistException $exception) { } catch (\Exception $exception) {
$acl = new SharingACL(); $acl = new SharingACL();
} }
@ -145,14 +145,14 @@ class ShareController extends ApiController {
if (count($shareRequests) > 0) { if (count($shareRequests) > 0) {
return new JSONResponse(array('error' => 'User got already pending requests')); return new JSONResponse(array('error' => 'User got already pending requests'));
} }
} catch (DoesNotExistException $exception) { } catch (\Exception $exception) {
// no need to catch this // no need to catch this
} }
$acl = null; $acl = null;
try { try {
$acl = $this->shareService->getCredentialAclForUser($first_vault['user_id'], $item_guid); $acl = $this->shareService->getCredentialAclForUser($first_vault['user_id'], $item_guid);
} catch (DoesNotExistException $exception) { } catch (\Exception $exception) {
// no need to catch this // no need to catch this
} }
@ -247,12 +247,12 @@ class ShareController extends ApiController {
$sr = null; $sr = null;
try { try {
$acl = $this->shareService->getCredentialAclForUser($user_id, $item_guid); $acl = $this->shareService->getCredentialAclForUser($user_id, $item_guid);
} catch (DoesNotExistException $e) { } catch (\Exception $e) {
} }
try { try {
$sr = array_pop($this->shareService->getPendingShareRequestsForCredential($item_guid, $user_id)); $sr = array_pop($this->shareService->getPendingShareRequestsForCredential($item_guid, $user_id));
} catch (DoesNotExistException $e) { } catch (\Exception $e) {
// no need to catch this // no need to catch this
} }
@ -307,7 +307,7 @@ class ShareController extends ApiController {
public function savePendingRequest($item_guid, $target_vault_guid, $final_shared_key) { public function savePendingRequest($item_guid, $target_vault_guid, $final_shared_key) {
try { try {
$sr = $this->shareService->getRequestByGuid($item_guid, $target_vault_guid); $sr = $this->shareService->getRequestByGuid($item_guid, $target_vault_guid);
} catch (DoesNotExistException $ex) { } catch (\Exception $ex) {
return new NotFoundResponse(); return new NotFoundResponse();
} }
@ -348,7 +348,7 @@ class ShareController extends ApiController {
array_push($results, $result); array_push($results, $result);
} }
return new JSONResponse($results); return new JSONResponse($results);
} catch (DoesNotExistException $ex) { } catch (\Exception $ex) {
return new NotFoundResponse(); return new NotFoundResponse();
} }
} }
@ -362,7 +362,7 @@ class ShareController extends ApiController {
public function getRevisions($item_guid) { public function getRevisions($item_guid) {
try { try {
return new JSONResponse($this->shareService->getItemHistory($this->userId, $item_guid)); return new JSONResponse($this->shareService->getItemHistory($this->userId, $item_guid));
} catch (DoesNotExistException $ex) { } catch (\Exception $ex) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }
} }
@ -378,7 +378,7 @@ class ShareController extends ApiController {
try { try {
return new JSONResponse($this->shareService->getSharedItems($this->userId->getUID(), $vault_guid)); return new JSONResponse($this->shareService->getSharedItems($this->userId->getUID(), $vault_guid));
} catch (DoesNotExistException $ex) { } catch (\Exception $ex) {
return new NotFoundResponse(); return new NotFoundResponse();
} }
} }
@ -413,7 +413,7 @@ class ShareController extends ApiController {
$this->shareService->cleanItemRequestsForUser($sr); $this->shareService->cleanItemRequestsForUser($sr);
return new JSONResponse(array('result' => true)); return new JSONResponse(array('result' => true));
} catch (DoesNotExistException $ex) { } catch (\Exception $ex) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }
} }
@ -447,7 +447,7 @@ class ShareController extends ApiController {
try { try {
$credential = $this->shareService->getSharedItem(null, $credential_guid); $credential = $this->shareService->getSharedItem(null, $credential_guid);
return new JSONResponse($credential); return new JSONResponse($credential);
} catch (DoesNotExistException $ex) { } catch (\Exception $ex) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }
} }
@ -472,7 +472,7 @@ class ShareController extends ApiController {
} else { } else {
return new NotFoundResponse(); return new NotFoundResponse();
} }
} catch (DoesNotExistException $ex) { } catch (\Exception $ex) {
return new JSONResponse(array()); return new JSONResponse(array());
} }
} }
@ -488,7 +488,7 @@ class ShareController extends ApiController {
public function getFile($item_guid, $file_guid) { public function getFile($item_guid, $file_guid) {
try { try {
$credential = $this->credentialService->getCredentialByGUID($item_guid); $credential = $this->credentialService->getCredentialByGUID($item_guid);
} catch (DoesNotExistException $e) { } catch (\Exception $e) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }
$userId = ($this->userId) ? $this->userId->getUID() : null; $userId = ($this->userId) ? $this->userId->getUID() : null;
@ -511,7 +511,7 @@ class ShareController extends ApiController {
public function updateSharedCredentialACL($item_guid, $user_id, $permission) { public function updateSharedCredentialACL($item_guid, $user_id, $permission) {
try { try {
$credential = $this->credentialService->getCredentialByGUID($item_guid); $credential = $this->credentialService->getCredentialByGUID($item_guid);
} catch (DoesNotExistException $exception) { } catch (\Exception $exception) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }
if ($this->userId->getUID() === $credential->getUserId()) { if ($this->userId->getUID() === $credential->getUserId()) {
@ -520,7 +520,7 @@ class ShareController extends ApiController {
$acl = $this->shareService->getACL($user_id, $item_guid); $acl = $this->shareService->getACL($user_id, $item_guid);
$acl->setPermissions($permission); $acl->setPermissions($permission);
return $this->shareService->updateCredentialACL($acl); return $this->shareService->updateCredentialACL($acl);
} catch (DoesNotExistException $exception) { } catch (\Exception $exception) {
} }

View file

@ -86,7 +86,7 @@ class VaultController extends ApiController {
$vault = null; $vault = null;
try { try {
$vault = $this->vaultService->getByGuid($vault_guid, $this->userId); $vault = $this->vaultService->getByGuid($vault_guid, $this->userId);
} catch (DoesNotExistException $e) { } catch (\Exception $e) {
return new NotFoundJSONResponse(); return new NotFoundJSONResponse();
} }
$result = array(); $result = array();
@ -136,7 +136,7 @@ class VaultController extends ApiController {
$vault = null; $vault = null;
try { try {
$vault = $this->vaultService->getByGuid($vault_guid, $this->userId); $vault = $this->vaultService->getByGuid($vault_guid, $this->userId);
} catch (DoesNotExistException $e) { } catch (\Exception $e) {
} }

View file

@ -20,6 +20,7 @@ OC.L10N.register(
"Decrypting credentials" : "Décryptage des informations d'identification", "Decrypting credentials" : "Décryptage des informations d'identification",
"Done" : "Fait", "Done" : "Fait",
"File read successfully!" : "Fichier lu avec succès !", "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", "Adding {{credential}}" : "{{credential}} en cours d'ajout",
"Added {{credential}}" : "{{credential}} ajouté", "Added {{credential}}" : "{{credential}} ajouté",
"Parsed {{num}} credentials, starting to import" : "{{num}} informations d'identification analysées, commence à importer", "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", "About Passman" : "À propos de Passman",
"Version" : "Version", "Version" : "Version",
"Donate to support development" : "Donner pour aider le développement", "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 !", "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.", "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", "Import type" : "Type d'importation",
@ -136,9 +138,16 @@ OC.L10N.register(
"10 / second" : "10 / seconde", "10 / second" : "10 / seconde",
"10k / second" : "10k / seconde", "10k / second" : "10k / seconde",
"10B / second" : "10B / seconde", "10B / second" : "10B / seconde",
"Dictionary name" : "Nom du dictionnaire",
"Rank" : "Rang", "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", "by" : "par",
"No revisions found." : "Pas de révision trouvée.", "No revisions found." : "Pas de révision trouvée.",
"Label" : "Étiquette",
"Restore revision" : "Restaurer la révision", "Restore revision" : "Restaurer la révision",
"Delete revision" : "Supprimer la révision", "Delete revision" : "Supprimer la révision",
"Edit credential" : "Éditer le rapport d'identification", "Edit credential" : "Éditer le rapport d'identification",
@ -146,7 +155,10 @@ OC.L10N.register(
"Save" : "Sauvegarder", "Save" : "Sauvegarder",
"Cancel" : "Annuler", "Cancel" : "Annuler",
"Settings" : "Paramètres", "Settings" : "Paramètres",
"Share credential {{credential}}" : "Partage l'information d'identification {{credential}}",
"Unshare" : "Ne plus partager", "Unshare" : "Ne plus partager",
"Showing deleted since" : "Montrer ceux supprimés depuis",
"Search credential..." : "Rechercher l'information d'identification...",
"Account" : "Compte", "Account" : "Compte",
"Password" : "Mot de passe", "Password" : "Mot de passe",
"OTP" : "OTP", "OTP" : "OTP",
@ -161,7 +173,11 @@ OC.L10N.register(
"Share" : "Partager", "Share" : "Partager",
"Recover" : "Restaurer", "Recover" : "Restaurer",
"Destroy" : "Détruire", "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", "Permissions" : "Permissions",
"Received from" : "Reçu de",
"Date" : "Date", "Date" : "Date",
"Accept" : "Accepter", "Accept" : "Accepter",
"Decline" : "Refuser", "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.", "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", "Create vault" : "Créer un coffre-fort",
"Go back to vaults" : "Retourner aux coffres-forts", "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.", "Set this vault as default." : "Choisir ce coffre-fort par défaut.",
"Login automatically to this vault." : "Se connecter automatiquement à ce coffre-fort.", "Login automatically to this vault." : "Se connecter automatiquement à ce coffre-fort.",
"Decrypt vault" : "Déchiffrer le coffre-fort", "Decrypt vault" : "Déchiffrer le coffre-fort",
@ -183,7 +200,10 @@ OC.L10N.register(
"Deleted credentials" : "Supprimer les informations d'identification", "Deleted credentials" : "Supprimer les informations d'identification",
"Logout" : "Se déconnecter", "Logout" : "Se déconnecter",
"Donate" : "Donner", "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...", "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 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 expired" : "Un élément Passman a expiré",
"A Passman item has been shared" : "Un élément Passman a été partagé", "A Passman item has been shared" : "Un élément Passman a été partagé",

View file

@ -18,6 +18,7 @@
"Decrypting credentials" : "Décryptage des informations d'identification", "Decrypting credentials" : "Décryptage des informations d'identification",
"Done" : "Fait", "Done" : "Fait",
"File read successfully!" : "Fichier lu avec succès !", "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", "Adding {{credential}}" : "{{credential}} en cours d'ajout",
"Added {{credential}}" : "{{credential}} ajouté", "Added {{credential}}" : "{{credential}} ajouté",
"Parsed {{num}} credentials, starting to import" : "{{num}} informations d'identification analysées, commence à importer", "Parsed {{num}} credentials, starting to import" : "{{num}} informations d'identification analysées, commence à importer",
@ -97,6 +98,7 @@
"About Passman" : "À propos de Passman", "About Passman" : "À propos de Passman",
"Version" : "Version", "Version" : "Version",
"Donate to support development" : "Donner pour aider le développement", "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 !", "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.", "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", "Import type" : "Type d'importation",
@ -134,9 +136,16 @@
"10 / second" : "10 / seconde", "10 / second" : "10 / seconde",
"10k / second" : "10k / seconde", "10k / second" : "10k / seconde",
"10B / second" : "10B / seconde", "10B / second" : "10B / seconde",
"Dictionary name" : "Nom du dictionnaire",
"Rank" : "Rang", "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", "by" : "par",
"No revisions found." : "Pas de révision trouvée.", "No revisions found." : "Pas de révision trouvée.",
"Label" : "Étiquette",
"Restore revision" : "Restaurer la révision", "Restore revision" : "Restaurer la révision",
"Delete revision" : "Supprimer la révision", "Delete revision" : "Supprimer la révision",
"Edit credential" : "Éditer le rapport d'identification", "Edit credential" : "Éditer le rapport d'identification",
@ -144,7 +153,10 @@
"Save" : "Sauvegarder", "Save" : "Sauvegarder",
"Cancel" : "Annuler", "Cancel" : "Annuler",
"Settings" : "Paramètres", "Settings" : "Paramètres",
"Share credential {{credential}}" : "Partage l'information d'identification {{credential}}",
"Unshare" : "Ne plus partager", "Unshare" : "Ne plus partager",
"Showing deleted since" : "Montrer ceux supprimés depuis",
"Search credential..." : "Rechercher l'information d'identification...",
"Account" : "Compte", "Account" : "Compte",
"Password" : "Mot de passe", "Password" : "Mot de passe",
"OTP" : "OTP", "OTP" : "OTP",
@ -159,7 +171,11 @@
"Share" : "Partager", "Share" : "Partager",
"Recover" : "Restaurer", "Recover" : "Restaurer",
"Destroy" : "Détruire", "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", "Permissions" : "Permissions",
"Received from" : "Reçu de",
"Date" : "Date", "Date" : "Date",
"Accept" : "Accepter", "Accept" : "Accepter",
"Decline" : "Refuser", "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.", "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", "Create vault" : "Créer un coffre-fort",
"Go back to vaults" : "Retourner aux coffres-forts", "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.", "Set this vault as default." : "Choisir ce coffre-fort par défaut.",
"Login automatically to this vault." : "Se connecter automatiquement à ce coffre-fort.", "Login automatically to this vault." : "Se connecter automatiquement à ce coffre-fort.",
"Decrypt vault" : "Déchiffrer le coffre-fort", "Decrypt vault" : "Déchiffrer le coffre-fort",
@ -181,7 +198,10 @@
"Deleted credentials" : "Supprimer les informations d'identification", "Deleted credentials" : "Supprimer les informations d'identification",
"Logout" : "Se déconnecter", "Logout" : "Se déconnecter",
"Donate" : "Donner", "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...", "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 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 expired" : "Un élément Passman a expiré",
"A Passman item has been shared" : "Un élément Passman a été partagé", "A Passman item has been shared" : "Un élément Passman a été partagé",

View file

@ -131,7 +131,9 @@ class CredentialMapper extends Mapper {
$credential->setCustomFields($raw_credential['custom_fields']); $credential->setCustomFields($raw_credential['custom_fields']);
$credential->setOtp($raw_credential['otp']); $credential->setOtp($raw_credential['otp']);
$credential->setHidden($raw_credential['hidden']); $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); return parent::insert($credential);
} }

View file

@ -52,7 +52,7 @@ if ($checkVersion) {
<p> <p>
<input type="checkbox" name="passman_sharing_enabled" <input type="checkbox" name="passman_sharing_enabled"
id="passman_sharing_enabled" class="checkbox" id="passman_sharing_enabled" class="checkbox"
value="1" <?php if ($_['user_sharing_enabled']) print_unescaped('checked="checked"'); ?> /> value="1" />
<label for="passman_sharing_enabled"> <label for="passman_sharing_enabled">
<?php p($l->t('Allow users on this server to share passwords with other users')); ?> <?php p($l->t('Allow users on this server to share passwords with other users')); ?>
</label> </label>