Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d0d1684
add overflow ellipsis to session and device tokens list
ChristophWurst Jun 9, 2016
a9ea908
add tooltip to token names
ChristophWurst Jun 10, 2016
663459c
rearrange personal settings sections
ChristophWurst Jun 10, 2016
5d1ef68
Give mysql docker more time to start up
DeepDiver1975 May 9, 2016
bac96e7
Wait for port being accessible in addition to the notify socket
DeepDiver1975 May 11, 2016
a5a66f3
Fix tooltip position in token list
Jun 17, 2016
c4149c5
use token last_activity instead of session value
ChristophWurst Jun 17, 2016
0c0a216
store last check timestamp in token instead of session
ChristophWurst Jun 17, 2016
1889df5
dont create a session token for clients, validate the app password in…
ChristophWurst Jun 17, 2016
8ef5431
fix user session tests
ChristophWurst Jun 20, 2016
9d74ff0
fix nitpick
ChristophWurst Jun 20, 2016
5c68084
fix default token provider tests
ChristophWurst Jun 20, 2016
fb36fd4
fix DefaultTokenMapperTest
ChristophWurst Jun 20, 2016
56199eb
fix unit test warning/errors
ChristophWurst Jun 20, 2016
b805908
update session token password on user password change
ChristophWurst Jun 21, 2016
ca16826
Filter out group shares for owner where owner is included (#25190)
Jun 21, 2016
db11c20
pass new password instead of username
ChristophWurst Jun 21, 2016
af98e3e
Merge pull request #25042 from owncloud/session-settings-ellipsis
Jun 21, 2016
f2f1eab
fix broken unit test (#25198)
DeepDiver1975 Jun 21, 2016
1452b74
Contacts API: replace raw image data with url (#25081)
georgehrke Jun 21, 2016
195fc5b
Merge pull request #25196 from owncloud/update-session-token-password
ChristophWurst Jun 21, 2016
7f22aeb
redirect to new login route (#25099)
ChristophWurst Jun 21, 2016
755c86e
Merge pull request #24505 from owncloud/ceph-wait-for-http
Jun 21, 2016
704a993
Fix null pointer exception in user_ldap (#25062)
butonic Jun 21, 2016
31f3aaa
app passwords/device tokens wording
ChristophWurst Jun 16, 2016
2c1db51
fix tranlations
ChristophWurst Jun 16, 2016
178fa11
use theme name instead of hard-coded 'ownCloud'
ChristophWurst Jun 16, 2016
c8b7a05
Fire hooks for mkdir for folder upload
karakayasemi Jun 21, 2016
b85bccc
[tx-robot] updated from transifex
Jun 22, 2016
c49ff83
Merge pull request #25208 from owncloud/uploadfolder-firemkdirhooksfo…
Jun 22, 2016
3e763ac
Add timeouts to make the UI usable again when a remote share is unrea…
nickvergessen Jun 15, 2016
ec968a4
Increase fed share timeout from 3 to 10 + unit tests
Jun 21, 2016
854352d
occ web executor (#24957)
VicDeo Jun 22, 2016
eed1c52
Hide more default options in occ files_external:list
icewind1991 Jun 22, 2016
293ae8a
Merge pull request #25134 from owncloud/app-passwords
Jun 22, 2016
3db5de9
Merge pull request #25172 from owncloud/token-login-validation
Jun 22, 2016
fa3dc90
Rollback version must also adjust cached size
Jun 22, 2016
963d8a8
Merge pull request #25123 from owncloud/issue-23005-broken-remote-shares
Jun 22, 2016
d5f4328
Merge pull request #25223 from owncloud/external-list-default-options
Jun 22, 2016
ae50e72
Merge pull request #25225 from owncloud/enc-revertversionsize
Jun 22, 2016
4a2fb1b
Init the headers in iedavclient.js
Jun 22, 2016
d47262e
Merge pull request #25233 from owncloud/iedavclient-nullheaders
MorrisJobke Jun 22, 2016
1e1903e
[tx-robot] updated from transifex
Jun 23, 2016
508c580
Fix trashed file name corruption when rerendering trashbin list
Jun 23, 2016
97f1813
Don't reload page in case of auth errors during setup checks
Jun 23, 2016
bac1a3a
Add option to `occ files_external:list` to show all configured mounts
icewind1991 Jun 17, 2016
cc2aec1
Merge pull request #25238 from owncloud/files-trashlistnamecorruption
Jun 23, 2016
29068d3
[tx-robot] updated from transifex
Jun 24, 2016
dc78d26
Merge pull request #25239 from owncloud/setupchecks-preventreload
Jun 24, 2016
56ad4cd
Show error message when posting an invalid comment
Jun 24, 2016
04e3da0
Merge pull request #25171 from owncloud/files_external-list-all
Jun 24, 2016
bf3ee69
Fix search result link for file results outside default list
Jun 24, 2016
39b533d
Hide search results after switching directory
Jun 24, 2016
e9a0a6d
Merge pull request #25257 from owncloud/comments-showerroronsave
ChristophWurst Jun 24, 2016
c295523
Merge pull request #25259 from owncloud/search-fixsearchfromotherfile…
ChristophWurst Jun 24, 2016
3d65979
[tx-robot] updated from transifex
Jun 25, 2016
52eab2a
[tx-robot] updated from transifex
Jun 26, 2016
7a9d60d
Merge remote-tracking branch 'upstream/master' into master-upstream-sync
LukasReschke Jun 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/comments/js/commentstabview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}));
}
});

