]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cleanup.
authorThomas Tanghus <thomas@tanghus.net>
Tue, 5 Jun 2012 22:26:21 +0000 (00:26 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Tue, 5 Jun 2012 23:06:13 +0000 (01:06 +0200)
12 files changed:
apps/contacts/ajax/addcontact.php
apps/contacts/ajax/addproperty.php
apps/contacts/ajax/contactdetails.php
apps/contacts/ajax/cropphoto.php
apps/contacts/ajax/deletebook.php
apps/contacts/ajax/deletecard.php
apps/contacts/ajax/deleteproperty.php
apps/contacts/ajax/editname.php
apps/contacts/ajax/loadcard.php
apps/contacts/ajax/loadphoto.php
apps/contacts/ajax/saveproperty.php
apps/contacts/ajax/uploadimport.php

index ee451098f1dad6185a76b3c308ec437ca12d88e2..af9b2bbcc0e4ccc810432a679938e51db30ccaf2 100644 (file)
  *
  */
 
-// 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);
index bf23df6758509d688f1c434dd5009212824adda2..4668c0d3a65384f0489661e46bbee36aa5d41878 100644 (file)
@@ -20,9 +20,6 @@
  *
  */
 
-// Init owncloud
-
 // Check if we are a user
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('contacts');
index 657dc5d586c6aaf17c74f74c42f2e53af2d1762e..a6ca10f9c942ab591d4dc09eeb81e69e22c31a7b 100644 (file)
@@ -19,8 +19,6 @@
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-
-// Init owncloud
  
 function bailOut($msg) {
        OCP\JSON::error(array('data' => array('message' => $msg)));
@@ -42,18 +40,6 @@ if(is_null($vcard)) {
 }
 $details = OC_Contacts_VCard::structureContact($vcard);
 
-// Some Google exported files have no FN field.
-/*if(!isset($details['FN'])) {
-       $fn = '';
-       if(isset($details['N'])) {
-               $details['FN'] = array(implode(' ', $details['N'][0]['value']));
-       } elseif(isset($details['EMAIL'])) {
-               $details['FN'] = array('value' => $details['EMAIL'][0]['value']);
-       } else {
-               $details['FN'] = array('value' => OC_Contacts_App::$l10n->t('Unknown'));
-       }
-}*/
-
 // Make up for not supporting the 'N' field in earlier version.
 if(!isset($details['N'])) {
        $details['N'] = array();
index 63c9eb8f2d32782fb9fa57748cbaf9cf22c07459..caba7c8c4efee77dda5c3eb3ace10003286e92f7 100644 (file)
  *
  */
 
-// Init owncloud
-
 // Check if we are a user
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('contacts');
 
 $tmpkey = $_GET['tmpkey'];
 $id = $_GET['id'];
-//OCP\Util::writeLog('contacts','ajax/cropphoto.php: tmpkey: '.$tmpkey.', exists: '.file_exists($tmp_path), OCP\Util::DEBUG);
 $tmpl = new OCP\Template("contacts", "part.cropphoto");
 $tmpl->assign('tmpkey', $tmpkey);
 $tmpl->assign('id', $id);
index bcf6aa4432967f78135fe16a033cc42be8000ace..fe582daa00f2fb9ebe7861f8cc5dc640a0cf5ce5 100644 (file)
@@ -20,9 +20,6 @@
  *
  */
 
-// Init owncloud
-
 // Check if we are a user
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('contacts');
index 46fd8252d472d296267b00748e3a1d176b68152d..6414fda93cb1be83f0fc693c44b1451cfd2ec6d2 100644 (file)
@@ -25,9 +25,6 @@ function bailOut($msg) {
        exit();
 }
 
-// Init owncloud
-
 // Check if we are a user
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('contacts');
index 9bb1208cdd1bc574311d457bee4702f38cbfab1c..b0746d18a7973a095b36d8607d7a3eaa0b140ea7 100644 (file)
@@ -20,9 +20,6 @@
  *
  */
 
-// Init owncloud
-
 // Check if we are a user
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('contacts');
index 9ba280ae54278b0140fef8d7b2fd4c549b39d9fc..d06d416b7ed2beba9f0f1967e0d721eb0ca7e3b0 100644 (file)
@@ -14,14 +14,11 @@ function bailOut($msg) {
        OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG);
        exit();
 }
-function debug($msg) {
-       OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG);
-}
 
 $tmpl = new OCP\Template("contacts", "part.edit_name_dialog");
 
 $id = isset($_GET['id'])?$_GET['id']:'';
-debug('id: '.$id);
+
 if($id) {
        $vcard = OC_Contacts_App::getContactVCard($id);
        $name = array('', '', '', '', '');
index 4e6f2206fef455ab41ed49f61f8024800a8cd846..fbb831f4a1260a739c1d4213dd67749ebc7ce3b3 100644 (file)
  *
  */
 
-// Init owncloud
-function bailOut($msg) {
-       OCP\JSON::error(array('data' => array('message' => $msg)));
-       OCP\Util::writeLog('contacts','ajax/loadcard.php: '.$msg, OCP\Util::DEBUG);
-       exit();
-}
-function debug($msg) {
-       OCP\Util::writeLog('contacts','ajax/loadcard.php: '.$msg, OCP\Util::DEBUG);
-}
-// foreach ($_POST as $key=>$element) {
-//     debug('_POST: '.$key.'=>'.$element);
-// }
-
 // Check if we are a user
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('contacts');
index ef429e82891c6fea9c8d96ea02457e01166b513c..eac7ca7d02f18d6184a0482d7777008ddb5a34bc 100644 (file)
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-// Init owncloud
  
 // Check if we are a user
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('contacts');
 
-// foreach ($_POST as $key=>$element) {
-//     OCP\Util::writeLog('contacts','ajax/savecrop.php: '.$key.'=>'.$element, OCP\Util::DEBUG);
-// }
-
 function bailOut($msg) {
        OCP\JSON::error(array('data' => array('message' => $msg)));
        OCP\Util::writeLog('contacts','ajax/loadphoto.php: '.$msg, OCP\Util::DEBUG);
        exit();
 }
 
-$image = null;
-
 $id = isset($_GET['id']) ? $_GET['id'] : '';
 $refresh = isset($_GET['refresh']) ? true : false;
 
index 6509ac21f280d959de9a4815de1e98ffbe0c3767..8409ffe47f2f85e197d864de9cebd65f2a6d64aa 100644 (file)
@@ -20,9 +20,6 @@
  *
  */
 
-// Init owncloud
-
 // Check if we are a user
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('contacts');
@@ -35,21 +32,12 @@ function bailOut($msg) {
 function debug($msg) {
        OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG);
 }
-// foreach ($_POST as $key=>$element) {
-//     debug('_POST: '.$key.'=>'.print_r($element, true));
-// }
 
 $id = isset($_POST['id'])?$_POST['id']:null;
 $name = isset($_POST['name'])?$_POST['name']:null;
 $value = isset($_POST['value'])?$_POST['value']:null;
 $parameters = isset($_POST['parameters'])?$_POST['parameters']:null;
 $checksum = isset($_POST['checksum'])?$_POST['checksum']:null;
-// if(!is_null($parameters)) {
-//     debug('parameters: '.count($parameters));
-//     foreach($parameters as $key=>$val ) {
-//             debug('parameter: '.$key.'=>'.implode('/',$val));
-//     }
-// }
 
 if(!$name) {
        bailOut(OC_Contacts_App::$l10n->t('element name is not set.'));
index b11f380fa8a885322bf0d766db2dd1842b72128f..463ca161e566abe79e58a207ae0014be0101ea24 100644 (file)
@@ -28,9 +28,6 @@ function bailOut($msg) {
        OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::ERROR);
        exit();
 }
-function debug($msg) {
-       OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::DEBUG);
-}
 
 $view = OCP\Files::getStorage('contacts');
 $tmpfile = md5(rand());
@@ -39,7 +36,6 @@ $tmpfile = md5(rand());
 $fn = (isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : false);
 if($fn) {
        if($view->file_put_contents('/'.$tmpfile, file_get_contents('php://input'))) {
-               debug($fn.' uploaded');
                OCP\JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile)));
                exit();
        } else {
@@ -70,7 +66,6 @@ $file=$_FILES['importfile'];
 $tmpfname = tempnam(get_temp_dir(), "occOrig");
 if(file_exists($file['tmp_name'])) {
        if($view->file_put_contents('/'.$tmpfile, file_get_contents($file['tmp_name']))) {
-               debug($fn.' uploaded');
                OCP\JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile)));
        } else {
                bailOut(OC_Contacts_App::$l10n->t('Error uploading contacts to storage.'));