summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/addcontact.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-06 00:26:21 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-06 01:06:13 +0200
commit68670bcc66603540e39c055b8fe8c6a75055b5b0 (patch)
tree6341deb5fa16e0f70aa48e016e6eb51919398937 /apps/contacts/ajax/addcontact.php
parent624f8ae36dc7f61db07da30644e2ca88b0a0de5e (diff)
downloadnextcloud-server-68670bcc66603540e39c055b8fe8c6a75055b5b0.tar.gz
nextcloud-server-68670bcc66603540e39c055b8fe8c6a75055b5b0.zip
Cleanup.
Diffstat (limited to 'apps/contacts/ajax/addcontact.php')
-rw-r--r--apps/contacts/ajax/addcontact.php17
1 files changed, 1 insertions, 16 deletions
diff --git a/apps/contacts/ajax/addcontact.php b/apps/contacts/ajax/addcontact.php
index ee451098f1d..af9b2bbcc0e 100644
--- a/apps/contacts/ajax/addcontact.php
+++ b/apps/contacts/ajax/addcontact.php
@@ -20,25 +20,10 @@
*
*/
-// Init owncloud
-
-function bailOut($msg) {
- OCP\JSON::error(array('data' => array('message' => $msg)));
- OCP\Util::writeLog('contacts','ajax/addcontact.php: '.$msg, OCP\Util::DEBUG);
- exit();
-}
-function debug($msg) {
- OCP\Util::writeLog('contacts','ajax/addcontact.php: '.$msg, OCP\Util::DEBUG);
-}
-
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
-foreach ($_POST as $key=>$element) {
- debug('_POST: '.$key.'=>'.$element);
-}
-
$aid = isset($_POST['aid'])?$_POST['aid']:null;
if(!$aid) {
$aid = min(OC_Contacts_Addressbook::activeIds()); // first active addressbook.
@@ -54,7 +39,7 @@ $vcard->setUID();
$vcard->setString('FN',$fn);
$vcard->setString('N',$n);
-$id = OC_Contacts_VCard::add($aid,$vcard, null, $isnew);
+$id = OC_Contacts_VCard::add($aid, $vcard, null, $isnew);
if(!$id) {
OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('There was an error adding the contact.'))));
OCP\Util::writeLog('contacts','ajax/addcontact.php: Recieved non-positive ID on adding card: '.$id, OCP\Util::ERROR);