summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-03-29 15:24:32 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-03-29 15:25:24 +0200
commit11f7eeb63a441a71ab90ea31001471562215a94d (patch)
treeebf1721cc08f9b483fd9561560fe2c06333fc828 /apps/contacts/ajax
parentb559952806d1af4e20853d60fc339828b28b9a71 (diff)
downloadnextcloud-server-11f7eeb63a441a71ab90ea31001471562215a94d.tar.gz
nextcloud-server-11f7eeb63a441a71ab90ea31001471562215a94d.zip
Improve actions on delete.
Diffstat (limited to 'apps/contacts/ajax')
-rw-r--r--apps/contacts/ajax/deletecard.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/contacts/ajax/deletecard.php b/apps/contacts/ajax/deletecard.php
index e26dfd6ebfe..5675aef5f15 100644
--- a/apps/contacts/ajax/deletecard.php
+++ b/apps/contacts/ajax/deletecard.php
@@ -19,6 +19,11 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
+function bailOut($msg) {
+ OC_JSON::error(array('data' => array('message' => $msg)));
+ OC_Log::write('contacts','ajax/saveproperty.php: '.$msg, OC_Log::DEBUG);
+ exit();
+}
// Init owncloud
require_once('../../../lib/base.php');
@@ -27,7 +32,10 @@ require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('contacts');
-$id = $_GET['id'];
+$id = isset($_GET['id'])?$_GET['id']:null;
+if(!$id) {
+ bailOut(OC_Contacts_App::$l10n->t('id is not set.'));
+}
$card = OC_Contacts_App::getContactObject( $id );
OC_Contacts_VCard::delete($id);