Expand Down Expand Up @@ -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 {
Expand All @@ -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'));
}
});
}
Expand Down
1 change: 1 addition & 0 deletions apps/comments/l10n/bg_BG.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ OC.L10N.register(
{
"Type in a new comment..." : "Напиши нов коментар...",
"Delete comment" : "Изтрий коментар",
"Post" : "Публикация",
"Cancel" : "Отказ",
"Edit comment" : "Редактирай коментра",
"[Deleted user]" : "[Изтрит потребител]",
Expand Down
1 change: 1 addition & 0 deletions apps/comments/l10n/bg_BG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ "translations": {
"Type in a new comment..." : "Напиши нов коментар...",
"Delete comment" : "Изтрий коментар",
"Post" : "Публикация",
"Cancel" : "Отказ",
"Edit comment" : "Редактирай коментра",
"[Deleted user]" : "[Изтрит потребител]",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/cs_CZ.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/de_DE.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/he.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 2 additions & 1 deletion apps/comments/l10n/lb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ OC.L10N.register(
"comments",
{
"Cancel" : "Ofbriechen",
"Save" : "Späicheren"
"Save" : "Späicheren",
"Comment" : "Kommentar"
},
"nplurals=2; plural=(n != 1);");
3 changes: 2 additions & 1 deletion apps/comments/l10n/lb.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ "translations": {
"Cancel" : "Ofbriechen",
"Save" : "Späicheren"
"Save" : "Späicheren",
"Comment" : "Kommentar"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
3 changes: 3 additions & 0 deletions apps/comments/l10n/sq.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
3 changes: 3 additions & 0 deletions apps/comments/l10n/sq.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
Expand Down
1 change: 1 addition & 0 deletions apps/dav/appinfo/v1/carddav.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
}

$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!
Expand Down
3 changes: 2 additions & 1 deletion apps/dav/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public function __construct (array $urlParams=array()) {
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() {
Expand Down
44 changes: 34 additions & 10 deletions apps/dav/lib/CardDAV/AddressBookImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

use OCP\Constants;
use OCP\IAddressBook;
use OCP\IURLGenerator;
use Sabre\VObject\Component\VCard;
use Sabre\VObject\Property\Text;
use Sabre\VObject\Reader;
Expand All @@ -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;
}

/**
Expand Down Expand Up @@ -83,11 +90,11 @@ public function getDisplayName() {
* @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;
Expand All @@ -100,13 +107,12 @@ public function search($pattern, $searchProperties, $options) {
*/
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;
Expand All @@ -122,7 +128,7 @@ public function createOrUpdate($properties) {
$this->backend->createCard($this->getKey(), $uri, $vCard->serialize());
}

return $this->vCard2Array($vCard);
return $this->vCard2Array($uri, $vCard);

}

Expand Down Expand Up @@ -207,13 +213,31 @@ protected function createEmptyVCard($uid) {
/**
* 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') {
Expand Down
8 changes: 5 additions & 3 deletions apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,16 +780,18 @@ public function search($addressBookId, $pattern, $searchProperties) {
}
$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();
$cards = $result->fetchAll();

$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);
}

/**
Expand Down
14 changes: 9 additions & 5 deletions apps/dav/lib/CardDAV/ContactsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
namespace OCA\DAV\CardDAV;

use OCP\Contacts\IManager;
use OCP\IURLGenerator;

class ContactsManager {

Expand All @@ -37,26 +38,29 @@ public function __construct(CardDavBackend $backend) {
/**
* @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
)
);
}
Expand Down
Loading