diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-06-26 14:51:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-26 14:51:00 +0200 |
commit | db6361ef0314868edc9d58a81c0806c8c758af0a (patch) | |
tree | a2c168943d0e15a2d28febf82e31e74b15504117 /apps | |
parent | 03449dcb9a56e642ff4eee31145498bbaeb83319 (diff) | |
parent | 7a9d60d87eb8e4414e5fe05830b088d426ff810d (diff) | |
download | nextcloud-server-db6361ef0314868edc9d58a81c0806c8c758af0a.tar.gz nextcloud-server-db6361ef0314868edc9d58a81c0806c8c758af0a.zip |
Merge pull request #226 from nextcloud/master-upstream-sync
[Master] upstream sync
Diffstat (limited to 'apps')
74 files changed, 1087 insertions, 86 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 9475dc53fc0..f71567f04d1 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -337,10 +337,10 @@ $comment.data('commentEl').remove(); $comment.remove(); }, - error: function(msg) { + error: function() { $loading.addClass('hidden'); $comment.removeClass('disabled'); - OC.Notification.showTemporary(msg); + OC.Notification.showTemporary(t('comments', 'Error occurred while retrieving comment with id {id}', {id: commentId})); } }); @@ -388,12 +388,12 @@ .html(self._formatMessage(model.get('message'))); $row.remove(); }, - error: function(msg) { + error: function() { $submit.removeClass('hidden'); $loading.addClass('hidden'); $textArea.prop('disabled', false); - OC.Notification.showTemporary(msg); + OC.Notification.showTemporary(t('comments', 'Error occurred while updating comment with id {id}', {id: commentId})); } }); } else { @@ -413,12 +413,12 @@ $loading.addClass('hidden'); $textArea.val('').prop('disabled', false); }, - error: function(msg) { + error: function() { $submit.removeClass('hidden'); $loading.addClass('hidden'); $textArea.prop('disabled', false); - OC.Notification.showTemporary(msg); + OC.Notification.showTemporary(t('comments', 'Error occurred while posting comment')); } }); } diff --git a/apps/comments/l10n/bg_BG.js b/apps/comments/l10n/bg_BG.js index c5fbba69f7b..ca60bb48bf6 100644 --- a/apps/comments/l10n/bg_BG.js +++ b/apps/comments/l10n/bg_BG.js @@ -3,6 +3,7 @@ OC.L10N.register( { "Type in a new comment..." : "Напиши нов коментар...", "Delete comment" : "Изтрий коментар", + "Post" : "Публикация", "Cancel" : "Отказ", "Edit comment" : "Редактирай коментра", "[Deleted user]" : "[Изтрит потребител]", diff --git a/apps/comments/l10n/bg_BG.json b/apps/comments/l10n/bg_BG.json index 64f516861ca..2b79857f6bb 100644 --- a/apps/comments/l10n/bg_BG.json +++ b/apps/comments/l10n/bg_BG.json @@ -1,6 +1,7 @@ { "translations": { "Type in a new comment..." : "Напиши нов коментар...", "Delete comment" : "Изтрий коментар", + "Post" : "Публикация", "Cancel" : "Отказ", "Edit comment" : "Редактирай коментра", "[Deleted user]" : "[Изтрит потребител]", diff --git a/apps/comments/l10n/cs_CZ.js b/apps/comments/l10n/cs_CZ.js index d41b0f99f42..0653209616c 100644 --- a/apps/comments/l10n/cs_CZ.js +++ b/apps/comments/l10n/cs_CZ.js @@ -12,6 +12,9 @@ OC.L10N.register( "More comments..." : "Více komentářů...", "Save" : "Uložit", "Allowed characters {count} of {max}" : "Povolených znaků {count} z {max}", + "Error occurred while retrieving comment with id {id}" : "Došlo k chybě při načítání komentáře s id {id}", + "Error occurred while updating comment with id {id}" : "Došlo k chybě při aktualizování komentáře s id {id}", + "Error occurred while posting comment" : "Došlo k chybě při zveřejňování komentáře", "{count} unread comments" : "{count} nepřečtených komentářů", "Comment" : "Komentář", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Komentáře</strong> pro soubory <em>(vždy uvedeny v proudu)</em>", diff --git a/apps/comments/l10n/cs_CZ.json b/apps/comments/l10n/cs_CZ.json index c695e50c646..efdd227bfb7 100644 --- a/apps/comments/l10n/cs_CZ.json +++ b/apps/comments/l10n/cs_CZ.json @@ -10,6 +10,9 @@ "More comments..." : "Více komentářů...", "Save" : "Uložit", "Allowed characters {count} of {max}" : "Povolených znaků {count} z {max}", + "Error occurred while retrieving comment with id {id}" : "Došlo k chybě při načítání komentáře s id {id}", + "Error occurred while updating comment with id {id}" : "Došlo k chybě při aktualizování komentáře s id {id}", + "Error occurred while posting comment" : "Došlo k chybě při zveřejňování komentáře", "{count} unread comments" : "{count} nepřečtených komentářů", "Comment" : "Komentář", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Komentáře</strong> pro soubory <em>(vždy uvedeny v proudu)</em>", diff --git a/apps/comments/l10n/de.js b/apps/comments/l10n/de.js index ebf473c6b9c..b46dcb20905 100644 --- a/apps/comments/l10n/de.js +++ b/apps/comments/l10n/de.js @@ -12,6 +12,9 @@ OC.L10N.register( "More comments..." : "Weitere Kommentare...", "Save" : "Speichern", "Allowed characters {count} of {max}" : "Erlaubte Zeichen {count} von {max}", + "Error occurred while retrieving comment with id {id}" : "Es ist ein Fehler beim Empfangen des Kommentars mit der ID {id} aufgetreten", + "Error occurred while updating comment with id {id}" : "Es ist ein Fehler beim Aktualisieren des Kommentars mit der ID {id} aufgetreten", + "Error occurred while posting comment" : "Es ist ein Fehler beim Veröffentlichen des Kommentars aufgetreten", "{count} unread comments" : "{count} ungelesene Kommentare", "Comment" : "Kommentar", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Kommentare</strong> für Dateien<em>(immer im Stream aufgelistet)</em>", diff --git a/apps/comments/l10n/de.json b/apps/comments/l10n/de.json index 0e4bc1b53bd..ff7d59cf5c5 100644 --- a/apps/comments/l10n/de.json +++ b/apps/comments/l10n/de.json @@ -10,6 +10,9 @@ "More comments..." : "Weitere Kommentare...", "Save" : "Speichern", "Allowed characters {count} of {max}" : "Erlaubte Zeichen {count} von {max}", + "Error occurred while retrieving comment with id {id}" : "Es ist ein Fehler beim Empfangen des Kommentars mit der ID {id} aufgetreten", + "Error occurred while updating comment with id {id}" : "Es ist ein Fehler beim Aktualisieren des Kommentars mit der ID {id} aufgetreten", + "Error occurred while posting comment" : "Es ist ein Fehler beim Veröffentlichen des Kommentars aufgetreten", "{count} unread comments" : "{count} ungelesene Kommentare", "Comment" : "Kommentar", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Kommentare</strong> für Dateien<em>(immer im Stream aufgelistet)</em>", diff --git a/apps/comments/l10n/de_DE.js b/apps/comments/l10n/de_DE.js index 74e129e0a29..7330b6ab068 100644 --- a/apps/comments/l10n/de_DE.js +++ b/apps/comments/l10n/de_DE.js @@ -12,6 +12,9 @@ OC.L10N.register( "More comments..." : "Weitere Kommentare...", "Save" : "Speichern", "Allowed characters {count} of {max}" : "{count} von {max} Zeichen benutzt", + "Error occurred while retrieving comment with id {id}" : "Es ist ein Fehler beim Empfangen des Kommentars mit der ID {id} aufgetreten", + "Error occurred while updating comment with id {id}" : "Es ist ein Fehler beim Aktualisieren des Kommentars mit der ID {id} aufgetreten", + "Error occurred while posting comment" : "Es ist ein Fehler beim Veröffentlichen des Kommentars aufgetreten", "{count} unread comments" : "[count] ungelesene Kommentare", "Comment" : "Kommentar", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Kommentare</strong> für Dateien<em>(immer im Stream aufgelistet)</em>", diff --git a/apps/comments/l10n/de_DE.json b/apps/comments/l10n/de_DE.json index 6c18cf15fc1..611521dc907 100644 --- a/apps/comments/l10n/de_DE.json +++ b/apps/comments/l10n/de_DE.json @@ -10,6 +10,9 @@ "More comments..." : "Weitere Kommentare...", "Save" : "Speichern", "Allowed characters {count} of {max}" : "{count} von {max} Zeichen benutzt", + "Error occurred while retrieving comment with id {id}" : "Es ist ein Fehler beim Empfangen des Kommentars mit der ID {id} aufgetreten", + "Error occurred while updating comment with id {id}" : "Es ist ein Fehler beim Aktualisieren des Kommentars mit der ID {id} aufgetreten", + "Error occurred while posting comment" : "Es ist ein Fehler beim Veröffentlichen des Kommentars aufgetreten", "{count} unread comments" : "[count] ungelesene Kommentare", "Comment" : "Kommentar", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Kommentare</strong> für Dateien<em>(immer im Stream aufgelistet)</em>", diff --git a/apps/comments/l10n/he.js b/apps/comments/l10n/he.js index 02168b4f8ec..e7b2454b1c4 100644 --- a/apps/comments/l10n/he.js +++ b/apps/comments/l10n/he.js @@ -12,6 +12,9 @@ OC.L10N.register( "More comments..." : "תגובות נוספות...", "Save" : "שמירה", "Allowed characters {count} of {max}" : "תווים מותרים {count} מתוך {max}", + "Error occurred while retrieving comment with id {id}" : "שגיאה אירעה כאשר אוחזרה תגובה עם מספר זיהוי {id}", + "Error occurred while updating comment with id {id}" : "שגיאה אירעה כאשר עודכנה תגובה עם מספר זיהוי {id}", + "Error occurred while posting comment" : "אירעה שגיאה בזמן פרסום תגובה", "{count} unread comments" : "{count} תגובות שלא נקראו", "Comment" : "תגובה", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>תגובות</strong> עבור קבצים <em>(תמיד נרשמים בהזרמת מדיה)</em>", diff --git a/apps/comments/l10n/he.json b/apps/comments/l10n/he.json index 66ac46ce2d6..075e86f9672 100644 --- a/apps/comments/l10n/he.json +++ b/apps/comments/l10n/he.json @@ -10,6 +10,9 @@ "More comments..." : "תגובות נוספות...", "Save" : "שמירה", "Allowed characters {count} of {max}" : "תווים מותרים {count} מתוך {max}", + "Error occurred while retrieving comment with id {id}" : "שגיאה אירעה כאשר אוחזרה תגובה עם מספר זיהוי {id}", + "Error occurred while updating comment with id {id}" : "שגיאה אירעה כאשר עודכנה תגובה עם מספר זיהוי {id}", + "Error occurred while posting comment" : "אירעה שגיאה בזמן פרסום תגובה", "{count} unread comments" : "{count} תגובות שלא נקראו", "Comment" : "תגובה", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>תגובות</strong> עבור קבצים <em>(תמיד נרשמים בהזרמת מדיה)</em>", diff --git a/apps/comments/l10n/it.js b/apps/comments/l10n/it.js index 27844003c03..ce98270c06d 100644 --- a/apps/comments/l10n/it.js +++ b/apps/comments/l10n/it.js @@ -12,6 +12,9 @@ OC.L10N.register( "More comments..." : "Altri commenti...", "Save" : "Salva", "Allowed characters {count} of {max}" : "Caratteri consentiti {count} di {max}", + "Error occurred while retrieving comment with id {id}" : "Si è verificato un errore durante il tentativo di recupero del commento con id {id}", + "Error occurred while updating comment with id {id}" : "Si è verificato un errore durante il tentativo di aggiornamento del commento con id {id}", + "Error occurred while posting comment" : "Si è verificato un errore durante la pubblicazione del commento.", "{count} unread comments" : "{count} commenti non letti", "Comment" : "Commento", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Commenti</strong> sui file <em>(elencati sempre nel flusso)</em>", diff --git a/apps/comments/l10n/it.json b/apps/comments/l10n/it.json index 73605cd6f03..50b8aa17698 100644 --- a/apps/comments/l10n/it.json +++ b/apps/comments/l10n/it.json @@ -10,6 +10,9 @@ "More comments..." : "Altri commenti...", "Save" : "Salva", "Allowed characters {count} of {max}" : "Caratteri consentiti {count} di {max}", + "Error occurred while retrieving comment with id {id}" : "Si è verificato un errore durante il tentativo di recupero del commento con id {id}", + "Error occurred while updating comment with id {id}" : "Si è verificato un errore durante il tentativo di aggiornamento del commento con id {id}", + "Error occurred while posting comment" : "Si è verificato un errore durante la pubblicazione del commento.", "{count} unread comments" : "{count} commenti non letti", "Comment" : "Commento", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Commenti</strong> sui file <em>(elencati sempre nel flusso)</em>", diff --git a/apps/comments/l10n/lb.js b/apps/comments/l10n/lb.js index f63640ac6f7..d7f8c5884ac 100644 --- a/apps/comments/l10n/lb.js +++ b/apps/comments/l10n/lb.js @@ -2,6 +2,7 @@ OC.L10N.register( "comments", { "Cancel" : "Ofbriechen", - "Save" : "Späicheren" + "Save" : "Späicheren", + "Comment" : "Kommentar" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/comments/l10n/lb.json b/apps/comments/l10n/lb.json index c015c4dd2a8..bfa307a7e8d 100644 --- a/apps/comments/l10n/lb.json +++ b/apps/comments/l10n/lb.json @@ -1,5 +1,6 @@ { "translations": { "Cancel" : "Ofbriechen", - "Save" : "Späicheren" + "Save" : "Späicheren", + "Comment" : "Kommentar" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/comments/l10n/sq.js b/apps/comments/l10n/sq.js index 0f0366d87f6..1cc9966f1d7 100644 --- a/apps/comments/l10n/sq.js +++ b/apps/comments/l10n/sq.js @@ -12,6 +12,9 @@ OC.L10N.register( "More comments..." : "Më tepër komente…", "Save" : "Ruaje", "Allowed characters {count} of {max}" : "Shenja të lejuara {count} nga {max}", + "Error occurred while retrieving comment with id {id}" : "Ndodhi një gabim teksa merrej komenti me id{id}", + "Error occurred while updating comment with id {id}" : "Ndodhi një gabim teksa përditësohej komenti me id{id}", + "Error occurred while posting comment" : "Ndodhi një gabim teksa postohej komenti", "{count} unread comments" : "{count} komente të palexuar", "Comment" : "Koment", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Komente</strong> për kartela <em>(përherë të pranishme në rrjedhë)</em>", diff --git a/apps/comments/l10n/sq.json b/apps/comments/l10n/sq.json index e4fdcbaeb52..71f01a27223 100644 --- a/apps/comments/l10n/sq.json +++ b/apps/comments/l10n/sq.json @@ -10,6 +10,9 @@ "More comments..." : "Më tepër komente…", "Save" : "Ruaje", "Allowed characters {count} of {max}" : "Shenja të lejuara {count} nga {max}", + "Error occurred while retrieving comment with id {id}" : "Ndodhi një gabim teksa merrej komenti me id{id}", + "Error occurred while updating comment with id {id}" : "Ndodhi një gabim teksa përditësohej komenti me id{id}", + "Error occurred while posting comment" : "Ndodhi një gabim teksa postohej komenti", "{count} unread comments" : "{count} komente të palexuar", "Comment" : "Koment", "<strong>Comments</strong> for files <em>(always listed in stream)</em>" : "<strong>Komente</strong> për kartela <em>(përherë të pranishme në rrjedhë)</em>", diff --git a/apps/dav/appinfo/v1/carddav.php b/apps/dav/appinfo/v1/carddav.php index 88582d64ee5..fc7aff4a63c 100644 --- a/apps/dav/appinfo/v1/carddav.php +++ b/apps/dav/appinfo/v1/carddav.php @@ -75,6 +75,7 @@ if ($debugging) { } $server->addPlugin(new \Sabre\CardDAV\VCFExportPlugin()); +$server->addPlugin(new \OCA\DAV\CardDAV\ImageExportPlugin(\OC::$server->getLogger())); $server->addPlugin(new ExceptionLoggerPlugin('carddav', \OC::$server->getLogger())); // And off we go! diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php index de2056ebc35..b7b24ba7632 100644 --- a/apps/dav/lib/AppInfo/Application.php +++ b/apps/dav/lib/AppInfo/Application.php @@ -136,7 +136,8 @@ class Application extends App { public function setupContactsProvider(IManager $contactsManager, $userID) { /** @var ContactsManager $cm */ $cm = $this->getContainer()->query('ContactsManager'); - $cm->setupContactsProvider($contactsManager, $userID); + $urlGenerator = $this->getContainer()->getServer()->getURLGenerator(); + $cm->setupContactsProvider($contactsManager, $userID, $urlGenerator); } public function registerHooks() { diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index 310be695185..b26f81766c6 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -24,6 +24,7 @@ namespace OCA\DAV\CardDAV; use OCP\Constants; use OCP\IAddressBook; +use OCP\IURLGenerator; use Sabre\VObject\Component\VCard; use Sabre\VObject\Property\Text; use Sabre\VObject\Reader; @@ -40,21 +41,27 @@ class AddressBookImpl implements IAddressBook { /** @var AddressBook */ private $addressBook; + /** @var IURLGenerator */ + private $urlGenerator; + /** * AddressBookImpl constructor. * * @param AddressBook $addressBook * @param array $addressBookInfo * @param CardDavBackend $backend + * @param IUrlGenerator $urlGenerator */ public function __construct( AddressBook $addressBook, array $addressBookInfo, - CardDavBackend $backend) { + CardDavBackend $backend, + IURLGenerator $urlGenerator) { $this->addressBook = $addressBook; $this->addressBookInfo = $addressBookInfo; $this->backend = $backend; + $this->urlGenerator = $urlGenerator; } /** @@ -83,11 +90,11 @@ class AddressBookImpl implements IAddressBook { * @since 5.0.0 */ public function search($pattern, $searchProperties, $options) { - $result = $this->backend->search($this->getKey(), $pattern, $searchProperties); + $results = $this->backend->search($this->getKey(), $pattern, $searchProperties); $vCards = []; - foreach ($result as $cardData) { - $vCards[] = $this->vCard2Array($this->readCard($cardData)); + foreach ($results as $result) { + $vCards[] = $this->vCard2Array($result['uri'], $this->readCard($result['carddata'])); } return $vCards; @@ -100,13 +107,12 @@ class AddressBookImpl implements IAddressBook { */ public function createOrUpdate($properties) { $update = false; - if (!isset($properties['UID'])) { // create a new contact + if (!isset($properties['URI'])) { // create a new contact $uid = $this->createUid(); $uri = $uid . '.vcf'; $vCard = $this->createEmptyVCard($uid); } else { // update existing contact - $uid = $properties['UID']; - $uri = $uid . '.vcf'; + $uri = $properties['URI']; $vCardData = $this->backend->getCard($this->getKey(), $uri); $vCard = $this->readCard($vCardData['carddata']); $update = true; @@ -122,7 +128,7 @@ class AddressBookImpl implements IAddressBook { $this->backend->createCard($this->getKey(), $uri, $vCard->serialize()); } - return $this->vCard2Array($vCard); + return $this->vCard2Array($uri, $vCard); } @@ -207,13 +213,31 @@ class AddressBookImpl implements IAddressBook { /** * create array with all vCard properties * + * @param string $uri * @param VCard $vCard * @return array */ - protected function vCard2Array(VCard $vCard) { - $result = []; + protected function vCard2Array($uri, VCard $vCard) { + $result = [ + 'URI' => $uri, + ]; + foreach ($vCard->children as $property) { $result[$property->name] = $property->getValue(); + if ($property->name === 'PHOTO' && $property->getValueType() === 'BINARY') { + $url = $this->urlGenerator->getAbsoluteURL( + $this->urlGenerator->linkTo('', 'remote.php') . '/dav/'); + $url .= implode('/', [ + 'addressbooks', + substr($this->addressBookInfo['principaluri'], 11), //cut off 'principals/' + $this->addressBookInfo['uri'], + $uri + ]) . '?photo'; + + $result['PHOTO'] = 'VALUE=uri:' . $url; + } else { + $result[$property->name] = $property->getValue(); + } } if ($this->addressBookInfo['principaluri'] === 'principals/system/system' && $this->addressBookInfo['uri'] === 'system') { diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 3d2904df39c..2ad9f4778c9 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -780,7 +780,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { } $query2->andWhere($query2->expr()->eq('cp.addressbookid', $query->createNamedParameter($addressBookId))); - $query->select('c.carddata')->from($this->dbCardsTable, 'c') + $query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c') ->where($query->expr()->in('c.id', $query->createFunction($query2->getSQL()))); $result = $query->execute(); @@ -788,8 +788,10 @@ class CardDavBackend implements BackendInterface, SyncSupport { $result->closeCursor(); - return array_map(function($array) {return $this->readBlob($array['carddata']);}, $cards); - + return array_map(function($array) { + $array['carddata'] = $this->readBlob($array['carddata']); + return $array; + }, $cards); } /** diff --git a/apps/dav/lib/CardDAV/ContactsManager.php b/apps/dav/lib/CardDAV/ContactsManager.php index 7900c6ccae0..ad633483fdd 100644 --- a/apps/dav/lib/CardDAV/ContactsManager.php +++ b/apps/dav/lib/CardDAV/ContactsManager.php @@ -22,6 +22,7 @@ namespace OCA\DAV\CardDAV; use OCP\Contacts\IManager; +use OCP\IURLGenerator; class ContactsManager { @@ -37,26 +38,29 @@ class ContactsManager { /** * @param IManager $cm * @param string $userId + * @param IURLGenerator $urlGenerator */ - public function setupContactsProvider(IManager $cm, $userId) { + public function setupContactsProvider(IManager $cm, $userId, IURLGenerator $urlGenerator) { $addressBooks = $this->backend->getAddressBooksForUser("principals/users/$userId"); - $this->register($cm, $addressBooks); + $this->register($cm, $addressBooks, $urlGenerator); $addressBooks = $this->backend->getAddressBooksForUser("principals/system/system"); - $this->register($cm, $addressBooks); + $this->register($cm, $addressBooks, $urlGenerator); } /** * @param IManager $cm * @param $addressBooks + * @param IURLGenerator $urlGenerator */ - private function register(IManager $cm, $addressBooks) { + private function register(IManager $cm, $addressBooks, $urlGenerator) { foreach ($addressBooks as $addressBookInfo) { $addressBook = new \OCA\DAV\CardDAV\AddressBook($this->backend, $addressBookInfo); $cm->registerAddressBook( new AddressBookImpl( $addressBook, $addressBookInfo, - $this->backend + $this->backend, + $urlGenerator ) ); } diff --git a/apps/dav/lib/CardDAV/ImageExportPlugin.php b/apps/dav/lib/CardDAV/ImageExportPlugin.php new file mode 100644 index 00000000000..3f505222491 --- /dev/null +++ b/apps/dav/lib/CardDAV/ImageExportPlugin.php @@ -0,0 +1,146 @@ +<?php +/** + * @author Thomas Müller <thomas.mueller@tmit.eu> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * 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, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCA\DAV\CardDAV; + +use OCP\ILogger; +use Sabre\CardDAV\Card; +use Sabre\DAV\Server; +use Sabre\DAV\ServerPlugin; +use Sabre\HTTP\RequestInterface; +use Sabre\HTTP\ResponseInterface; +use Sabre\VObject\Parameter; +use Sabre\VObject\Property\Binary; +use Sabre\VObject\Reader; + +class ImageExportPlugin extends ServerPlugin { + + /** @var Server */ + protected $server; + /** @var ILogger */ + private $logger; + + public function __construct(ILogger $logger) { + $this->logger = $logger; + } + + /** + * Initializes the plugin and registers event handlers + * + * @param Server $server + * @return void + */ + function initialize(Server $server) { + + $this->server = $server; + $this->server->on('method:GET', [$this, 'httpGet'], 90); + } + + /** + * Intercepts GET requests on addressbook urls ending with ?photo. + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @return bool|void + */ + function httpGet(RequestInterface $request, ResponseInterface $response) { + + $queryParams = $request->getQueryParameters(); + // TODO: in addition to photo we should also add logo some point in time + if (!array_key_exists('photo', $queryParams)) { + return true; + } + + $path = $request->getPath(); + $node = $this->server->tree->getNodeForPath($path); + + if (!($node instanceof Card)) { + return true; + } + + $this->server->transactionType = 'carddav-image-export'; + + // Checking ACL, if available. + if ($aclPlugin = $this->server->getPlugin('acl')) { + /** @var \Sabre\DAVACL\Plugin $aclPlugin */ + $aclPlugin->checkPrivileges($path, '{DAV:}read'); + } + + if ($result = $this->getPhoto($node)) { + $response->setHeader('Content-Type', $result['Content-Type']); + $response->setStatus(200); + + $response->setBody($result['body']); + + // Returning false to break the event chain + return false; + } + return true; + } + + function getPhoto(Card $node) { + // TODO: this is kind of expensive - load carddav data from database and parse it + // we might want to build up a cache one day + try { + $vObject = $this->readCard($node->get()); + if (!$vObject->PHOTO) { + return false; + } + + $photo = $vObject->PHOTO; + $type = $this->getType($photo); + + $valType = $photo->getValueType(); + $val = ($valType === 'URI' ? $photo->getRawMimeDirValue() : $photo->getValue()); + return [ + 'Content-Type' => $type, + 'body' => $val + ]; + } catch(\Exception $ex) { + $this->logger->logException($ex); + } + return false; + } + + private function readCard($cardData) { + return Reader::read($cardData); + } + + /** + * @param Binary $photo + * @return Parameter + */ + private function getType($photo) { + $params = $photo->parameters(); + if (isset($params['TYPE']) || isset($params['MEDIATYPE'])) { + /** @var Parameter $typeParam */ + $typeParam = isset($params['TYPE']) ? $params['TYPE'] : $params['MEDIATYPE']; + $type = $typeParam->getValue(); + + if (strpos($type, 'image/') === 0) { + return $type; + } else { + return 'image/' . strtolower($type); + } + } + return ''; + } +} diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index edf46d210fc..5c22f8a8a71 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -185,7 +185,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { $msg = 'Message exceeds allowed character limit of '; throw new BadRequest($msg . IComment::MAX_MESSAGE_LENGTH, 0, $e); } - return false; + throw $e; } } diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index e150f441b82..7fa1b13783b 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -25,6 +25,7 @@ namespace OCA\DAV; use OCA\DAV\CalDAV\Schedule\IMipPlugin; +use OCA\DAV\CardDAV\ImageExportPlugin; use OCA\DAV\Connector\Sabre\Auth; use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin; use OCA\DAV\Connector\Sabre\DavAclPlugin; @@ -103,6 +104,7 @@ class Server { // addressbook plugins $this->server->addPlugin(new \OCA\DAV\CardDAV\Plugin()); $this->server->addPlugin(new VCFExportPlugin()); + $this->server->addPlugin(new ImageExportPlugin(\OC::$server->getLogger())); // system tags plugins $this->server->addPlugin(new \OCA\DAV\SystemTag\SystemTagPlugin( diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index ddfec3dc3ac..4ccc841157f 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -43,6 +43,9 @@ class AddressBookImplTest extends TestCase { /** @var AddressBook | \PHPUnit_Framework_MockObject_MockObject */ private $addressBook; + /** @var \OCP\IURLGenerator | \PHPUnit_Framework_MockObject_MockObject */ + private $urlGenerator; + /** @var CardDavBackend | \PHPUnit_Framework_MockObject_MockObject */ private $backend; @@ -61,11 +64,13 @@ class AddressBookImplTest extends TestCase { $this->backend = $this->getMockBuilder('\OCA\DAV\CardDAV\CardDavBackend') ->disableOriginalConstructor()->getMock(); $this->vCard = $this->getMock('Sabre\VObject\Component\VCard'); + $this->urlGenerator = $this->getMock('OCP\IURLGenerator'); $this->addressBookImpl = new AddressBookImpl( $this->addressBook, $this->addressBookInfo, - $this->backend + $this->backend, + $this->urlGenerator ); } @@ -87,7 +92,8 @@ class AddressBookImplTest extends TestCase { [ $this->addressBook, $this->addressBookInfo, - $this->backend + $this->backend, + $this->urlGenerator, ] ) ->setMethods(['vCard2Array', 'readCard']) @@ -100,15 +106,18 @@ class AddressBookImplTest extends TestCase { ->with($this->addressBookInfo['id'], $pattern, $searchProperties) ->willReturn( [ - 'cardData1', - 'cardData2' + ['uri' => 'foo.vcf', 'carddata' => 'cardData1'], + ['uri' => 'bar.vcf', 'carddata' => 'cardData2'] ] ); $addressBookImpl->expects($this->exactly(2))->method('readCard') ->willReturn($this->vCard); $addressBookImpl->expects($this->exactly(2))->method('vCard2Array') - ->with($this->vCard)->willReturn('vCard'); + ->withConsecutive( + ['foo.vcf', $this->vCard], + ['bar.vcf', $this->vCard] + )->willReturn('vCard'); $result = $addressBookImpl->search($pattern, $searchProperties, []); $this->assertTrue((is_array($result))); @@ -130,7 +139,8 @@ class AddressBookImplTest extends TestCase { [ $this->addressBook, $this->addressBookInfo, - $this->backend + $this->backend, + $this->urlGenerator, ] ) ->setMethods(['vCard2Array', 'createUid', 'createEmptyVCard']) @@ -146,7 +156,7 @@ class AddressBookImplTest extends TestCase { $this->backend->expects($this->never())->method('updateCard'); $this->backend->expects($this->never())->method('getCard'); $addressBookImpl->expects($this->once())->method('vCard2Array') - ->with($this->vCard)->willReturn(true); + ->with('uid.vcf', $this->vCard)->willReturn(true); $this->assertTrue($addressBookImpl->createOrUpdate($properties)); } @@ -161,7 +171,8 @@ class AddressBookImplTest extends TestCase { public function testUpdate() { $uid = 'uid'; - $properties = ['UID' => $uid, 'FN' => 'John Doe']; + $uri = 'bla.vcf'; + $properties = ['URI' => $uri, 'UID' => $uid, 'FN' => 'John Doe']; /** @var \PHPUnit_Framework_MockObject_MockObject | AddressBookImpl $addressBookImpl */ $addressBookImpl = $this->getMockBuilder('OCA\DAV\CardDAV\AddressBookImpl') @@ -169,7 +180,8 @@ class AddressBookImplTest extends TestCase { [ $this->addressBook, $this->addressBookInfo, - $this->backend + $this->backend, + $this->urlGenerator, ] ) ->setMethods(['vCard2Array', 'createUid', 'createEmptyVCard', 'readCard']) @@ -178,7 +190,7 @@ class AddressBookImplTest extends TestCase { $addressBookImpl->expects($this->never())->method('createUid'); $addressBookImpl->expects($this->never())->method('createEmptyVCard'); $this->backend->expects($this->once())->method('getCard') - ->with($this->addressBookInfo['id'], $uid . '.vcf') + ->with($this->addressBookInfo['id'], $uri) ->willReturn(['carddata' => 'data']); $addressBookImpl->expects($this->once())->method('readCard') ->with('data')->willReturn($this->vCard); @@ -187,7 +199,7 @@ class AddressBookImplTest extends TestCase { $this->backend->expects($this->never())->method('createCard'); $this->backend->expects($this->once())->method('updateCard'); $addressBookImpl->expects($this->once())->method('vCard2Array') - ->with($this->vCard)->willReturn(true); + ->with($uri, $this->vCard)->willReturn(true); $this->assertTrue($addressBookImpl->createOrUpdate($properties)); } @@ -251,7 +263,8 @@ class AddressBookImplTest extends TestCase { [ $this->addressBook, $this->addressBookInfo, - $this->backend + $this->backend, + $this->urlGenerator, ] ) ->setMethods(['getUid']) diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index c7cd4a30052..58a93befe68 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -535,8 +535,8 @@ class CardDavBackendTest extends TestCase { $found = []; foreach ($result as $r) { foreach ($expected as $exp) { - if (strpos($r, $exp) > 0) { - $found[$exp] = true; + if ($r['uri'] === $exp[0] && strpos($r['carddata'], $exp[1]) > 0) { + $found[$exp[1]] = true; break; } } @@ -547,11 +547,11 @@ class CardDavBackendTest extends TestCase { public function dataTestSearch() { return [ - ['John', ['FN'], ['John Doe', 'John M. Doe']], - ['M. Doe', ['FN'], ['John M. Doe']], - ['Do', ['FN'], ['John Doe', 'John M. Doe']], - 'check if duplicates are handled correctly' => ['John', ['FN', 'CLOUD'], ['John Doe', 'John M. Doe']], - 'case insensitive' => ['john', ['FN'], ['John Doe', 'John M. Doe']] + ['John', ['FN'], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], + ['M. Doe', ['FN'], [['uri1', 'John M. Doe']]], + ['Do', ['FN'], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], + 'check if duplicates are handled correctly' => ['John', ['FN', 'CLOUD'], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], + 'case insensitive' => ['john', ['FN'], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]] ]; } diff --git a/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php b/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php index 2abd9da66e7..23a49a1962f 100644 --- a/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php +++ b/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php @@ -32,6 +32,7 @@ class ContactsManagerTest extends TestCase { /** @var IManager | \PHPUnit_Framework_MockObject_MockObject $cm */ $cm = $this->getMockBuilder('OCP\Contacts\IManager')->disableOriginalConstructor()->getMock(); $cm->expects($this->exactly(2))->method('registerAddressBook'); + $urlGenerator = $this->getMockBuilder('OCP\IUrlGenerator')->disableOriginalConstructor()->getMock(); /** @var CardDavBackend | \PHPUnit_Framework_MockObject_MockObject $backEnd */ $backEnd = $this->getMockBuilder('OCA\DAV\CardDAV\CardDavBackend')->disableOriginalConstructor()->getMock(); $backEnd->method('getAddressBooksForUser')->willReturn([ @@ -39,6 +40,6 @@ class ContactsManagerTest extends TestCase { ]); $app = new ContactsManager($backEnd); - $app->setupContactsProvider($cm, 'user01'); + $app->setupContactsProvider($cm, 'user01', $urlGenerator); } } diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php new file mode 100644 index 00000000000..8583df0b6f9 --- /dev/null +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -0,0 +1,151 @@ +<?php +/** + * @author Thomas Müller <thomas.mueller@tmit.eu> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * 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, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + + +namespace OCA\DAV\Tests\unit\CardDAV; + + +use OCA\DAV\CardDAV\ImageExportPlugin; +use OCP\ILogger; +use Sabre\CardDAV\Card; +use Sabre\DAV\Server; +use Sabre\DAV\Tree; +use Sabre\HTTP\RequestInterface; +use Sabre\HTTP\ResponseInterface; +use Test\TestCase; + +class ImageExportPluginTest extends TestCase { + + /** @var ResponseInterface | \PHPUnit_Framework_MockObject_MockObject */ + private $response; + /** @var RequestInterface | \PHPUnit_Framework_MockObject_MockObject */ + private $request; + /** @var ImageExportPlugin | \PHPUnit_Framework_MockObject_MockObject */ + private $plugin; + /** @var Server */ + private $server; + /** @var Tree | \PHPUnit_Framework_MockObject_MockObject */ + private $tree; + /** @var ILogger | \PHPUnit_Framework_MockObject_MockObject */ + private $logger; + + function setUp() { + parent::setUp(); + + $this->request = $this->getMockBuilder('Sabre\HTTP\RequestInterface')->getMock(); + $this->response = $this->getMockBuilder('Sabre\HTTP\ResponseInterface')->getMock(); + $this->server = $this->getMockBuilder('Sabre\DAV\Server')->getMock(); + $this->tree = $this->getMockBuilder('Sabre\DAV\Tree')->disableOriginalConstructor()->getMock(); + $this->server->tree = $this->tree; + $this->logger = $this->getMockBuilder('\OCP\ILogger')->getMock(); + + $this->plugin = $this->getMock('OCA\DAV\CardDAV\ImageExportPlugin', ['getPhoto'], [$this->logger]); + $this->plugin->initialize($this->server); + } + + /** + * @dataProvider providesQueryParams + * @param $param + */ + public function testQueryParams($param) { + $this->request->expects($this->once())->method('getQueryParameters')->willReturn($param); + $result = $this->plugin->httpGet($this->request, $this->response); + $this->assertTrue($result); + } + + public function providesQueryParams() { + return [ + [[]], + [['1']], + [['foo' => 'bar']], + ]; + } + + public function testNotACard() { + $this->request->expects($this->once())->method('getQueryParameters')->willReturn(['photo' => true]); + $this->request->expects($this->once())->method('getPath')->willReturn('/files/welcome.txt'); + $this->tree->expects($this->once())->method('getNodeForPath')->with('/files/welcome.txt')->willReturn(null); + $result = $this->plugin->httpGet($this->request, $this->response); + $this->assertTrue($result); + } + + /** + * @dataProvider providesCardWithOrWithoutPhoto + * @param bool $expected + * @param array $getPhotoResult + */ + public function testCardWithOrWithoutPhoto($expected, $getPhotoResult) { + $this->request->expects($this->once())->method('getQueryParameters')->willReturn(['photo' => true]); + $this->request->expects($this->once())->method('getPath')->willReturn('/files/welcome.txt'); + + $card = $this->getMockBuilder('Sabre\CardDAV\Card')->disableOriginalConstructor()->getMock(); + $this->tree->expects($this->once())->method('getNodeForPath')->with('/files/welcome.txt')->willReturn($card); + + $this->plugin->expects($this->once())->method('getPhoto')->willReturn($getPhotoResult); + + if (!$expected) { + $this->response->expects($this->once())->method('setHeader'); + $this->response->expects($this->once())->method('setStatus'); + $this->response->expects($this->once())->method('setBody'); + } + + $result = $this->plugin->httpGet($this->request, $this->response); + $this->assertEquals($expected, $result); + } + + public function providesCardWithOrWithoutPhoto() { + return [ + [true, null], + [false, ['Content-Type' => 'image/jpeg', 'body' => '1234']], + ]; + } + + /** + * @dataProvider providesPhotoData + * @param $expected + * @param $cardData + */ + public function testGetPhoto($expected, $cardData) { + /** @var Card | \PHPUnit_Framework_MockObject_MockObject $card */ + $card = $this->getMockBuilder('Sabre\CardDAV\Card')->disableOriginalConstructor()->getMock(); + $card->expects($this->once())->method('get')->willReturn($cardData); + + $this->plugin = new ImageExportPlugin($this->logger); + $this->plugin->initialize($this->server); + + $result = $this->plugin->getPhoto($card); + $this->assertEquals($expected, $result); + } + + public function providesPhotoData() { + return [ + 'empty vcard' => [false, ''], + 'vcard without PHOTO' => [false, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nEND:VCARD\r\n"], + 'vcard 3 with PHOTO' => [['Content-Type' => 'image/jpeg', 'body' => '12345'], "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;ENCODING=b;TYPE=JPEG:MTIzNDU=\r\nEND:VCARD\r\n"], + // + // TODO: these three below are not working - needs debugging + // + //'vcard 3 with PHOTO URL' => [['Content-Type' => 'image/jpeg', 'body' => '12345'], "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;TYPE=JPEG:http://example.org/photo.jpg\r\nEND:VCARD\r\n"], + //'vcard 4 with PHOTO' => [['Content-Type' => 'image/jpeg', 'body' => '12345'], "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO:data:image/jpeg;MTIzNDU=\r\nEND:VCARD\r\n"], + 'vcard 4 with PHOTO URL' => [['Content-Type' => 'image/jpeg', 'body' => 'http://example.org/photo.jpg'], "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;MEDIATYPE=image/jpeg:http://example.org/photo.jpg\r\nEND:VCARD\r\n"], + ]; + } +} diff --git a/apps/dav/tests/unit/Comments/CommentsNodeTest.php b/apps/dav/tests/unit/Comments/CommentsNodeTest.php index 6bf06375a43..18b18ab8d3b 100644 --- a/apps/dav/tests/unit/Comments/CommentsNodeTest.php +++ b/apps/dav/tests/unit/Comments/CommentsNodeTest.php @@ -166,6 +166,10 @@ class CommentsNodeTest extends \Test\TestCase { $this->assertTrue($this->node->updateComment($msg)); } + /** + * @expectedException Exception + * @expectedExceptionMessage buh! + */ public function testUpdateCommentLogException() { $msg = null; @@ -198,7 +202,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->logger->expects($this->once()) ->method('logException'); - $this->assertFalse($this->node->updateComment($msg)); + $this->node->updateComment($msg); } /** diff --git a/apps/encryption/l10n/sv.js b/apps/encryption/l10n/sv.js index b8541cfbb25..2e00f5d35ff 100644 --- a/apps/encryption/l10n/sv.js +++ b/apps/encryption/l10n/sv.js @@ -20,7 +20,7 @@ OC.L10N.register( "Could not update the private key password." : "Kunde inte uppdatera lösenord för den privata nyckeln", "The old password was not correct, please try again." : "Det gamla lösenordet var inte korrekt. Vänligen försök igen.", "The current log-in password was not correct, please try again." : "Det nuvarande inloggningslösenordet var inte korrekt. Vänligen försök igen.", - "Private key password successfully updated." : "Den privata nyckelns lösenord uppdaterades utan problem.", + "Private key password successfully updated." : "Den privata nyckelns lösenord uppdaterades.", "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "Du behöver migrera dina krypteringsnycklar från den gamla krypteringen (ownCloud <= 8.0) till den nya. Kör 'occ encryption:migrate' eller kontakta din administratör", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "Ogiltig privat nyckel i krypteringsprogrammet. Vänligen uppdatera lösenordet till din privata nyckel under dina personliga inställningar för att återfå tillgång till dina krypterade filer.", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Krypteringsprogrammet är aktiverat men dina nycklar är inte initierade. Vänligen logga ut och in igen", @@ -30,8 +30,11 @@ OC.L10N.register( "one-time password for server-side-encryption" : "engångslösenord för kryptering på serversidan", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan ej dekryptera denna fil, förmodligen är det en delad fil. Be ägaren av filen att dela den med dig.", "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Filen kan inte läsas, troligtvis är det en delad fil. Be ägaren av filen att dela den med dig igen.", + "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "Hej,\n\nadministratören har aktiverat kryptering på servern. Dina filer har krypterats med lösenordet '%s'.\n\nVänligen logga in i webbgränssnittet, gå till \"ownCloud baskrypteringsmodul\" i dina personliga inställningar och uppdatera ditt krypteringslösenord genom att mata in det här lösenordet i fältet \"gamla inloggningslösenordet\" och ditt nuvarande inloggningslösenord.\n\n", "The share will expire on %s." : "Utdelningen kommer att upphöra %s.", "Cheers!" : "Ha de fint!", + "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Hej,<br><br>administratören har aktiverat kryptering på servern. Dina filer har krypterats med lösenordet <strong>%s</strong>.<br><br>Vänligen logga in i webbgränssnittet, gå till \"ownCloud baskrypteringsmodul\" i dina personliga inställningar och uppdatera ditt krypteringslösenord genom att mata in det här lösenordet i fältet \"gamla inloggningslösenordet\" och ditt nuvarande inloggningslösenord.<br><br>", + "Encrypt the home storage" : "Kryptera hemmalagringen", "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Aktivering av det här alternativet krypterar alla filer som är lagrade på huvudlagringsplatsen, annars kommer bara filer på extern lagringsplats att krypteras", "Enable recovery key" : "Aktivera återställningsnyckel", "Disable recovery key" : "Inaktivera återställningsnyckel", @@ -43,6 +46,7 @@ OC.L10N.register( "New recovery key password" : "Nytt lösenord för återställningsnyckeln", "Repeat new recovery key password" : "Upprepa nytt lösenord för återställningsnyckeln", "Change Password" : "Byt lösenord", + "ownCloud basic encryption module" : "ownCloud baskrypteringsmodul", "Your private key password no longer matches your log-in password." : "Ditt lösenord för din privata nyckel matchar inte längre ditt inloggningslösenord.", "Set your old private key password to your current log-in password:" : "Sätt ditt gamla privatnyckellösenord till ditt aktuella inloggningslösenord:", " If you don't remember your old password you can ask your administrator to recover your files." : "Om du inte kommer ihåg ditt gamla lösenord kan du be din administratör att återställa dina filer.", diff --git a/apps/encryption/l10n/sv.json b/apps/encryption/l10n/sv.json index 9a6919b4888..b06c1bc9189 100644 --- a/apps/encryption/l10n/sv.json +++ b/apps/encryption/l10n/sv.json @@ -18,7 +18,7 @@ "Could not update the private key password." : "Kunde inte uppdatera lösenord för den privata nyckeln", "The old password was not correct, please try again." : "Det gamla lösenordet var inte korrekt. Vänligen försök igen.", "The current log-in password was not correct, please try again." : "Det nuvarande inloggningslösenordet var inte korrekt. Vänligen försök igen.", - "Private key password successfully updated." : "Den privata nyckelns lösenord uppdaterades utan problem.", + "Private key password successfully updated." : "Den privata nyckelns lösenord uppdaterades.", "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "Du behöver migrera dina krypteringsnycklar från den gamla krypteringen (ownCloud <= 8.0) till den nya. Kör 'occ encryption:migrate' eller kontakta din administratör", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "Ogiltig privat nyckel i krypteringsprogrammet. Vänligen uppdatera lösenordet till din privata nyckel under dina personliga inställningar för att återfå tillgång till dina krypterade filer.", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Krypteringsprogrammet är aktiverat men dina nycklar är inte initierade. Vänligen logga ut och in igen", @@ -28,8 +28,11 @@ "one-time password for server-side-encryption" : "engångslösenord för kryptering på serversidan", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Kan ej dekryptera denna fil, förmodligen är det en delad fil. Be ägaren av filen att dela den med dig.", "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Filen kan inte läsas, troligtvis är det en delad fil. Be ägaren av filen att dela den med dig igen.", + "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "Hej,\n\nadministratören har aktiverat kryptering på servern. Dina filer har krypterats med lösenordet '%s'.\n\nVänligen logga in i webbgränssnittet, gå till \"ownCloud baskrypteringsmodul\" i dina personliga inställningar och uppdatera ditt krypteringslösenord genom att mata in det här lösenordet i fältet \"gamla inloggningslösenordet\" och ditt nuvarande inloggningslösenord.\n\n", "The share will expire on %s." : "Utdelningen kommer att upphöra %s.", "Cheers!" : "Ha de fint!", + "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Hej,<br><br>administratören har aktiverat kryptering på servern. Dina filer har krypterats med lösenordet <strong>%s</strong>.<br><br>Vänligen logga in i webbgränssnittet, gå till \"ownCloud baskrypteringsmodul\" i dina personliga inställningar och uppdatera ditt krypteringslösenord genom att mata in det här lösenordet i fältet \"gamla inloggningslösenordet\" och ditt nuvarande inloggningslösenord.<br><br>", + "Encrypt the home storage" : "Kryptera hemmalagringen", "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Aktivering av det här alternativet krypterar alla filer som är lagrade på huvudlagringsplatsen, annars kommer bara filer på extern lagringsplats att krypteras", "Enable recovery key" : "Aktivera återställningsnyckel", "Disable recovery key" : "Inaktivera återställningsnyckel", @@ -41,6 +44,7 @@ "New recovery key password" : "Nytt lösenord för återställningsnyckeln", "Repeat new recovery key password" : "Upprepa nytt lösenord för återställningsnyckeln", "Change Password" : "Byt lösenord", + "ownCloud basic encryption module" : "ownCloud baskrypteringsmodul", "Your private key password no longer matches your log-in password." : "Ditt lösenord för din privata nyckel matchar inte längre ditt inloggningslösenord.", "Set your old private key password to your current log-in password:" : "Sätt ditt gamla privatnyckellösenord till ditt aktuella inloggningslösenord:", " If you don't remember your old password you can ask your administrator to recover your files." : "Om du inte kommer ihåg ditt gamla lösenord kan du be din administratör att återställa dina filer.", diff --git a/apps/federatedfilesharing/l10n/ast.js b/apps/federatedfilesharing/l10n/ast.js index 4ae5f2b9cc1..3b5affabbb9 100644 --- a/apps/federatedfilesharing/l10n/ast.js +++ b/apps/federatedfilesharing/l10n/ast.js @@ -1,6 +1,9 @@ OC.L10N.register( "federatedfilesharing", { - "Sharing %s failed, because this item is already shared with %s" : "Compartir %s falló, porque esti elementu yá ta compartiéndose con %s" + "Invalid Federated Cloud ID" : "Inválidu ID de Ñube Federada", + "Sharing %s failed, because this item is already shared with %s" : "Compartir %s falló, porque esti elementu yá ta compartiéndose con %s", + "Not allowed to create a federated share with the same user" : "Nun s'almite crear un recursu compartíu federáu col mesmu usuariu", + "Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "Compartir %s falló, nun pudo atopase %s, pue qu'el servidor nun seya anguaño algamable." }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/federatedfilesharing/l10n/ast.json b/apps/federatedfilesharing/l10n/ast.json index 70d90ab6578..e5eb10cf14e 100644 --- a/apps/federatedfilesharing/l10n/ast.json +++ b/apps/federatedfilesharing/l10n/ast.json @@ -1,4 +1,7 @@ { "translations": { - "Sharing %s failed, because this item is already shared with %s" : "Compartir %s falló, porque esti elementu yá ta compartiéndose con %s" + "Invalid Federated Cloud ID" : "Inválidu ID de Ñube Federada", + "Sharing %s failed, because this item is already shared with %s" : "Compartir %s falló, porque esti elementu yá ta compartiéndose con %s", + "Not allowed to create a federated share with the same user" : "Nun s'almite crear un recursu compartíu federáu col mesmu usuariu", + "Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "Compartir %s falló, nun pudo atopase %s, pue qu'el servidor nun seya anguaño algamable." },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/federatedfilesharing/lib/DiscoveryManager.php b/apps/federatedfilesharing/lib/DiscoveryManager.php index 279f86eda30..d65dad3085e 100644 --- a/apps/federatedfilesharing/lib/DiscoveryManager.php +++ b/apps/federatedfilesharing/lib/DiscoveryManager.php @@ -84,7 +84,10 @@ class DiscoveryManager { // Read the data from the response body try { - $response = $this->client->get($remote . '/ocs-provider/'); + $response = $this->client->get($remote . '/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]); if($response->getStatusCode() === 200) { $decodedService = json_decode($response->getBody(), true); if(is_array($decodedService)) { diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php index b2e665ed5fd..ac55642b858 100644 --- a/apps/federatedfilesharing/lib/Notifications.php +++ b/apps/federatedfilesharing/lib/Notifications.php @@ -287,7 +287,9 @@ class Notifications { $endpoint = $this->discoveryManager->getShareEndpoint($protocol . $remoteDomain); try { $response = $client->post($protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, [ - 'body' => $fields + 'body' => $fields, + 'timeout' => 10, + 'connect_timeout' => 10, ]); $result['result'] = $response->getBody(); $result['success'] = true; diff --git a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php index 73f79b2c169..a9c324f0244 100644 --- a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php +++ b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php @@ -77,7 +77,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $this->cache ->expects($this->at(0)) @@ -111,7 +114,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $expectedResult = '/public.php/MyCustomEndpoint/'; @@ -131,7 +137,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $expectedResult = '/public.php/webdav'; @@ -151,7 +160,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $expectedResult = '/ocs/v2.php/cloud/MyCustomShareEndpoint'; @@ -171,7 +183,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $this->cache ->expects($this->at(0)) diff --git a/apps/files/js/search.js b/apps/files/js/search.js index 394bcb48603..625e4b13f4b 100644 --- a/apps/files/js/search.js +++ b/apps/files/js/search.js @@ -133,7 +133,7 @@ this.handleFolderClick = function($row, result, event) { // open folder - if (self.fileAppLoaded()) { + if (self.fileAppLoaded() && self.fileList.id === 'files') { self.fileList.changeDirectory(result.path); return false; } else { @@ -142,7 +142,7 @@ }; this.handleFileClick = function($row, result, event) { - if (self.fileAppLoaded()) { + if (self.fileAppLoaded() && self.fileList.id === 'files') { self.fileList.changeDirectory(OC.dirname(result.path)); self.fileList.scrollTo(result.name); return false; @@ -184,6 +184,13 @@ search.setHandler('folder', this.handleFolderClick.bind(this)); search.setHandler(['file', 'audio', 'image'], this.handleFileClick.bind(this)); + + if (self.fileAppLoaded()) { + // hide results when switching directory outside of search results + $('#app-content').delegate('>div', 'changeDirectory', function() { + search.clear(); + }); + } } }; OCA.Search.Files = Files; diff --git a/apps/files/l10n/ast.js b/apps/files/l10n/ast.js index 6fe07fed765..092610b7140 100644 --- a/apps/files/l10n/ast.js +++ b/apps/files/l10n/ast.js @@ -21,6 +21,7 @@ OC.L10N.register( "Invalid directory." : "Direutoriu non válidu.", "Files" : "Ficheros", "All files" : "Tolos ficheros", + "File could not be found" : "Nun s'atopó el ficheru", "Home" : "Casa", "Close" : "Zarrar", "Favorites" : "Favoritos", @@ -28,8 +29,19 @@ OC.L10N.register( "Unable to upload {filename} as it is a directory or has 0 bytes" : "Nun pudo xubise {filename}, paez que ye un directoriu o tien 0 bytes", "Total file size {size1} exceeds upload limit {size2}" : "El tamañu de ficheru total {size1} perpasa la llende de xuba {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" : "Nun hai abondu espaciu llibre, tas xubiendo {size1} pero namái falta {size2}", + "Error uploading file \"{fileName}\": {message}" : "Fallu xubiendo'l ficheru \"{fileName}\": {message}", "Could not get result from server." : "Nun pudo obtenese'l resultáu del sirvidor.", "Uploading..." : "Xubiendo...", + "..." : "...", + "{hours}:{minutes}:{seconds} hour{plural_s} left" : "Falten {hours}:{minutes}:{seconds} hour{plural_s}", + "{hours}:{minutes}h" : "{hours}:{minutes}h", + "{minutes}:{seconds} minute{plural_s} left" : "Falten {minutes}:{seconds} minute{plural_s} ", + "{minutes}:{seconds}m" : "{minutes}:{seconds}m", + "{seconds} second{plural_s} left" : "Falten {seconds} second{plural_s}", + "{seconds}s" : "{seconds}s", + "Any moment now..." : "En cualquier momentu...", + "Soon..." : "Pronto...", + "{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} de {totalSize} ({bitrate})", "File upload is in progress. Leaving the page now will cancel the upload." : "La xuba del ficheru ta en progresu. Si dexes agora la páxina, va encaboxase la xuba.", "Actions" : "Aiciones", "Download" : "Descargar", @@ -43,6 +55,17 @@ OC.L10N.register( "Unable to determine date" : "Imposible determinar la fecha", "This operation is forbidden" : "La operación ta prohibida", "This directory is unavailable, please check the logs or contact the administrator" : "Esti direutoriu nun ta disponible, por favor verifica'l rexistru o contacta l'alministrador", + "Could not move \"{file}\", target exists" : "Nun pudo movese \"{file}\", destín yá esiste", + "Could not move \"{file}\"" : "Nun pudo movese \"{file}\"", + "{newName} already exists" : "{newName} yá esiste", + "Could not rename \"{fileName}\", it does not exist any more" : "Nun pudo renomase \"{fileName}\", yá nun esiste", + "The name \"{targetName}\" is already used in the folder \"{dir}\". Please choose a different name." : "El nome \"{targetName}\" yá ta n'usu na carpeta \"{dir}\". Por favor, escueyi un nome diferente.", + "Could not rename \"{fileName}\"" : "Nun pudo renomase \"{fileName}\"", + "Could not create file \"{file}\"" : "Nun pudo crease'l ficheru \"{file}\"", + "Could not create file \"{file}\" because it already exists" : "Nun pudo crease'l ficheru \"{file}\" porque yá esiste", + "Could not create folder \"{dir}\"" : "Nun pudo crease la carpeta \"{dir}\"", + "Could not create folder \"{dir}\" because it already exists" : "Nun pudo crease la carpeta \"{dir}\" porque yá esiste", + "Error deleting file \"{fileName}\"." : "Fallu borrando'l ficheru \"{fileName}\".", "No entries in this folder match '{filter}'" : "Nun concasa nenguna entrada nesta carpeta '{filter}'", "Name" : "Nome", "Size" : "Tamañu", @@ -64,6 +87,7 @@ OC.L10N.register( "_%n byte_::_%n bytes_" : ["%n bytes","%n bytes"], "Favorited" : "Favoritos", "Favorite" : "Favoritu", + "Local link" : "Enllaz llocal", "Folder" : "Carpeta", "New folder" : "Nueva carpeta", "{newname} already exists" : "{newname} yá existe", @@ -91,8 +115,12 @@ OC.L10N.register( "Maximum upload size" : "Tamañu máximu de xubida", "max. possible: " : "máx. posible:", "Save" : "Guardar", + "With PHP-FPM it might take 5 minutes for changes to be applied." : "Con PHP-FPM pue retrasase 5 minutos pa que los cambeos s'apliquen.", + "Missing permissions to edit from here." : "Falten permisos pa editar dende equí.", "Settings" : "Axustes", + "Show hidden files" : "Amosar ficheros ocultos", "WebDAV" : "WebDAV", + "Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>" : "Usa esta direición <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">p'acceder a los dos Ficheros via WebDAV</a>", "No files in here" : "Nun hai nengún ficheru equí", "Upload some content or sync with your devices!" : "¡Xuba algún conteníu o sincroniza colos sos preseos!", "No entries found in this folder" : "Nenguna entrada en esta carpeta", diff --git a/apps/files/l10n/ast.json b/apps/files/l10n/ast.json index 5b554ab8f93..7631a9149f2 100644 --- a/apps/files/l10n/ast.json +++ b/apps/files/l10n/ast.json @@ -19,6 +19,7 @@ "Invalid directory." : "Direutoriu non válidu.", "Files" : "Ficheros", "All files" : "Tolos ficheros", + "File could not be found" : "Nun s'atopó el ficheru", "Home" : "Casa", "Close" : "Zarrar", "Favorites" : "Favoritos", @@ -26,8 +27,19 @@ "Unable to upload {filename} as it is a directory or has 0 bytes" : "Nun pudo xubise {filename}, paez que ye un directoriu o tien 0 bytes", "Total file size {size1} exceeds upload limit {size2}" : "El tamañu de ficheru total {size1} perpasa la llende de xuba {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" : "Nun hai abondu espaciu llibre, tas xubiendo {size1} pero namái falta {size2}", + "Error uploading file \"{fileName}\": {message}" : "Fallu xubiendo'l ficheru \"{fileName}\": {message}", "Could not get result from server." : "Nun pudo obtenese'l resultáu del sirvidor.", "Uploading..." : "Xubiendo...", + "..." : "...", + "{hours}:{minutes}:{seconds} hour{plural_s} left" : "Falten {hours}:{minutes}:{seconds} hour{plural_s}", + "{hours}:{minutes}h" : "{hours}:{minutes}h", + "{minutes}:{seconds} minute{plural_s} left" : "Falten {minutes}:{seconds} minute{plural_s} ", + "{minutes}:{seconds}m" : "{minutes}:{seconds}m", + "{seconds} second{plural_s} left" : "Falten {seconds} second{plural_s}", + "{seconds}s" : "{seconds}s", + "Any moment now..." : "En cualquier momentu...", + "Soon..." : "Pronto...", + "{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} de {totalSize} ({bitrate})", "File upload is in progress. Leaving the page now will cancel the upload." : "La xuba del ficheru ta en progresu. Si dexes agora la páxina, va encaboxase la xuba.", "Actions" : "Aiciones", "Download" : "Descargar", @@ -41,6 +53,17 @@ "Unable to determine date" : "Imposible determinar la fecha", "This operation is forbidden" : "La operación ta prohibida", "This directory is unavailable, please check the logs or contact the administrator" : "Esti direutoriu nun ta disponible, por favor verifica'l rexistru o contacta l'alministrador", + "Could not move \"{file}\", target exists" : "Nun pudo movese \"{file}\", destín yá esiste", + "Could not move \"{file}\"" : "Nun pudo movese \"{file}\"", + "{newName} already exists" : "{newName} yá esiste", + "Could not rename \"{fileName}\", it does not exist any more" : "Nun pudo renomase \"{fileName}\", yá nun esiste", + "The name \"{targetName}\" is already used in the folder \"{dir}\". Please choose a different name." : "El nome \"{targetName}\" yá ta n'usu na carpeta \"{dir}\". Por favor, escueyi un nome diferente.", + "Could not rename \"{fileName}\"" : "Nun pudo renomase \"{fileName}\"", + "Could not create file \"{file}\"" : "Nun pudo crease'l ficheru \"{file}\"", + "Could not create file \"{file}\" because it already exists" : "Nun pudo crease'l ficheru \"{file}\" porque yá esiste", + "Could not create folder \"{dir}\"" : "Nun pudo crease la carpeta \"{dir}\"", + "Could not create folder \"{dir}\" because it already exists" : "Nun pudo crease la carpeta \"{dir}\" porque yá esiste", + "Error deleting file \"{fileName}\"." : "Fallu borrando'l ficheru \"{fileName}\".", "No entries in this folder match '{filter}'" : "Nun concasa nenguna entrada nesta carpeta '{filter}'", "Name" : "Nome", "Size" : "Tamañu", @@ -62,6 +85,7 @@ "_%n byte_::_%n bytes_" : ["%n bytes","%n bytes"], "Favorited" : "Favoritos", "Favorite" : "Favoritu", + "Local link" : "Enllaz llocal", "Folder" : "Carpeta", "New folder" : "Nueva carpeta", "{newname} already exists" : "{newname} yá existe", @@ -89,8 +113,12 @@ "Maximum upload size" : "Tamañu máximu de xubida", "max. possible: " : "máx. posible:", "Save" : "Guardar", + "With PHP-FPM it might take 5 minutes for changes to be applied." : "Con PHP-FPM pue retrasase 5 minutos pa que los cambeos s'apliquen.", + "Missing permissions to edit from here." : "Falten permisos pa editar dende equí.", "Settings" : "Axustes", + "Show hidden files" : "Amosar ficheros ocultos", "WebDAV" : "WebDAV", + "Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>" : "Usa esta direición <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">p'acceder a los dos Ficheros via WebDAV</a>", "No files in here" : "Nun hai nengún ficheru equí", "Upload some content or sync with your devices!" : "¡Xuba algún conteníu o sincroniza colos sos preseos!", "No entries found in this folder" : "Nenguna entrada en esta carpeta", diff --git a/apps/files/l10n/bg_BG.js b/apps/files/l10n/bg_BG.js index 3a00853fa18..d080e4b7c69 100644 --- a/apps/files/l10n/bg_BG.js +++ b/apps/files/l10n/bg_BG.js @@ -90,6 +90,7 @@ OC.L10N.register( "The files you are trying to upload exceed the maximum size for file uploads on this server." : "Файловете, които се опитваш да качиш са по-големи от позволеното на този сървър.", "No favorites" : "Няма любими", "Files and folders you mark as favorite will show up here" : "Файловете и папките които отбелязваш като любими ще се показват тук", - "Text file" : "Текстов файл" + "Text file" : "Текстов файл", + "New text file.txt" : "Нов текст file.txt" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/files/l10n/bg_BG.json b/apps/files/l10n/bg_BG.json index 4d60be20692..080390bd8a6 100644 --- a/apps/files/l10n/bg_BG.json +++ b/apps/files/l10n/bg_BG.json @@ -88,6 +88,7 @@ "The files you are trying to upload exceed the maximum size for file uploads on this server." : "Файловете, които се опитваш да качиш са по-големи от позволеното на този сървър.", "No favorites" : "Няма любими", "Files and folders you mark as favorite will show up here" : "Файловете и папките които отбелязваш като любими ще се показват тук", - "Text file" : "Текстов файл" + "Text file" : "Текстов файл", + "New text file.txt" : "Нов текст file.txt" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/files/l10n/lb.js b/apps/files/l10n/lb.js index 30a86b000bb..d7888f9f197 100644 --- a/apps/files/l10n/lb.js +++ b/apps/files/l10n/lb.js @@ -9,11 +9,13 @@ OC.L10N.register( "Missing a temporary folder" : "Et feelt en temporären Dossier", "Failed to write to disk" : "Konnt net op den Disk schreiwen", "Files" : "Dateien", + "All files" : "All d'Fichieren", "Home" : "Doheem", "Close" : "Zoumaachen", "Favorites" : "Favoriten", "Upload cancelled." : "Upload ofgebrach.", "Uploading..." : "Lueden erop...", + "..." : "...", "File upload is in progress. Leaving the page now will cancel the upload." : "File Upload am gaang. Wann's de des Säit verléiss gëtt den Upload ofgebrach.", "Download" : "Download", "Rename" : "Ëmbenennen", diff --git a/apps/files/l10n/lb.json b/apps/files/l10n/lb.json index 99a6b4845da..a736e06570b 100644 --- a/apps/files/l10n/lb.json +++ b/apps/files/l10n/lb.json @@ -7,11 +7,13 @@ "Missing a temporary folder" : "Et feelt en temporären Dossier", "Failed to write to disk" : "Konnt net op den Disk schreiwen", "Files" : "Dateien", + "All files" : "All d'Fichieren", "Home" : "Doheem", "Close" : "Zoumaachen", "Favorites" : "Favoriten", "Upload cancelled." : "Upload ofgebrach.", "Uploading..." : "Lueden erop...", + "..." : "...", "File upload is in progress. Leaving the page now will cancel the upload." : "File Upload am gaang. Wann's de des Säit verléiss gëtt den Upload ofgebrach.", "Download" : "Download", "Rename" : "Ëmbenennen", diff --git a/apps/files/l10n/sv.js b/apps/files/l10n/sv.js index d2f7df4a3a4..b07bdf8b59b 100644 --- a/apps/files/l10n/sv.js +++ b/apps/files/l10n/sv.js @@ -21,6 +21,7 @@ OC.L10N.register( "Invalid directory." : "Felaktig mapp.", "Files" : "Filer", "All files" : "Alla filer", + "File could not be found" : "Fil kunde inte hittas", "Home" : "Hem", "Close" : "Stäng", "Favorites" : "Favoriter", @@ -32,6 +33,15 @@ OC.L10N.register( "Could not get result from server." : "Gick inte att hämta resultat från server.", "Uploading..." : "Laddar upp...", "..." : "...", + "{hours}:{minutes}:{seconds} hour{plural_s} left" : "{hours}:{minutes}:{seconds} timme/ar kvar", + "{hours}:{minutes}h" : "{hours}:{minutes}", + "{minutes}:{seconds} minute{plural_s} left" : "{minutes}:{seconds} minut(er) kvar", + "{minutes}:{seconds}m" : "{minutes}:{seconds}", + "{seconds} second{plural_s} left" : "{seconds} sekund(er) kvar", + "{seconds}s" : "{seconds}s", + "Any moment now..." : "Alldeles strax...", + "Soon..." : "Snart...", + "{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} av {totalSize} ({bitrate})", "File upload is in progress. Leaving the page now will cancel the upload." : "Filuppladdning pågår. Lämnar du sidan så avbryts uppladdningen.", "Actions" : "Åtgärder", "Download" : "Ladda ner", @@ -77,6 +87,7 @@ OC.L10N.register( "_%n byte_::_%n bytes_" : ["%n bytes","%n bytes"], "Favorited" : "Favoriserad", "Favorite" : "Favorit", + "Local link" : "Lokal länk", "Folder" : "Mapp", "New folder" : "Ny mapp", "{newname} already exists" : "{newname} existerar redan", diff --git a/apps/files/l10n/sv.json b/apps/files/l10n/sv.json index c2d1d464bc9..957088d80fc 100644 --- a/apps/files/l10n/sv.json +++ b/apps/files/l10n/sv.json @@ -19,6 +19,7 @@ "Invalid directory." : "Felaktig mapp.", "Files" : "Filer", "All files" : "Alla filer", + "File could not be found" : "Fil kunde inte hittas", "Home" : "Hem", "Close" : "Stäng", "Favorites" : "Favoriter", @@ -30,6 +31,15 @@ "Could not get result from server." : "Gick inte att hämta resultat från server.", "Uploading..." : "Laddar upp...", "..." : "...", + "{hours}:{minutes}:{seconds} hour{plural_s} left" : "{hours}:{minutes}:{seconds} timme/ar kvar", + "{hours}:{minutes}h" : "{hours}:{minutes}", + "{minutes}:{seconds} minute{plural_s} left" : "{minutes}:{seconds} minut(er) kvar", + "{minutes}:{seconds}m" : "{minutes}:{seconds}", + "{seconds} second{plural_s} left" : "{seconds} sekund(er) kvar", + "{seconds}s" : "{seconds}s", + "Any moment now..." : "Alldeles strax...", + "Soon..." : "Snart...", + "{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} av {totalSize} ({bitrate})", "File upload is in progress. Leaving the page now will cancel the upload." : "Filuppladdning pågår. Lämnar du sidan så avbryts uppladdningen.", "Actions" : "Åtgärder", "Download" : "Ladda ner", @@ -75,6 +85,7 @@ "_%n byte_::_%n bytes_" : ["%n bytes","%n bytes"], "Favorited" : "Favoriserad", "Favorite" : "Favorit", + "Local link" : "Lokal länk", "Folder" : "Mapp", "New folder" : "Ny mapp", "{newname} already exists" : "{newname} existerar redan", diff --git a/apps/files_external/l10n/lb.js b/apps/files_external/l10n/lb.js index 598458c731f..50bb06ff7f9 100644 --- a/apps/files_external/l10n/lb.js +++ b/apps/files_external/l10n/lb.js @@ -6,6 +6,7 @@ OC.L10N.register( "Username" : "Benotzernumm", "Password" : "Passwuert", "Save" : "Späicheren", + "None" : "Keng", "Port" : "Port", "Region" : "Regioun", "URL" : "URL", diff --git a/apps/files_external/l10n/lb.json b/apps/files_external/l10n/lb.json index 265d8ffda96..9f7aa84bb1a 100644 --- a/apps/files_external/l10n/lb.json +++ b/apps/files_external/l10n/lb.json @@ -4,6 +4,7 @@ "Username" : "Benotzernumm", "Password" : "Passwuert", "Save" : "Späicheren", + "None" : "Keng", "Port" : "Port", "Region" : "Regioun", "URL" : "URL", diff --git a/apps/files_external/l10n/sv.js b/apps/files_external/l10n/sv.js index dfa978f202a..3df7763a5fe 100644 --- a/apps/files_external/l10n/sv.js +++ b/apps/files_external/l10n/sv.js @@ -1,6 +1,7 @@ OC.L10N.register( "files_external", { + "Fetching request tokens failed. Verify that your app key and secret are correct." : "Fel vid hämtning av åtkomst-token. Verifiera att din app-nyckel och hemlighet stämmer.", "Step 1 failed. Exception: %s" : "Steg 1 flaerade. Undantag: %s", "Step 2 failed. Exception: %s" : "Steg 2 falerade. Undantag: %s", "External storage" : "Extern lagring", diff --git a/apps/files_external/l10n/sv.json b/apps/files_external/l10n/sv.json index 528588bd702..1070a322e92 100644 --- a/apps/files_external/l10n/sv.json +++ b/apps/files_external/l10n/sv.json @@ -1,4 +1,5 @@ { "translations": { + "Fetching request tokens failed. Verify that your app key and secret are correct." : "Fel vid hämtning av åtkomst-token. Verifiera att din app-nyckel och hemlighet stämmer.", "Step 1 failed. Exception: %s" : "Steg 1 flaerade. Undantag: %s", "Step 2 failed. Exception: %s" : "Steg 2 falerade. Undantag: %s", "External storage" : "Extern lagring", diff --git a/apps/files_external/lib/Command/Export.php b/apps/files_external/lib/Command/Export.php index 09c5ea8a9df..89655c1efc7 100644 --- a/apps/files_external/lib/Command/Export.php +++ b/apps/files_external/lib/Command/Export.php @@ -41,6 +41,11 @@ class Export extends ListCommand { 'user_id', InputArgument::OPTIONAL, 'user id to export the personal mounts for, if no user is provided admin mounts will be exported' + )->addOption( + 'all', + 'a', + InputOption::VALUE_NONE, + 'show both system wide mounts and all personal mounts' ); } @@ -48,6 +53,7 @@ class Export extends ListCommand { $listCommand = new ListCommand($this->globalService, $this->userService, $this->userSession, $this->userManager); $listInput = new ArrayInput([], $listCommand->getDefinition()); $listInput->setArgument('user_id', $input->getArgument('user_id')); + $listInput->setOption('all', $input->getOption('all')); $listInput->setOption('output', 'json_pretty'); $listInput->setOption('show-password', true); $listInput->setOption('full', true); diff --git a/apps/files_external/lib/Command/ListCommand.php b/apps/files_external/lib/Command/ListCommand.php index 26133ea5ed5..e29a5f58f40 100644 --- a/apps/files_external/lib/Command/ListCommand.php +++ b/apps/files_external/lib/Command/ListCommand.php @@ -56,6 +56,8 @@ class ListCommand extends Base { */ protected $userManager; + const ALL = -1; + function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager) { parent::__construct(); $this->globalService = $globalService; @@ -67,7 +69,7 @@ class ListCommand extends Base { protected function configure() { $this ->setName('files_external:list') - ->setDescription('List configured mounts') + ->setDescription('List configured admin or personal mounts') ->addArgument( 'user_id', InputArgument::OPTIONAL, @@ -82,16 +84,27 @@ class ListCommand extends Base { null, InputOption::VALUE_NONE, 'don\'t truncate long values in table output' + )->addOption( + 'all', + 'a', + InputOption::VALUE_NONE, + 'show both system wide mounts and all personal mounts' ); parent::configure(); } protected function execute(InputInterface $input, OutputInterface $output) { - $userId = $input->getArgument('user_id'); - $storageService = $this->getStorageService($userId); + if ($input->getOption('all')) { + /** @var $mounts StorageConfig[] */ + $mounts = $this->globalService->getStorageForAllUsers(); + $userId = self::ALL; + } else { + $userId = $input->getArgument('user_id'); + $storageService = $this->getStorageService($userId); - /** @var $mounts StorageConfig[] */ - $mounts = $storageService->getAllStorages(); + /** @var $mounts StorageConfig[] */ + $mounts = $storageService->getAllStorages(); + } $this->listMounts($userId, $mounts, $input, $output); } @@ -102,13 +115,15 @@ class ListCommand extends Base { * @param InputInterface $input * @param OutputInterface $output */ - public function listMounts($userId, array $mounts, InputInterface $input, OutputInterface $output){ + public function listMounts($userId, array $mounts, InputInterface $input, OutputInterface $output) { $outputType = $input->getOption('output'); if (count($mounts) === 0) { if ($outputType === self::OUTPUT_FORMAT_JSON || $outputType === self::OUTPUT_FORMAT_JSON_PRETTY) { $output->writeln('[]'); } else { - if ($userId) { + if ($userId === self::ALL) { + $output->writeln("<info>No mounts configured</info>"); + } else if ($userId) { $output->writeln("<info>No mounts configured by $userId</info>"); } else { $output->writeln("<info>No admin mounts configured</info>"); @@ -119,10 +134,13 @@ class ListCommand extends Base { $headers = ['Mount ID', 'Mount Point', 'Storage', 'Authentication Type', 'Configuration', 'Options']; - if (!$userId) { + if (!$userId || $userId === self::ALL) { $headers[] = 'Applicable Users'; $headers[] = 'Applicable Groups'; } + if ($userId === self::ALL) { + $headers[] = 'Type'; + } if (!$input->getOption('show-password')) { $hideKeys = ['password', 'refresh_token', 'token', 'client_secret', 'public_key', 'private_key']; @@ -150,10 +168,13 @@ class ListCommand extends Base { $config->getBackendOptions(), $config->getMountOptions() ]; - if (!$userId) { + if (!$userId || $userId === self::ALL) { $values[] = $config->getApplicableUsers(); $values[] = $config->getApplicableGroups(); } + if ($userId === self::ALL) { + $values[] = $config->getType() === StorageConfig::MOUNT_TYPE_ADMIN ? 'admin' : 'personal'; + } return array_combine($keys, $values); }, $mounts); @@ -167,7 +188,9 @@ class ListCommand extends Base { $defaultMountOptions = [ 'encrypt' => true, 'previews' => true, - 'filesystem_check_changes' => 1 + 'filesystem_check_changes' => 1, + 'enable_sharing' => false, + 'encoding_compatibility' => false ]; $rows = array_map(function (StorageConfig $config) use ($userId, $defaultMountOptions, $full) { $storageConfig = $config->getBackendOptions(); @@ -213,7 +236,7 @@ class ListCommand extends Base { $optionsString ]; - if (!$userId) { + if (!$userId || $userId === self::ALL) { $applicableUsers = implode(', ', $config->getApplicableUsers()); $applicableGroups = implode(', ', $config->getApplicableGroups()); if ($applicableUsers === '' && $applicableGroups === '') { @@ -222,6 +245,9 @@ class ListCommand extends Base { $values[] = $applicableUsers; $values[] = $applicableGroups; } + if ($userId === self::ALL) { + $values[] = $config->getType() === StorageConfig::MOUNT_TYPE_ADMIN ? 'Admin' : 'Personal'; + } return $values; }, $mounts); diff --git a/apps/files_external/lib/Service/DBConfigService.php b/apps/files_external/lib/Service/DBConfigService.php index 9f7061eb938..3e38f4aed94 100644 --- a/apps/files_external/lib/Service/DBConfigService.php +++ b/apps/files_external/lib/Service/DBConfigService.php @@ -77,6 +77,18 @@ class DBConfigService { } /** + * Get all configured mounts + * + * @return array + */ + public function getAllMounts() { + $builder = $this->connection->getQueryBuilder(); + $query = $builder->select(['mount_id', 'mount_point', 'storage_backend', 'auth_backend', 'priority', 'type']) + ->from('external_mounts'); + return $this->getMountsFromQuery($query); + } + + /** * Get admin defined mounts * * @return array diff --git a/apps/files_external/lib/Service/GlobalStoragesService.php b/apps/files_external/lib/Service/GlobalStoragesService.php index 96d7aa46e8d..39d3da5d803 100644 --- a/apps/files_external/lib/Service/GlobalStoragesService.php +++ b/apps/files_external/lib/Service/GlobalStoragesService.php @@ -162,4 +162,23 @@ class GlobalStoragesService extends StoragesService { protected function isApplicable(StorageConfig $config) { return true; } + + /** + * Get all configured admin and personal mounts + * + * @return array map of storage id to storage config + */ + public function getStorageForAllUsers() { + $mounts = $this->dbConfig->getAllMounts(); + $configs = array_map([$this, 'getStorageConfigFromDBMount'], $mounts); + $configs = array_filter($configs, function ($config) { + return $config instanceof StorageConfig; + }); + + $keys = array_map(function (StorageConfig $config) { + return $config->getId(); + }, $configs); + + return array_combine($keys, $configs); + } } diff --git a/apps/files_external/tests/Service/DBConfigServiceTest.php b/apps/files_external/tests/Service/DBConfigServiceTest.php index b088a7078d1..3cfa33f0bc8 100644 --- a/apps/files_external/tests/Service/DBConfigServiceTest.php +++ b/apps/files_external/tests/Service/DBConfigServiceTest.php @@ -282,4 +282,14 @@ class DBConfigServiceTest extends TestCase { $this->assertCount(1, $mounts); $this->assertEquals($id1, $mounts[0]['mount_id']); } + + public function testGetAllMounts() { + $id1 = $this->addMount('/test', 'foo', 'bar', 100, DBConfigService::MOUNT_TYPE_ADMIN); + $id2 = $this->addMount('/test2', 'foo2', 'bar2', 100, DBConfigService::MOUNT_TYPE_PERSONAl); + + $mounts = $this->dbConfig->getAllMounts(); + $this->assertCount(2, $mounts); + $this->assertEquals($id1, $mounts[0]['mount_id']); + $this->assertEquals($id2, $mounts[1]['mount_id']); + } } diff --git a/apps/files_external/tests/env/start-swift-ceph.sh b/apps/files_external/tests/env/start-swift-ceph.sh index ba17b8f42dd..b73fa899a6d 100755 --- a/apps/files_external/tests/env/start-swift-ceph.sh +++ b/apps/files_external/tests/env/start-swift-ceph.sh @@ -74,6 +74,11 @@ if [[ $ready != 'READY=1' ]]; then docker logs $container exit 1 fi +if ! "$thisFolder"/env/wait-for-connection ${host} 80 600; then + echo "[ERROR] Waited 600 seconds, no response" >&2 + docker logs $container + exit 1 +fi echo "Waiting another 15 seconds" sleep 15 diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php index 5cf86087f94..4a7a6096c91 100644 --- a/apps/files_sharing/ajax/external.php +++ b/apps/files_sharing/ajax/external.php @@ -77,7 +77,10 @@ $externalManager = new \OCA\Files_Sharing\External\Manager( // check for ssl cert if (substr($remote, 0, 5) === 'https') { try { - \OC::$server->getHTTPClientService()->newClient()->get($remote)->getBody(); + \OC::$server->getHTTPClientService()->newClient()->get($remote, [ + 'timeout' => 10, + 'connect_timeout' => 10, + ])->getBody(); } catch (\Exception $e) { \OCP\JSON::error(array('data' => array('message' => $l->t('Invalid or untrusted SSL certificate')))); exit; diff --git a/apps/files_sharing/l10n/lb.js b/apps/files_sharing/l10n/lb.js index fcbfd04c64f..0679858d818 100644 --- a/apps/files_sharing/l10n/lb.js +++ b/apps/files_sharing/l10n/lb.js @@ -5,6 +5,7 @@ OC.L10N.register( "No shared links" : "Keng gedeelte Linken", "Cancel" : "Ofbriechen", "Shared by" : "Gedeelt vun", + "Sharing" : "Gedeelt", "The password is wrong. Try again." : "Den Passwuert ass incorrect. Probeier ed nach eng keier.", "Password" : "Passwuert", "No entries found in this folder" : "Keng Elementer an dësem Dossier fonnt", diff --git a/apps/files_sharing/l10n/lb.json b/apps/files_sharing/l10n/lb.json index 5a466e560c6..9355d70a6fb 100644 --- a/apps/files_sharing/l10n/lb.json +++ b/apps/files_sharing/l10n/lb.json @@ -3,6 +3,7 @@ "No shared links" : "Keng gedeelte Linken", "Cancel" : "Ofbriechen", "Shared by" : "Gedeelt vun", + "Sharing" : "Gedeelt", "The password is wrong. Try again." : "Den Passwuert ass incorrect. Probeier ed nach eng keier.", "Password" : "Passwuert", "No entries found in this folder" : "Keng Elementer an dësem Dossier fonnt", diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php index ca99393a1e0..29b9c7b563c 100644 --- a/apps/files_sharing/lib/External/Storage.php +++ b/apps/files_sharing/lib/External/Storage.php @@ -254,7 +254,10 @@ class Storage extends DAV implements ISharedStorage { $client = $this->httpClient->newClient(); try { - $result = $client->get($url)->getBody(); + $result = $client->get($url, [ + 'timeout' => 10, + 'connect_timeout' => 10, + ])->getBody(); $data = json_decode($result); $returnValue = (is_object($data) && !empty($data->version)); } catch (ConnectException $e) { @@ -301,7 +304,11 @@ class Storage extends DAV implements ISharedStorage { // TODO: DI $client = \OC::$server->getHTTPClientService()->newClient(); try { - $response = $client->post($url, ['body' => ['password' => $password]]); + $response = $client->post($url, [ + 'body' => ['password' => $password], + 'timeout' => 10, + 'connect_timeout' => 10, + ]); } catch (\GuzzleHttp\Exception\RequestException $e) { if ($e->getCode() === 401 || $e->getCode() === 403) { throw new ForbiddenException(); diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index a9ae48860c2..c71c0e8ddea 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -68,8 +68,9 @@ class MountProvider implements IMountProvider { public function getMountsForUser(IUser $user, IStorageFactory $storageFactory) { $shares = $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_USER, null, -1); $shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_GROUP, null, -1)); - $shares = array_filter($shares, function (\OCP\Share\IShare $share) { - return $share->getPermissions() > 0; + // filter out excluded shares and group shares that includes self + $shares = array_filter($shares, function (\OCP\Share\IShare $share) use ($user) { + return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID(); }); $mounts = []; diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php new file mode 100644 index 00000000000..f69098cde7b --- /dev/null +++ b/apps/files_sharing/tests/MountProviderTest.php @@ -0,0 +1,136 @@ +<?php +/** + * @author Vincent Petry <pvince81@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * 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, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCA\Files_Sharing\Tests; + +use OCA\Files_Sharing\MountProvider; +use OCP\Files\Storage\IStorageFactory; +use OCP\IConfig; +use OCP\ILogger; +use OCP\IUser; +use OCP\Share\IShare; +use OCP\Share\IManager; +use OCP\Files\Mount\IMountPoint; + +class MountProviderTest extends \Test\TestCase { + + /** @var MountProvider */ + private $provider; + + /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */ + private $config; + + /** @var IUser|\PHPUnit_Framework_MockObject_MockObject */ + private $user; + + /** @var IStorageFactory|\PHPUnit_Framework_MockObject_MockObject */ + private $loader; + + /** @var IManager|\PHPUnit_Framework_MockObject_MockObject */ + private $shareManager; + + /** @var ILogger | \PHPUnit_Framework_MockObject_MockObject */ + private $logger; + + public function setUp() { + parent::setUp(); + + $this->config = $this->getMock('OCP\IConfig'); + $this->user = $this->getMock('OCP\IUser'); + $this->loader = $this->getMock('OCP\Files\Storage\IStorageFactory'); + $this->shareManager = $this->getMock('\OCP\Share\IManager'); + $this->logger = $this->getMock('\OCP\ILogger'); + + $this->provider = new MountProvider($this->config, $this->shareManager, $this->logger); + } + + public function testExcludeShares() { + /** @var IShare | \PHPUnit_Framework_MockObject_MockObject $share1 */ + $share1 = $this->getMock('\OCP\Share\IShare'); + $share1->expects($this->once()) + ->method('getPermissions') + ->will($this->returnValue(0)); + + $share2 = $this->getMock('\OCP\Share\IShare'); + $share2->expects($this->once()) + ->method('getPermissions') + ->will($this->returnValue(31)); + $share2->expects($this->any()) + ->method('getShareOwner') + ->will($this->returnValue('user2')); + $share2->expects($this->any()) + ->method('getTarget') + ->will($this->returnValue('/share2')); + + $share3 = $this->getMock('\OCP\Share\IShare'); + $share3->expects($this->once()) + ->method('getPermissions') + ->will($this->returnValue(0)); + + /** @var IShare | \PHPUnit_Framework_MockObject_MockObject $share4 */ + $share4 = $this->getMock('\OCP\Share\IShare'); + $share4->expects($this->once()) + ->method('getPermissions') + ->will($this->returnValue(31)); + $share4->expects($this->any()) + ->method('getShareOwner') + ->will($this->returnValue('user2')); + $share4->expects($this->any()) + ->method('getTarget') + ->will($this->returnValue('/share4')); + + $share5 = $this->getMock('\OCP\Share\IShare'); + $share5->expects($this->once()) + ->method('getPermissions') + ->will($this->returnValue(31)); + $share5->expects($this->any()) + ->method('getShareOwner') + ->will($this->returnValue('user1')); + + $userShares = [$share1, $share2]; + $groupShares = [$share3, $share4, $share5]; + + $this->user->expects($this->any()) + ->method('getUID') + ->will($this->returnValue('user1')); + + $this->shareManager->expects($this->at(0)) + ->method('getSharedWith') + ->with('user1', \OCP\Share::SHARE_TYPE_USER) + ->will($this->returnValue($userShares)); + $this->shareManager->expects($this->at(1)) + ->method('getSharedWith') + ->with('user1', \OCP\Share::SHARE_TYPE_GROUP, null, -1) + ->will($this->returnValue($groupShares)); + + $mounts = $this->provider->getMountsForUser($this->user, $this->loader); + + $this->assertCount(2, $mounts); + $this->assertSharedMount($share1, $mounts[0]); + $this->assertSharedMount($share4, $mounts[1]); + } + + private function assertSharedMount(IShare $share, IMountPoint $mount) { + $this->assertInstanceOf('OCA\Files_Sharing\SharedMount', $mount); + $this->assertEquals($share, $mount->getShare()); + } +} + diff --git a/apps/files_trashbin/js/filelist.js b/apps/files_trashbin/js/filelist.js index feed28d8fc7..510ab2c21bc 100644 --- a/apps/files_trashbin/js/filelist.js +++ b/apps/files_trashbin/js/filelist.js @@ -93,6 +93,8 @@ _renderRow: function(fileData, options) { options = options || {}; + // make a copy to avoid changing original object + fileData = _.extend({}, fileData); var dir = this.getCurrentDirectory(); var dirListing = dir !== '' && dir !== '/'; // show deleted time as mtime diff --git a/apps/files_trashbin/tests/js/filelistSpec.js b/apps/files_trashbin/tests/js/filelistSpec.js index 05caaf27865..5e9a4cf27d1 100644 --- a/apps/files_trashbin/tests/js/filelistSpec.js +++ b/apps/files_trashbin/tests/js/filelistSpec.js @@ -163,6 +163,28 @@ describe('OCA.Trashbin.FileList tests', function() { expect(fileList.findFileEl('One.txt.d11111')[0]).toEqual($tr[0]); }); + it('renders rows with the correct data when in root after calling setFiles with the same data set', function() { + // dir listing is false when in root + $('#dir').val('/'); + fileList.setFiles(testFiles); + fileList.setFiles(fileList.files); + var $rows = fileList.$el.find('tbody tr'); + var $tr = $rows.eq(0); + expect($rows.length).toEqual(4); + expect($tr.attr('data-id')).toEqual('1'); + expect($tr.attr('data-type')).toEqual('file'); + expect($tr.attr('data-file')).toEqual('One.txt.d11111'); + expect($tr.attr('data-size')).not.toBeDefined(); + expect($tr.attr('data-etag')).toEqual('abc'); + expect($tr.attr('data-permissions')).toEqual('9'); // read and delete + expect($tr.attr('data-mime')).toEqual('text/plain'); + expect($tr.attr('data-mtime')).toEqual('11111000'); + expect($tr.find('a.name').attr('href')).toEqual('#'); + + expect($tr.find('.nametext').text().trim()).toEqual('One.txt'); + + expect(fileList.findFileEl('One.txt.d11111')[0]).toEqual($tr[0]); + }); it('renders rows with the correct data when in subdirectory', function() { // dir listing is true when in a subdir $('#dir').val('/subdir'); diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 638a1916f6a..93f8b848ce8 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -336,9 +336,16 @@ class Storage { // Restore encrypted version of the old file for the newly restored file // This has to happen manually here since the file is manually copied below $oldVersion = $users_view->getFileInfo($fileToRestore)->getEncryptedVersion(); + $oldFileInfo = $users_view->getFileInfo($fileToRestore); $newFileInfo = $files_view->getFileInfo($filename); $cache = $newFileInfo->getStorage()->getCache(); - $cache->update($newFileInfo->getId(), ['encrypted' => $oldVersion, 'encryptedVersion' => $oldVersion]); + $cache->update( + $newFileInfo->getId(), [ + 'encrypted' => $oldVersion, + 'encryptedVersion' => $oldVersion, + 'size' => $oldFileInfo->getSize() + ] + ); // rollback if (self::copyFileContents($users_view, $fileToRestore, 'files' . $filename)) { diff --git a/apps/updatenotification/l10n/bg_BG.js b/apps/updatenotification/l10n/bg_BG.js index bfe17bf4533..00e2fbf90d9 100644 --- a/apps/updatenotification/l10n/bg_BG.js +++ b/apps/updatenotification/l10n/bg_BG.js @@ -6,6 +6,7 @@ OC.L10N.register( "A new version is available: %s" : "Има Нова Версия: %s", "Open updater" : "Отвори обновяването", "Your version is up to date." : "Вие разполагате с последна версия", - "Update channel:" : "Обновяване отказано:" + "Update channel:" : "Обновяване отказано:", + "You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Винаги може да оновите до по-нова версия / експирементален канал. Но неможете вече да върнете до по-стабилен канал.." }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/updatenotification/l10n/bg_BG.json b/apps/updatenotification/l10n/bg_BG.json index 7d4b4a5940b..f4b312190d6 100644 --- a/apps/updatenotification/l10n/bg_BG.json +++ b/apps/updatenotification/l10n/bg_BG.json @@ -4,6 +4,7 @@ "A new version is available: %s" : "Има Нова Версия: %s", "Open updater" : "Отвори обновяването", "Your version is up to date." : "Вие разполагате с последна версия", - "Update channel:" : "Обновяване отказано:" + "Update channel:" : "Обновяване отказано:", + "You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Винаги може да оновите до по-нова версия / експирементален канал. Но неможете вече да върнете до по-стабилен канал.." },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/updatenotification/l10n/lb.js b/apps/updatenotification/l10n/lb.js new file mode 100644 index 00000000000..e877f169fc4 --- /dev/null +++ b/apps/updatenotification/l10n/lb.js @@ -0,0 +1,15 @@ +OC.L10N.register( + "updatenotification", + { + "Update notifications" : "Notifikatiounen aktualiséieren", + "{version} is available. Get more information on how to update." : "{Versioun} ass verfügbar. Kréi méi Informatiounen doriwwer wéi d'Aktualiséierung ofleeft.", + "Updated channel" : "Aktualiséierte Kanal", + "ownCloud core" : "ownCloud Kär", + "Update for %1$s to version %2$s is available." : "D'Aktualiséierung fir %1$s op d'Versioun %2$s ass verfügbar.", + "A new version is available: %s" : "Eng nei Versioun ass verfügbar: %s", + "Open updater" : "Den Aktualiséierungsprogramm opmaachen", + "Your version is up to date." : "Déng Versioun ass aktualiséiert.", + "Checked on %s" : "Gepréift um %s", + "Update channel:" : "Kanal updaten:" +}, +"nplurals=2; plural=(n != 1);"); diff --git a/apps/updatenotification/l10n/lb.json b/apps/updatenotification/l10n/lb.json new file mode 100644 index 00000000000..a43883f6c3e --- /dev/null +++ b/apps/updatenotification/l10n/lb.json @@ -0,0 +1,13 @@ +{ "translations": { + "Update notifications" : "Notifikatiounen aktualiséieren", + "{version} is available. Get more information on how to update." : "{Versioun} ass verfügbar. Kréi méi Informatiounen doriwwer wéi d'Aktualiséierung ofleeft.", + "Updated channel" : "Aktualiséierte Kanal", + "ownCloud core" : "ownCloud Kär", + "Update for %1$s to version %2$s is available." : "D'Aktualiséierung fir %1$s op d'Versioun %2$s ass verfügbar.", + "A new version is available: %s" : "Eng nei Versioun ass verfügbar: %s", + "Open updater" : "Den Aktualiséierungsprogramm opmaachen", + "Your version is up to date." : "Déng Versioun ass aktualiséiert.", + "Checked on %s" : "Gepréift um %s", + "Update channel:" : "Kanal updaten:" +},"pluralForm" :"nplurals=2; plural=(n != 1);" +}
\ No newline at end of file diff --git a/apps/user_ldap/l10n/ast.js b/apps/user_ldap/l10n/ast.js index 9f7b3e66934..d7c76703db1 100644 --- a/apps/user_ldap/l10n/ast.js +++ b/apps/user_ldap/l10n/ast.js @@ -3,6 +3,7 @@ OC.L10N.register( { "Failed to clear the mappings." : "Hebo un fallu al desaniciar les asignaciones.", "Failed to delete the server configuration" : "Fallu al desaniciar la configuración del sirvidor", + "The configuration is invalid: anonymous bind is not allowed." : "La configuración nun ye válida: nun s'almite l'enllaz anónimu ", "The configuration is valid and the connection could be established!" : "¡La configuración ye válida y pudo afitase la conexón!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." : "La configuración ye válida, pero falló'l vínculu. Por favor, comprueba la configuración y les credenciales nel sirvidor.", "The configuration is invalid. Please have a look at the logs for further details." : "La configuración nun ye válida. Por favor, écha-y un güeyu a los rexistros pa más detalles.", @@ -10,15 +11,42 @@ OC.L10N.register( "No configuration specified" : "Nun s'especificó la configuración", "No data specified" : "Nun s'especificaron los datos", " Could not set configuration %s" : "Nun pudo afitase la configuración %s", + "Action does not exist" : "L'acción nun esiste", + "The Base DN appears to be wrong" : "La base DN paez tar mal", + "Testing configuration…" : "Probando configuración...", "Configuration incorrect" : "Configuración incorreuta", "Configuration incomplete" : "Configuración incompleta", "Configuration OK" : "Configuración correuta", "Select groups" : "Esbillar grupos", "Select object classes" : "Seleicionar la clas d'oxetu", + "Please check the credentials, they seem to be wrong." : "Por favor, compruebe les credenciales, que paecen tar mal.", + "Please specify the port, it could not be auto-detected." : "Por favor especifica'l puertu, nun puede ser detectáu automáticamente .", + "Base DN could not be auto-detected, please revise credentials, host and port." : "Base DN nun puede ser detectada automáticamente, por favor revisa les credenciales, host yá'l puertu.", + "Could not detect Base DN, please enter it manually." : "Nun se detectó base DN, por favor introduzla manualmente .", "{nthServer}. Server" : "{nthServer}. Sirvidor", + "No object found in the given Base DN. Please revise." : "Nun s'atopó nengún oxetu na Base DN dada. Por favor, revísalo.", + "More than 1,000 directory entries available." : "Más de 1.000 entraes de directoriu disponibles.", + " entries available within the provided Base DN" : "entraes disponibles dientro la Base DN proporcionada", + "An error occurred. Please check the Base DN, as well as connection settings and credentials." : "Asocedió un erru. Por favor, compruebe la Base DN , amás de la configuración de conexón y les credenciales.", "Do you really want to delete the current Server Configuration?" : "¿Daveres que quies desaniciar la configuración actual del sirvidor?", "Confirm Deletion" : "Confirmar desaniciu", + "Mappings cleared successfully!" : "¡Asignaciones borraes correutamente!", + "Error while clearing the mappings." : "Fallu mientres desaniciaben les asignaciones.", + "Anonymous bind is not allowed. Please provide a User DN and Password." : "Nun s'almite l'enllaz anónimu. Por favor apurre un usuariu DN y contraseña.", + "LDAP Operations error. Anonymous bind might not be allowed." : "Erru d'operaciones LDAP . Enllaz anónimu nun s'almite.", + "Saving failed. Please make sure the database is in Operation. Reload before continuing." : "Nun pudo guardase. Por favor asegúrate que la base de datos ta en funcionamientu. Actualiza enantes de siguir.", + "Switching the mode will enable automatic LDAP queries. Depending on your LDAP size they may take a while. Do you still want to switch the mode?" : "Cambiar el mou va habilitar les consultes LDAP automátiques . Dependiendo del to tamañu de LDAP puede llevar un tiempu. ¿Inda deseya camudar el mou?", + "Mode switch" : "Conmutar mou", "Select attributes" : "Esbillar atributos", + "User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command line validation): <br/>" : "Nun s'alcuentra l'usuariu. Encamiéntase consultar los atributos d'accesu y nome d'usuariu. Filtru efectivu (copiar y pegar pa la validación de llínea de comandos): <br/>", + "User found and settings verified." : "Usuariu atopáu y la configuración verificada.", + "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter." : "Axustes verificaos, pero atopose un usuariu . Namá'l primeru d'ellos va ser capaz d'empecipiar sesión. Considere un filtru más acutáu.", + "An unspecified error occurred. Please check the settings and the log." : "Asocedió un erru. Por favor, compruebe la configuración y el rexistru.", + "The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise." : "El filtru de busca nun ye válidu , probablemente por cuenta de problemes de sintaxis como'l númberu impar de soportes abiertos y zarraos. Por favor revisalo.", + "A connection error to LDAP / AD occurred, please check host, port and credentials." : "Asocedió un erru de conexón a LDAP / AD, por favor, comprueba'l host, el puertu y les credenciales.", + "The %uid placeholder is missing. It will be replaced with the login name when querying LDAP / AD." : "El marcador de posición %uid nun s'atopa. Va ser trocáu col nome d'entamu de sesión cuando se consulta LDAP / AD.", + "Please provide a login name to test against" : "Por favor, proporcione un nombre de inicio de sesión para comprobar en contra", + "The group box was disabled, because the LDAP / AD server does not support memberOf." : "El cuadru de grupu taba desactiváu , por mor qu'el servidor LDAP / AD nun almite memberOf .", "_%s group found_::_%s groups found_" : ["%s grupu alcontráu","%s grupos alcontraos"], "_%s user found_::_%s users found_" : ["%s usuariu alcontráu","%s usuarios alcontraos"], "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Nun deteutamos el nome d'atributu na pantalla d'usuariu. Por favor especifícalu nos axustes avanzaos de ldap", @@ -26,27 +54,52 @@ OC.L10N.register( "Invalid Host" : "Host inválidu", "Server" : "Sirvidor", "Users" : "Usuarios", + "Login Attributes" : "Los atributos d'aniciu de sesión", "Groups" : "Grupos", "Test Configuration" : "Configuración de prueba", "Help" : "Ayuda", "Groups meeting these criteria are available in %s:" : "Los grupos que cumplen estos criterios tán disponibles en %s:", + "Only these object classes:" : "Namái d'estes clases d'oxetu:", + "Only from these groups:" : "Namái d'estos grupos:", + "Search groups" : "Esbillar grupos", + "Available groups" : "Grupos disponibles", + "Selected groups" : "Grupos seleicionaos", + "Edit LDAP Query" : "Editar consulta LDAP", + "LDAP Filter:" : "Filtru LDAP:", "The filter specifies which LDAP groups shall have access to the %s instance." : "El filtru especifica qué grupos LDAP van tener accesu a %s.", + "Verify settings and count groups" : "Comprobar la configuración y grupos de recuentu", + "When logging in, %s will find the user based on the following attributes:" : "Al empecipiar sesión, %s atópase l'usuariu en función de los siguientes atributos :", + "LDAP / AD Username:" : "Nome d'usuariu LDAP / AD:", + "Allows login against the LDAP / AD username, which is either uid or samaccountname and will be detected." : "Permite la entrada en contra'l nome d'usuariu LDAP / AD, yá sía uid o samaccountname y va ser detectada.", + "LDAP / AD Email Address:" : "Direición e-mail LDAP / AD:", + "Allows login against an email attribute. Mail and mailPrimaryAddress will be allowed." : "Almite la entrada contra un atributu de corréu electrónicu. Almitirase corréu electrónicu y mailPrimaryAddress.", "Other Attributes:" : "Otros atributos:", "Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" : "Define'l filtru a aplicar cuando s'intenta identificar. %%uid va trocar al nome d'usuariu nel procesu d'identificación. Por exemplu: \"uid=%%uid\"", + "Test Loginname" : "Preba de Nome d'Aniciu de Sesión", + "Verify settings" : "Comprobar los axustes", "1. Server" : "1. Sirvidor", "%s. Server:" : "%s. Sirvidor:", + "Add a new and blank configuration" : "Amestar una configuración nueva y en blancu", + "Copy current configuration into new directory binding" : "Copiar configuración actual nel nuevu directoriu obligatoriu", + "Delete the current configuration" : "Desaniciar la configuración actual", "Host" : "Equipu", "You can omit the protocol, except you require SSL. Then start with ldaps://" : "Pues omitir el protocolu, sacantes si necesites SSL. Nesi casu, entama con ldaps://", "Port" : "Puertu", + "Detect Port" : "Detectar Puertu", "User DN" : "DN usuariu", "The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." : "El DN del usuariu veceru col que va facese l'asociación, p.ex. uid=axente,dc=exemplu,dc=com. P'accesu anónimu, dexa DN y contraseña baleros.", "Password" : "Contraseña", "For anonymous access, leave DN and Password empty." : "Pa un accesu anónimu, dexar el DN y la contraseña baleros.", "One Base DN per line" : "Un DN Base por llinia", "You can specify Base DN for users and groups in the Advanced tab" : "Pues especificar el DN base pa usuarios y grupos na llingüeta Avanzáu", + "Detect Base DN" : "Detectar Base DN", + "Test Base DN" : "Probar Base DN", "Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge." : "Evita peticiones automátiques de LDAP. Meyor pa grandes configuraciones, pero rique mayor conocimientu de LDAP.", "Manually enter LDAP filters (recommended for large directories)" : "Inxerta manualmente los filtros de LDAP (recomendáu pa direutorios llargos)", + "%s access is limited to users meeting these criteria:" : "%s accesos llendaos a los usuarios que cumplan estos criterios:", + "The most common object classes for users are organizationalPerson, person, user, and inetOrgPerson. If you are not sure which object class to select, please consult your directory admin." : "Les clases d'oxetos más comunes pa los usuarios d'Internet son organizationalPerson, persona, usuariu y inetOrgPerson . Si nun ta seguro de qué clase d'oxetu escoyer, por favor consulte al so alministrador de directorios.", "The filter specifies which LDAP users shall have access to the %s instance." : "El filtru especifica qué usuarios LDAP puen tener accesu a %s.", + "Verify settings and count users" : "Comprobar la configuración y usuarios de recuentu", "Saving" : "Guardando", "Back" : "Atrás", "Continue" : "Continuar", @@ -70,6 +123,8 @@ OC.L10N.register( "Directory Settings" : "Axustes del direutoriu", "User Display Name Field" : "Campu de nome d'usuariu a amosar", "The LDAP attribute to use to generate the user's display name." : "El campu LDAP a usar pa xenerar el nome p'amosar del usuariu.", + "2nd User Display Name Field" : "2ª usuariu amuesa Nome del campu", + "Optional. An LDAP attribute to be added to the display name in brackets. Results in e.g. »John Doe (john.doe@example.org)«." : "Opcional. Un atributu LDAP que s'amesta al nome de visualización ente paréntesis. Los resultaos en, por exemplu, »John Doe (john.doe@example.org)«.", "Base User Tree" : "Árbol base d'usuariu", "One User Base DN per line" : "Un DN Base d'Usuariu por llinia", "User Search Attributes" : "Atributos de la gueta d'usuariu", @@ -80,6 +135,8 @@ OC.L10N.register( "One Group Base DN per line" : "Un DN Base de Grupu por llinia", "Group Search Attributes" : "Atributos de gueta de grupu", "Group-Member association" : "Asociación Grupu-Miembru", + "Dynamic Group Member URL" : "URL Dinámica de Grupu d'Usuarios", + "The LDAP attribute that on group objects contains an LDAP search URL that determines what objects belong to the group. (An empty setting disables dynamic group membership functionality.)" : "L'atributu LDAP que nos oxetos de grupu contien una gueta de URLs de LDAP que determina qué oxetos pertenecen al grupu. (Un axuste vacíu desanicia la funcionalidá dinámica de pertenencia al grupu.)", "Nested Groups" : "Grupos añeraos", "When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" : "Cuando s'active, van permitise grupos que contengan otros grupos (namái funciona si l'atributu de miembru de grupu contién DNs).", "Paging chunksize" : "Tamañu de los fragmentos de paxinación", diff --git a/apps/user_ldap/l10n/ast.json b/apps/user_ldap/l10n/ast.json index 7b097287bb7..c1fbc128506 100644 --- a/apps/user_ldap/l10n/ast.json +++ b/apps/user_ldap/l10n/ast.json @@ -1,6 +1,7 @@ { "translations": { "Failed to clear the mappings." : "Hebo un fallu al desaniciar les asignaciones.", "Failed to delete the server configuration" : "Fallu al desaniciar la configuración del sirvidor", + "The configuration is invalid: anonymous bind is not allowed." : "La configuración nun ye válida: nun s'almite l'enllaz anónimu ", "The configuration is valid and the connection could be established!" : "¡La configuración ye válida y pudo afitase la conexón!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." : "La configuración ye válida, pero falló'l vínculu. Por favor, comprueba la configuración y les credenciales nel sirvidor.", "The configuration is invalid. Please have a look at the logs for further details." : "La configuración nun ye válida. Por favor, écha-y un güeyu a los rexistros pa más detalles.", @@ -8,15 +9,42 @@ "No configuration specified" : "Nun s'especificó la configuración", "No data specified" : "Nun s'especificaron los datos", " Could not set configuration %s" : "Nun pudo afitase la configuración %s", + "Action does not exist" : "L'acción nun esiste", + "The Base DN appears to be wrong" : "La base DN paez tar mal", + "Testing configuration…" : "Probando configuración...", "Configuration incorrect" : "Configuración incorreuta", "Configuration incomplete" : "Configuración incompleta", "Configuration OK" : "Configuración correuta", "Select groups" : "Esbillar grupos", "Select object classes" : "Seleicionar la clas d'oxetu", + "Please check the credentials, they seem to be wrong." : "Por favor, compruebe les credenciales, que paecen tar mal.", + "Please specify the port, it could not be auto-detected." : "Por favor especifica'l puertu, nun puede ser detectáu automáticamente .", + "Base DN could not be auto-detected, please revise credentials, host and port." : "Base DN nun puede ser detectada automáticamente, por favor revisa les credenciales, host yá'l puertu.", + "Could not detect Base DN, please enter it manually." : "Nun se detectó base DN, por favor introduzla manualmente .", "{nthServer}. Server" : "{nthServer}. Sirvidor", + "No object found in the given Base DN. Please revise." : "Nun s'atopó nengún oxetu na Base DN dada. Por favor, revísalo.", + "More than 1,000 directory entries available." : "Más de 1.000 entraes de directoriu disponibles.", + " entries available within the provided Base DN" : "entraes disponibles dientro la Base DN proporcionada", + "An error occurred. Please check the Base DN, as well as connection settings and credentials." : "Asocedió un erru. Por favor, compruebe la Base DN , amás de la configuración de conexón y les credenciales.", "Do you really want to delete the current Server Configuration?" : "¿Daveres que quies desaniciar la configuración actual del sirvidor?", "Confirm Deletion" : "Confirmar desaniciu", + "Mappings cleared successfully!" : "¡Asignaciones borraes correutamente!", + "Error while clearing the mappings." : "Fallu mientres desaniciaben les asignaciones.", + "Anonymous bind is not allowed. Please provide a User DN and Password." : "Nun s'almite l'enllaz anónimu. Por favor apurre un usuariu DN y contraseña.", + "LDAP Operations error. Anonymous bind might not be allowed." : "Erru d'operaciones LDAP . Enllaz anónimu nun s'almite.", + "Saving failed. Please make sure the database is in Operation. Reload before continuing." : "Nun pudo guardase. Por favor asegúrate que la base de datos ta en funcionamientu. Actualiza enantes de siguir.", + "Switching the mode will enable automatic LDAP queries. Depending on your LDAP size they may take a while. Do you still want to switch the mode?" : "Cambiar el mou va habilitar les consultes LDAP automátiques . Dependiendo del to tamañu de LDAP puede llevar un tiempu. ¿Inda deseya camudar el mou?", + "Mode switch" : "Conmutar mou", "Select attributes" : "Esbillar atributos", + "User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command line validation): <br/>" : "Nun s'alcuentra l'usuariu. Encamiéntase consultar los atributos d'accesu y nome d'usuariu. Filtru efectivu (copiar y pegar pa la validación de llínea de comandos): <br/>", + "User found and settings verified." : "Usuariu atopáu y la configuración verificada.", + "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter." : "Axustes verificaos, pero atopose un usuariu . Namá'l primeru d'ellos va ser capaz d'empecipiar sesión. Considere un filtru más acutáu.", + "An unspecified error occurred. Please check the settings and the log." : "Asocedió un erru. Por favor, compruebe la configuración y el rexistru.", + "The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise." : "El filtru de busca nun ye válidu , probablemente por cuenta de problemes de sintaxis como'l númberu impar de soportes abiertos y zarraos. Por favor revisalo.", + "A connection error to LDAP / AD occurred, please check host, port and credentials." : "Asocedió un erru de conexón a LDAP / AD, por favor, comprueba'l host, el puertu y les credenciales.", + "The %uid placeholder is missing. It will be replaced with the login name when querying LDAP / AD." : "El marcador de posición %uid nun s'atopa. Va ser trocáu col nome d'entamu de sesión cuando se consulta LDAP / AD.", + "Please provide a login name to test against" : "Por favor, proporcione un nombre de inicio de sesión para comprobar en contra", + "The group box was disabled, because the LDAP / AD server does not support memberOf." : "El cuadru de grupu taba desactiváu , por mor qu'el servidor LDAP / AD nun almite memberOf .", "_%s group found_::_%s groups found_" : ["%s grupu alcontráu","%s grupos alcontraos"], "_%s user found_::_%s users found_" : ["%s usuariu alcontráu","%s usuarios alcontraos"], "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Nun deteutamos el nome d'atributu na pantalla d'usuariu. Por favor especifícalu nos axustes avanzaos de ldap", @@ -24,27 +52,52 @@ "Invalid Host" : "Host inválidu", "Server" : "Sirvidor", "Users" : "Usuarios", + "Login Attributes" : "Los atributos d'aniciu de sesión", "Groups" : "Grupos", "Test Configuration" : "Configuración de prueba", "Help" : "Ayuda", "Groups meeting these criteria are available in %s:" : "Los grupos que cumplen estos criterios tán disponibles en %s:", + "Only these object classes:" : "Namái d'estes clases d'oxetu:", + "Only from these groups:" : "Namái d'estos grupos:", + "Search groups" : "Esbillar grupos", + "Available groups" : "Grupos disponibles", + "Selected groups" : "Grupos seleicionaos", + "Edit LDAP Query" : "Editar consulta LDAP", + "LDAP Filter:" : "Filtru LDAP:", "The filter specifies which LDAP groups shall have access to the %s instance." : "El filtru especifica qué grupos LDAP van tener accesu a %s.", + "Verify settings and count groups" : "Comprobar la configuración y grupos de recuentu", + "When logging in, %s will find the user based on the following attributes:" : "Al empecipiar sesión, %s atópase l'usuariu en función de los siguientes atributos :", + "LDAP / AD Username:" : "Nome d'usuariu LDAP / AD:", + "Allows login against the LDAP / AD username, which is either uid or samaccountname and will be detected." : "Permite la entrada en contra'l nome d'usuariu LDAP / AD, yá sía uid o samaccountname y va ser detectada.", + "LDAP / AD Email Address:" : "Direición e-mail LDAP / AD:", + "Allows login against an email attribute. Mail and mailPrimaryAddress will be allowed." : "Almite la entrada contra un atributu de corréu electrónicu. Almitirase corréu electrónicu y mailPrimaryAddress.", "Other Attributes:" : "Otros atributos:", "Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" : "Define'l filtru a aplicar cuando s'intenta identificar. %%uid va trocar al nome d'usuariu nel procesu d'identificación. Por exemplu: \"uid=%%uid\"", + "Test Loginname" : "Preba de Nome d'Aniciu de Sesión", + "Verify settings" : "Comprobar los axustes", "1. Server" : "1. Sirvidor", "%s. Server:" : "%s. Sirvidor:", + "Add a new and blank configuration" : "Amestar una configuración nueva y en blancu", + "Copy current configuration into new directory binding" : "Copiar configuración actual nel nuevu directoriu obligatoriu", + "Delete the current configuration" : "Desaniciar la configuración actual", "Host" : "Equipu", "You can omit the protocol, except you require SSL. Then start with ldaps://" : "Pues omitir el protocolu, sacantes si necesites SSL. Nesi casu, entama con ldaps://", "Port" : "Puertu", + "Detect Port" : "Detectar Puertu", "User DN" : "DN usuariu", "The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." : "El DN del usuariu veceru col que va facese l'asociación, p.ex. uid=axente,dc=exemplu,dc=com. P'accesu anónimu, dexa DN y contraseña baleros.", "Password" : "Contraseña", "For anonymous access, leave DN and Password empty." : "Pa un accesu anónimu, dexar el DN y la contraseña baleros.", "One Base DN per line" : "Un DN Base por llinia", "You can specify Base DN for users and groups in the Advanced tab" : "Pues especificar el DN base pa usuarios y grupos na llingüeta Avanzáu", + "Detect Base DN" : "Detectar Base DN", + "Test Base DN" : "Probar Base DN", "Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge." : "Evita peticiones automátiques de LDAP. Meyor pa grandes configuraciones, pero rique mayor conocimientu de LDAP.", "Manually enter LDAP filters (recommended for large directories)" : "Inxerta manualmente los filtros de LDAP (recomendáu pa direutorios llargos)", + "%s access is limited to users meeting these criteria:" : "%s accesos llendaos a los usuarios que cumplan estos criterios:", + "The most common object classes for users are organizationalPerson, person, user, and inetOrgPerson. If you are not sure which object class to select, please consult your directory admin." : "Les clases d'oxetos más comunes pa los usuarios d'Internet son organizationalPerson, persona, usuariu y inetOrgPerson . Si nun ta seguro de qué clase d'oxetu escoyer, por favor consulte al so alministrador de directorios.", "The filter specifies which LDAP users shall have access to the %s instance." : "El filtru especifica qué usuarios LDAP puen tener accesu a %s.", + "Verify settings and count users" : "Comprobar la configuración y usuarios de recuentu", "Saving" : "Guardando", "Back" : "Atrás", "Continue" : "Continuar", @@ -68,6 +121,8 @@ "Directory Settings" : "Axustes del direutoriu", "User Display Name Field" : "Campu de nome d'usuariu a amosar", "The LDAP attribute to use to generate the user's display name." : "El campu LDAP a usar pa xenerar el nome p'amosar del usuariu.", + "2nd User Display Name Field" : "2ª usuariu amuesa Nome del campu", + "Optional. An LDAP attribute to be added to the display name in brackets. Results in e.g. »John Doe (john.doe@example.org)«." : "Opcional. Un atributu LDAP que s'amesta al nome de visualización ente paréntesis. Los resultaos en, por exemplu, »John Doe (john.doe@example.org)«.", "Base User Tree" : "Árbol base d'usuariu", "One User Base DN per line" : "Un DN Base d'Usuariu por llinia", "User Search Attributes" : "Atributos de la gueta d'usuariu", @@ -78,6 +133,8 @@ "One Group Base DN per line" : "Un DN Base de Grupu por llinia", "Group Search Attributes" : "Atributos de gueta de grupu", "Group-Member association" : "Asociación Grupu-Miembru", + "Dynamic Group Member URL" : "URL Dinámica de Grupu d'Usuarios", + "The LDAP attribute that on group objects contains an LDAP search URL that determines what objects belong to the group. (An empty setting disables dynamic group membership functionality.)" : "L'atributu LDAP que nos oxetos de grupu contien una gueta de URLs de LDAP que determina qué oxetos pertenecen al grupu. (Un axuste vacíu desanicia la funcionalidá dinámica de pertenencia al grupu.)", "Nested Groups" : "Grupos añeraos", "When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" : "Cuando s'active, van permitise grupos que contengan otros grupos (namái funciona si l'atributu de miembru de grupu contién DNs).", "Paging chunksize" : "Tamañu de los fragmentos de paxinación", diff --git a/apps/user_ldap/l10n/lb.js b/apps/user_ldap/l10n/lb.js index b340887548e..f62d2924488 100644 --- a/apps/user_ldap/l10n/lb.js +++ b/apps/user_ldap/l10n/lb.js @@ -1,14 +1,51 @@ OC.L10N.register( "user_ldap", { + "Failed to delete the server configuration" : "D'Server-Konfiguratioun konnt net geläscht ginn", + "The configuration is invalid: anonymous bind is not allowed." : "Dës Konfiguratioun ass ongëlteg: eng anonym Bindung ass net erlaabt.", + "Action does not exist" : "Dës Aktioun gëtt et net", + "Testing configuration…" : "D'Konfiguratioun gëtt getest...", + "Configuration incorrect" : "D'Konfiguratioun ass net korrekt", + "Configuration incomplete" : "D'Konfiguratioun ass net komplett", + "Configuration OK" : "Konfiguratioun OK", + "Select groups" : "Wiel Gruppen äus", + "Saving failed. Please make sure the database is in Operation. Reload before continuing." : "D'Späicheren huet net geklappt. W.e.g. géi sécher dass Datebank an der Operatioun ass. Lued nach emol éiers de weider fiers.", + "Select attributes" : "Wiel Attributer aus", + "User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command line validation): <br/>" : "De Benotzer konnt net fonnt ginn. W.e.g. kuck deng Login Attributer a Benotzernumm no. \n ", + "_%s group found_::_%s groups found_" : ["%s Grupp fonnt","%s Gruppe fonnt"], + "_%s user found_::_%s users found_" : ["%s Benotzer fonnt","%s Benotzere fonnt"], + "Could not find the desired feature" : "Déi gewënschte Funktioun konnt net fonnt ginn", + "Server" : "Server", "Users" : "Benotzer", "Groups" : "Gruppen", + "Test Configuration" : "Konfiguratiounstest", "Help" : "Hëllef", + "Groups meeting these criteria are available in %s:" : "D'Gruppen, déi dës Critèren erfëllen sinn am %s:", + "Only these object classes:" : "Nëmmen des Klass vun Objeten:", + "Only from these groups:" : "Nëmme vun dëse Gruppen:", + "Search groups" : "Sich Gruppen", + "Available groups" : "Disponibel Gruppen", + "Selected groups" : "Ausgewielte Gruppen", + "Test Loginname" : "Test Benotzernumm", + "Verify settings" : "Astellungen iwwerpréiwen", + "1. Server" : "1. Server", + "%s. Server:" : "%s. Server", + "Delete the current configuration" : "Läsch déi aktuell Konfiguratioun", "Host" : "Host", "Port" : "Port", + "User DN" : "Benotzer DN", "Password" : "Passwuert", + "Saving" : "Speicheren...", "Back" : "Zeréck", "Continue" : "Weider", - "Advanced" : "Avancéiert" + "Advanced" : "Erweidert", + "Connection Settings" : "D'Astellunge vun der Verbindung", + "Configuration Active" : "D'Konfiguratioun ass aktiv", + "When unchecked, this configuration will be skipped." : "Ouni Iwwerpréiwung wäert dës Konfiguratioun iwwergaange ginn.", + "Directory Settings" : "Dossier's Astellungen", + "in bytes" : "A Bytes", + "Email Field" : "Email Feld", + "Internal Username" : "Interne Benotzernumm", + "Internal Username Attribute:" : "Interne Benotzernumm Attribut:" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/user_ldap/l10n/lb.json b/apps/user_ldap/l10n/lb.json index 4b4d46427b8..e869a5821b1 100644 --- a/apps/user_ldap/l10n/lb.json +++ b/apps/user_ldap/l10n/lb.json @@ -1,12 +1,49 @@ { "translations": { + "Failed to delete the server configuration" : "D'Server-Konfiguratioun konnt net geläscht ginn", + "The configuration is invalid: anonymous bind is not allowed." : "Dës Konfiguratioun ass ongëlteg: eng anonym Bindung ass net erlaabt.", + "Action does not exist" : "Dës Aktioun gëtt et net", + "Testing configuration…" : "D'Konfiguratioun gëtt getest...", + "Configuration incorrect" : "D'Konfiguratioun ass net korrekt", + "Configuration incomplete" : "D'Konfiguratioun ass net komplett", + "Configuration OK" : "Konfiguratioun OK", + "Select groups" : "Wiel Gruppen äus", + "Saving failed. Please make sure the database is in Operation. Reload before continuing." : "D'Späicheren huet net geklappt. W.e.g. géi sécher dass Datebank an der Operatioun ass. Lued nach emol éiers de weider fiers.", + "Select attributes" : "Wiel Attributer aus", + "User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command line validation): <br/>" : "De Benotzer konnt net fonnt ginn. W.e.g. kuck deng Login Attributer a Benotzernumm no. \n ", + "_%s group found_::_%s groups found_" : ["%s Grupp fonnt","%s Gruppe fonnt"], + "_%s user found_::_%s users found_" : ["%s Benotzer fonnt","%s Benotzere fonnt"], + "Could not find the desired feature" : "Déi gewënschte Funktioun konnt net fonnt ginn", + "Server" : "Server", "Users" : "Benotzer", "Groups" : "Gruppen", + "Test Configuration" : "Konfiguratiounstest", "Help" : "Hëllef", + "Groups meeting these criteria are available in %s:" : "D'Gruppen, déi dës Critèren erfëllen sinn am %s:", + "Only these object classes:" : "Nëmmen des Klass vun Objeten:", + "Only from these groups:" : "Nëmme vun dëse Gruppen:", + "Search groups" : "Sich Gruppen", + "Available groups" : "Disponibel Gruppen", + "Selected groups" : "Ausgewielte Gruppen", + "Test Loginname" : "Test Benotzernumm", + "Verify settings" : "Astellungen iwwerpréiwen", + "1. Server" : "1. Server", + "%s. Server:" : "%s. Server", + "Delete the current configuration" : "Läsch déi aktuell Konfiguratioun", "Host" : "Host", "Port" : "Port", + "User DN" : "Benotzer DN", "Password" : "Passwuert", + "Saving" : "Speicheren...", "Back" : "Zeréck", "Continue" : "Weider", - "Advanced" : "Avancéiert" + "Advanced" : "Erweidert", + "Connection Settings" : "D'Astellunge vun der Verbindung", + "Configuration Active" : "D'Konfiguratioun ass aktiv", + "When unchecked, this configuration will be skipped." : "Ouni Iwwerpréiwung wäert dës Konfiguratioun iwwergaange ginn.", + "Directory Settings" : "Dossier's Astellungen", + "in bytes" : "A Bytes", + "Email Field" : "Email Feld", + "Internal Username" : "Interne Benotzernumm", + "Internal Username Attribute:" : "Interne Benotzernumm Attribut:" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index daeb7d942a4..4d0753696ff 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -732,7 +732,14 @@ class Access extends LDAPUtility implements IUserTools { $user->unmark(); $user = $this->userManager->get($ocName); } - $user->processAttributes($userRecord); + if ($user !== null) { + $user->processAttributes($userRecord); + } else { + \OC::$server->getLogger()->debug( + "The ldap user manager returned null for $ocName", + ['app'=>'user_ldap'] + ); + } } } |