1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-19 08:52:22 +01:00

Contacts: Correct variable name.

This commit is contained in:
Thomas Tanghus 2012-11-26 20:36:31 +01:00
parent 5abe44120d
commit e8375b1217

View File

@ -545,22 +545,22 @@ class VCard {
* @return boolean true on success, otherwise an exception will be thrown * @return boolean true on success, otherwise an exception will be thrown
*/ */
public static function delete($id) { public static function delete($id) {
$vcard = self::find($id); $contact = self::find($id);
if (!$vcard) { if (!$contact) {
\OCP\Util::writeLog('contacts', __METHOD__.', id: ' \OCP\Util::writeLog('contacts', __METHOD__.', id: '
. $id . ' not found.', \OCP\Util::DEBUG); . $id . ' not found.', \OCP\Util::DEBUG);
throw new \Exception( throw new \Exception(
App::$l10n->t( App::$l10n->t(
'Could not find the vCard with ID: ' . $id 'Could not find the vCard with ID: ' . $id, 404
) )
); );
} }
$addressbook = Addressbook::find($vcard['addressbookid']); $addressbook = Addressbook::find($contact['addressbookid']);
if(!$addressbook) { if(!$addressbook) {
throw new \Exception( throw new \Exception(
App::$l10n->t( App::$l10n->t(
'Could not find the Addressbook with ID: ' 'Could not find the Addressbook with ID: '
. $vcard['addressbookid'] . $contact['addressbookid'], 404
) )
); );
} }
@ -570,7 +570,7 @@ class VCard {
. $addressbook['userid'] . ' != ' . \OCP\User::getUser(), \OCP\Util::DEBUG); . $addressbook['userid'] . ' != ' . \OCP\User::getUser(), \OCP\Util::DEBUG);
$sharedAddressbook = \OCP\Share::getItemSharedWithBySource( $sharedAddressbook = \OCP\Share::getItemSharedWithBySource(
'addressbook', 'addressbook',
$vcard['addressbookid'], $contact['addressbookid'],
\OCP\Share::FORMAT_NONE, null, true); \OCP\Share::FORMAT_NONE, null, true);
$sharedContact = \OCP\Share::getItemSharedWithBySource( $sharedContact = \OCP\Share::getItemSharedWithBySource(
'contact', 'contact',
@ -589,12 +589,12 @@ class VCard {
if (!($permissions & \OCP\PERMISSION_DELETE)) { if (!($permissions & \OCP\PERMISSION_DELETE)) {
throw new \Exception( throw new \Exception(
App::$l10n->t( App::$l10n->t(
'You do not have the permissions to delete this contact.' 'You do not have the permissions to delete this contact.', 403
) )
); );
} }
} }
$aid = $card['addressbookid']; $aid = $contact['addressbookid'];
\OC_Hook::emit('\OCA\Contacts\VCard', 'pre_deleteVCard', \OC_Hook::emit('\OCA\Contacts\VCard', 'pre_deleteVCard',
array('aid' => null, 'id' => $id, 'uri' => null) array('aid' => null, 'id' => $id, 'uri' => null)
); );