Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-12-07 01:31:04 +0400
committerBart Visscher <bartv@thisnet.nl>2011-12-07 23:40:59 +0400
commit7e990a8e5c5bf266bd3fe36cd5bb99e49c6adb1e (patch)
tree01b639d59265fa14a359409c0617bfe8e65c0090 /apps/contacts/ajax/showaddproperty.php
parent247146f7036984e0ae7a6719e8adfca6c2251079 (diff)
Contacts: refactor common ajax functions to OC_Contacts_App
Diffstat (limited to 'apps/contacts/ajax/showaddproperty.php')
-rw-r--r--apps/contacts/ajax/showaddproperty.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/apps/contacts/ajax/showaddproperty.php b/apps/contacts/ajax/showaddproperty.php
index f87cd05359b..30eb7634f80 100644
--- a/apps/contacts/ajax/showaddproperty.php
+++ b/apps/contacts/ajax/showaddproperty.php
@@ -23,24 +23,12 @@
// Init owncloud
require_once('../../../lib/base.php');
-$id = $_GET['id'];
-$l10n = new OC_L10N('contacts');
-
// Check if we are a user
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('contacts');
-$card = OC_Contacts_VCard::find( $id );
-if( $card === false ){
- OC_JSON::error(array('data' => array( 'message' => $l10n->t('Contact could not be found.'))));
- exit();
-}
-
-$addressbook = OC_Contacts_Addressbook::find( $card['addressbookid'] );
-if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
- OC_JSON::error(array('data' => array( 'message' => $l10n->t('This is not your contact.'))));
- exit();
-}
+$id = $_GET['id'];
+$card = OC_Contacts_App::getContactObject( $id );
$tmpl = new OC_Template('contacts','part.addpropertyform');
$tmpl->assign('id',$id);