summaryrefslogtreecommitdiffstats
path: root/apps/contacts/photo.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-02-11 21:48:45 +0100
committerBart Visscher <bartv@thisnet.nl>2012-02-12 15:14:23 +0100
commitc4ee924869fde31d41c47cd05d0f6c9ff4c16bdf (patch)
treedf956456308f7ff86c87b56634df93fc532e1d47 /apps/contacts/photo.php
parent192b8906a38aed893b9148954beaf6af85035d40 (diff)
downloadnextcloud-server-c4ee924869fde31d41c47cd05d0f6c9ff4c16bdf.tar.gz
nextcloud-server-c4ee924869fde31d41c47cd05d0f6c9ff4c16bdf.zip
Cleanup OC_Contacts_Addressbook::find usage
Use OC_Contacts_App::getAddressbook($id) instead of OC_Contacts_Addressbook::find($id), it contains access checks.
Diffstat (limited to 'apps/contacts/photo.php')
-rw-r--r--apps/contacts/photo.php14
1 files changed, 1 insertions, 13 deletions
diff --git a/apps/contacts/photo.php b/apps/contacts/photo.php
index 756aae63c4d..9566764e70a 100644
--- a/apps/contacts/photo.php
+++ b/apps/contacts/photo.php
@@ -31,19 +31,7 @@ if(isset($GET['refresh'])) {
}
$l10n = new OC_L10N('contacts');
-$card = OC_Contacts_VCard::find( $id );
-if( $card === false ){
- echo $l10n->t('Contact could not be found.');
- exit();
-}
-
-$addressbook = OC_Contacts_Addressbook::find( $card['addressbookid'] );
-if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
- echo $l10n->t('This is not your contact.'); // This is a weird error, why would it come up? (Better feedback for users?)
- exit();
-}
-
-$content = OC_VObject::parse($card['carddata']);
+$content = OC_Contacts_App::getContactVCard($id);
$image = new OC_Image();
// invalid vcard
if( is_null($content)){