diff options
Diffstat (limited to 'apps/contacts/ajax')
31 files changed, 124 insertions, 124 deletions
diff --git a/apps/contacts/ajax/activation.php b/apps/contacts/ajax/activation.php index b45d1a6ccbe..388a3b5438c 100755 --- a/apps/contacts/ajax/activation.php +++ b/apps/contacts/ajax/activation.php @@ -8,19 +8,19 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $bookid = $_POST['bookid']; $book = OC_Contacts_App::getAddressbook($bookid);// is owner access check if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { OCP\Util::writeLog('contacts','ajax/activation.php: Error activating addressbook: '.$bookid, OCP\Util::ERROR); - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error (de)activating addressbook.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error (de)activating addressbook.')))); exit(); } -OC_JSON::success(array( +OCP\JSON::success(array( 'active' => OC_Contacts_Addressbook::isActive($bookid), 'bookid' => $bookid, 'book' => $book, diff --git a/apps/contacts/ajax/addbook.php b/apps/contacts/ajax/addbook.php index f466d57e12e..254af1c3f50 100644..100755 --- a/apps/contacts/ajax/addbook.php +++ b/apps/contacts/ajax/addbook.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $book = array( 'id' => 'new', 'displayname' => '', diff --git a/apps/contacts/ajax/addcontact.php b/apps/contacts/ajax/addcontact.php index d87cbabe819..dc083df1fa5 100755 --- a/apps/contacts/ajax/addcontact.php +++ b/apps/contacts/ajax/addcontact.php @@ -23,7 +23,7 @@ // Init owncloud function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/addcontact.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -32,8 +32,8 @@ function debug($msg) { } // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); foreach ($_POST as $key=>$element) { debug('_POST: '.$key.'=>'.$element); @@ -55,9 +55,9 @@ $vcard->setString('N',$n); $id = OC_Contacts_VCard::add($aid,$vcard); if(!$id) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('There was an error adding the contact.')))); + 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); exit(); } -OC_JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php index 8623c6fdca7..bf23df67585 100755 --- a/apps/contacts/ajax/addproperty.php +++ b/apps/contacts/ajax/addproperty.php @@ -24,8 +24,8 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = isset($_POST['id'])?$_POST['id']:null; $name = isset($_POST['name'])?$_POST['name']:null; @@ -37,7 +37,7 @@ $vcard = OC_Contacts_App::getContactVCard($id); if(!is_array($value)){ $value = trim($value); if(!$value && in_array($name, array('TEL', 'EMAIL', 'ORG', 'BDAY', 'NICKNAME', 'NOTE'))) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add empty property.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add empty property.')))); exit(); } } elseif($name === 'ADR') { // only add if non-empty elements. @@ -49,7 +49,7 @@ if(!is_array($value)){ } } if($empty) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('At least one of the address fields has to be filled out.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('At least one of the address fields has to be filled out.')))); exit(); } } @@ -59,7 +59,7 @@ $current = $vcard->select($name); foreach($current as $item) { $tmpvalue = (is_array($value)?implode(';', $value):$value); if($tmpvalue == $item->value) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Trying to add duplicate property: ').$name.': '.$tmpvalue))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Trying to add duplicate property: ').$name.': '.$tmpvalue))); OCP\Util::writeLog('contacts','ajax/addproperty.php: Trying to add duplicate property: '.$name.': '.$tmpvalue, OCP\Util::DEBUG); exit(); } @@ -117,9 +117,9 @@ foreach ($parameters as $key=>$element) { $checksum = md5($vcard->children[$line]->serialize()); if(!OC_Contacts_VCard::edit($id,$vcard)) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding contact property.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding contact property.')))); OCP\Util::writeLog('contacts','ajax/addproperty.php: Error updating contact property: '.$name, OCP\Util::ERROR); exit(); } -OC_JSON::success(array('data' => array( 'checksum' => $checksum ))); +OCP\JSON::success(array('data' => array( 'checksum' => $checksum ))); diff --git a/apps/contacts/ajax/categories/categoriesfor.php b/apps/contacts/ajax/categories/categoriesfor.php index c6b753a73b5..846af300de8 100755 --- a/apps/contacts/ajax/categories/categoriesfor.php +++ b/apps/contacts/ajax/categories/categoriesfor.php @@ -7,12 +7,12 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = isset($_GET['id'])?$_GET['id']:null; if(is_null($id)) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('No ID provided')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('No ID provided')))); exit(); } $vcard = OC_Contacts_App::getContactVCard( $id ); @@ -20,9 +20,9 @@ foreach($vcard->children as $property){ //OCP\Util::writeLog('contacts','ajax/categories/checksumfor.php: '.$property->name, OCP\Util::DEBUG); if($property->name == 'CATEGORIES') { $checksum = md5($property->serialize()); - OC_JSON::success(array('data' => array('value'=>$property->value, 'checksum'=>$checksum))); + OCP\JSON::success(array('data' => array('value'=>$property->value, 'checksum'=>$checksum))); exit(); } } -OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error setting checksum.')))); +OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error setting checksum.')))); ?> diff --git a/apps/contacts/ajax/categories/delete.php b/apps/contacts/ajax/categories/delete.php index d1099da044a..bee2dbe3f6b 100755 --- a/apps/contacts/ajax/categories/delete.php +++ b/apps/contacts/ajax/categories/delete.php @@ -7,15 +7,15 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); foreach ($_POST as $key=>$element) { debug('_POST: '.$key.'=>'.print_r($element, true)); } function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/categories/delete.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -55,6 +55,6 @@ $catman = new OC_VCategories('contacts'); $catman->delete($categories, $cards); debug('After delete: '.print_r($catman->categories(), true)); OC_Contacts_VCard::updateDataByID($cards); -OC_JSON::success(array('data' => array('categories'=>$catman->categories()))); +OCP\JSON::success(array('data' => array('categories'=>$catman->categories()))); ?> diff --git a/apps/contacts/ajax/categories/list.php b/apps/contacts/ajax/categories/list.php index 98c1c705180..3ae7635390c 100644..100755 --- a/apps/contacts/ajax/categories/list.php +++ b/apps/contacts/ajax/categories/list.php @@ -7,11 +7,11 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $categories = OC_Contacts_App::getCategories(); -OC_JSON::success(array('data' => array('categories'=>$categories))); +OCP\JSON::success(array('data' => array('categories'=>$categories))); ?> diff --git a/apps/contacts/ajax/categories/rescan.php b/apps/contacts/ajax/categories/rescan.php index 37a19fbce4a..84a67dec0b1 100755 --- a/apps/contacts/ajax/categories/rescan.php +++ b/apps/contacts/ajax/categories/rescan.php @@ -7,15 +7,15 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); foreach ($_POST as $key=>$element) { debug('_POST: '.$key.'=>'.print_r($element, true)); } function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -39,6 +39,6 @@ if(count($contacts) == 0) { OC_Contacts_App::scanCategories($contacts); $categories = OC_Contacts_App::getCategories(); -OC_JSON::success(array('data' => array('categories'=>$categories))); +OCP\JSON::success(array('data' => array('categories'=>$categories))); ?> diff --git a/apps/contacts/ajax/chooseaddressbook.php b/apps/contacts/ajax/chooseaddressbook.php index b47c872e9aa..2fe55606d1d 100644..100755 --- a/apps/contacts/ajax/chooseaddressbook.php +++ b/apps/contacts/ajax/chooseaddressbook.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $output = new OC_TEMPLATE("contacts", "part.chooseaddressbook"); $output -> printpage(); diff --git a/apps/contacts/ajax/contactdetails.php b/apps/contacts/ajax/contactdetails.php index aa6aca4562a..0cbd55258de 100755 --- a/apps/contacts/ajax/contactdetails.php +++ b/apps/contacts/ajax/contactdetails.php @@ -23,14 +23,14 @@ // Init owncloud function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/contactdetails.php: '.$msg, OCP\Util::DEBUG); exit(); } // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = isset($_GET['id'])?$_GET['id']:null; if(is_null($id)) { @@ -69,4 +69,4 @@ if(isset($details['PHOTO'])) { } $details['id'] = $id; OC_Contacts_App::setLastModifiedHeader($vcard); -OC_JSON::success(array('data' => $details)); +OCP\JSON::success(array('data' => $details)); diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php index f0e7dde088c..93e618a0800 100755 --- a/apps/contacts/ajax/contacts.php +++ b/apps/contacts/ajax/contacts.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser()); $contacts = OC_Contacts_VCard::all($ids); @@ -16,5 +16,5 @@ $tmpl = new OC_TEMPLATE("contacts", "part.contacts"); $tmpl->assign('contacts', $contacts); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'page' => $page ))); +OCP\JSON::success(array('data' => array( 'page' => $page ))); ?> diff --git a/apps/contacts/ajax/createaddressbook.php b/apps/contacts/ajax/createaddressbook.php index 3a331131a15..772232b67d7 100755 --- a/apps/contacts/ajax/createaddressbook.php +++ b/apps/contacts/ajax/createaddressbook.php @@ -9,32 +9,32 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $userid = OCP\USER::getUser(); $name = trim(strip_tags($_POST['name'])); if(!$name) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add addressbook with an empty name.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add addressbook with an empty name.')))); OCP\Util::writeLog('contacts','ajax/createaddressbook.php: Cannot add addressbook with an empty name: '.strip_tags($_POST['name']), OCP\Util::ERROR); exit(); } $bookid = OC_Contacts_Addressbook::add($userid, $name, null); if(!$bookid) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding addressbook.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding addressbook.')))); OCP\Util::writeLog('contacts','ajax/createaddressbook.php: Error adding addressbook: '.$_POST['name'], OCP\Util::ERROR); exit(); } if(!OC_Contacts_Addressbook::setActive($bookid, 1)) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error activating addressbook.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error activating addressbook.')))); OCP\Util::writeLog('contacts','ajax/createaddressbook.php: Error activating addressbook: '.$bookid, OCP\Util::ERROR); //exit(); } $addressbook = OC_Contacts_App::getAddressbook($bookid); $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); -OC_JSON::success(array( +OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), 'addressbook' => $addressbook, )); diff --git a/apps/contacts/ajax/cropphoto.php b/apps/contacts/ajax/cropphoto.php index 09bdbbc439a..125dd107602 100755 --- a/apps/contacts/ajax/cropphoto.php +++ b/apps/contacts/ajax/cropphoto.php @@ -24,8 +24,8 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $tmp_path = $_GET['tmp_path']; $id = $_GET['id']; @@ -35,4 +35,4 @@ $tmpl->assign('tmp_path', $tmp_path); $tmpl->assign('id', $id); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'page' => $page ))); +OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/currentphoto.php b/apps/contacts/ajax/currentphoto.php index 488f064836b..d8afa060b1e 100755 --- a/apps/contacts/ajax/currentphoto.php +++ b/apps/contacts/ajax/currentphoto.php @@ -24,11 +24,11 @@ // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::setContentTypeHeader('text/plain'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/currentphoto.php: '.$msg, OCP\Util::ERROR); exit(); } @@ -55,7 +55,7 @@ if( is_null($contact)) { } if($image->valid()) { if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); exit(); } else { bailOut(OC_Contacts_App::$l10n->t('Error saving temporary file.')); diff --git a/apps/contacts/ajax/deletebook.php b/apps/contacts/ajax/deletebook.php index b80df526f95..bcf6aa44329 100644..100755 --- a/apps/contacts/ajax/deletebook.php +++ b/apps/contacts/ajax/deletebook.php @@ -24,12 +24,12 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); //$id = $_GET['id']; $id = $_POST['id']; OC_Contacts_App::getAddressbook( $id ); // is owner access check OC_Contacts_Addressbook::delete($id); -OC_JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/contacts/ajax/deletecard.php b/apps/contacts/ajax/deletecard.php index 84526e9b13b..46fd8252d47 100755 --- a/apps/contacts/ajax/deletecard.php +++ b/apps/contacts/ajax/deletecard.php @@ -20,7 +20,7 @@ * */ function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -29,8 +29,8 @@ function bailOut($msg) { // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = isset($_GET['id'])?$_GET['id']:null; if(!$id) { @@ -39,4 +39,4 @@ if(!$id) { $card = OC_Contacts_App::getContactObject( $id ); OC_Contacts_VCard::delete($id); -OC_JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php index 4c753816218..9bb1208cdd1 100755 --- a/apps/contacts/ajax/deleteproperty.php +++ b/apps/contacts/ajax/deleteproperty.php @@ -24,8 +24,8 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = $_GET['id']; $checksum = $_GET['checksum']; @@ -33,16 +33,16 @@ $checksum = $_GET['checksum']; $vcard = OC_Contacts_App::getContactVCard( $id ); $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); if(is_null($line)){ - OC_JSON::error(array('data' => array( 'message' => OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page.')))); + OCP\JSON::error(array('data' => array( 'message' => OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page.')))); exit(); } unset($vcard->children[$line]); if(!OC_Contacts_VCard::edit($id,$vcard)) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error deleting contact property.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error deleting contact property.')))); OCP\Util::writeLog('contacts','ajax/deleteproperty.php: Error deleting contact property', OCP\Util::ERROR); exit(); } -OC_JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/contacts/ajax/editaddress.php b/apps/contacts/ajax/editaddress.php index 73f34ef5c6c..4044eb5a359 100644..100755 --- a/apps/contacts/ajax/editaddress.php +++ b/apps/contacts/ajax/editaddress.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = $_GET['id']; $checksum = isset($_GET['checksum'])?$_GET['checksum']:''; diff --git a/apps/contacts/ajax/editaddressbook.php b/apps/contacts/ajax/editaddressbook.php index ef797778d95..fe1806a7b8a 100644..100755 --- a/apps/contacts/ajax/editaddressbook.php +++ b/apps/contacts/ajax/editaddressbook.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $addressbook = OC_Contacts_App::getAddressbook($_GET['bookid']); $tmpl = new OC_Template("contacts", "part.editaddressbook"); $tmpl->assign('new', false); diff --git a/apps/contacts/ajax/editname.php b/apps/contacts/ajax/editname.php index 331aa4c7742..155bee70a7f 100755 --- a/apps/contacts/ajax/editname.php +++ b/apps/contacts/ajax/editname.php @@ -7,10 +7,10 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG); exit(); } diff --git a/apps/contacts/ajax/importaddressbook.php b/apps/contacts/ajax/importaddressbook.php index dc251de201a..bc02e814f5b 100755 --- a/apps/contacts/ajax/importaddressbook.php +++ b/apps/contacts/ajax/importaddressbook.php @@ -7,7 +7,7 @@ */ require_once('../../../lib/base.php'); -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); diff --git a/apps/contacts/ajax/importdialog.php b/apps/contacts/ajax/importdialog.php index bd195023dd2..7a564ccec83 100755 --- a/apps/contacts/ajax/importdialog.php +++ b/apps/contacts/ajax/importdialog.php @@ -7,7 +7,7 @@ */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); $tmpl = new OC_Template('contacts', 'part.import'); $tmpl->assign('path', $_POST['path']); diff --git a/apps/contacts/ajax/loadcard.php b/apps/contacts/ajax/loadcard.php index 90ba3f66097..047db4d940c 100755 --- a/apps/contacts/ajax/loadcard.php +++ b/apps/contacts/ajax/loadcard.php @@ -23,7 +23,7 @@ // Init owncloud function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/loadcard.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -35,8 +35,8 @@ function debug($msg) { // } // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); @@ -58,4 +58,4 @@ $tmpl->assign('email_types',$email_types); $tmpl->assign('id',''); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'page' => $page ))); +OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/loadintro.php b/apps/contacts/ajax/loadintro.php index 1aa03a62f38..8ad828ebba3 100644..100755 --- a/apps/contacts/ajax/loadintro.php +++ b/apps/contacts/ajax/loadintro.php @@ -21,11 +21,11 @@ */ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $tmpl = new OC_Template('contacts','part.no_contacts'); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'page' => $page ))); +OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/loadphoto.php b/apps/contacts/ajax/loadphoto.php index 8d40669a5b3..9913fe13e11 100755 --- a/apps/contacts/ajax/loadphoto.php +++ b/apps/contacts/ajax/loadphoto.php @@ -22,15 +22,15 @@ // Init owncloud // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +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) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/loadphoto.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -59,5 +59,5 @@ if($refresh) { $tmpl->assign('refresh', 1); } $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array('page'=>$page, 'checksum'=>$checksum))); +OCP\JSON::success(array('data' => array('page'=>$page, 'checksum'=>$checksum))); ?> diff --git a/apps/contacts/ajax/oc_photo.php b/apps/contacts/ajax/oc_photo.php index 8c6b95c5563..0fd978e325a 100755 --- a/apps/contacts/ajax/oc_photo.php +++ b/apps/contacts/ajax/oc_photo.php @@ -24,11 +24,11 @@ require_once('lib/base.php'); // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::setContentTypeHeader('text/plain'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/oc_photo.php: '.$msg, OCP\Util::ERROR); exit(); } @@ -66,7 +66,7 @@ if(!$image->fixOrientation()) { // No fatal error so we don't bail out. debug('Couldn\'t save correct image orientation: '.$tmpfname); } if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); exit(); } else { bailOut('Couldn\'t save temporary image: '.$tmpfname); diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php index 958f9fd926c..5418e26cd10 100755 --- a/apps/contacts/ajax/savecrop.php +++ b/apps/contacts/ajax/savecrop.php @@ -26,18 +26,18 @@ OCP\Util::writeLog('contacts','ajax/savecrop.php: Huzzah!!!', OCP\Util::DEBUG); // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); // foreach ($_POST as $key=>$element) { // OCP\Util::writeLog('contacts','ajax/savecrop.php: '.$key.'=>'.$element, OCP\Util::DEBUG); // } // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); +OCP\JSON::setContentTypeHeader('text/plain'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/savecrop.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -109,7 +109,7 @@ if(file_exists($tmp_path)) { $tmpl->assign('width', $image->width()); $tmpl->assign('height', $image->height()); $page = $tmpl->fetchPage(); - OC_JSON::success(array('data' => array('page'=>$page, 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('page'=>$page, 'tmp'=>$tmpfname))); exit(); } else { if(file_exists($tmpfname)) { diff --git a/apps/contacts/ajax/saveproperty.php b/apps/contacts/ajax/saveproperty.php index b8b4a422cf2..0cd6d5b36fb 100755 --- a/apps/contacts/ajax/saveproperty.php +++ b/apps/contacts/ajax/saveproperty.php @@ -24,11 +24,11 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -154,4 +154,4 @@ if(!OC_Contacts_VCard::edit($id,$vcard)) { exit(); } -OC_JSON::success(array('data' => array( 'line' => $line, 'checksum' => $checksum, 'oldchecksum' => $_POST['checksum'] ))); +OCP\JSON::success(array('data' => array( 'line' => $line, 'checksum' => $checksum, 'oldchecksum' => $_POST['checksum'] ))); diff --git a/apps/contacts/ajax/updateaddressbook.php b/apps/contacts/ajax/updateaddressbook.php index b016cf92939..13f1c15ac23 100755 --- a/apps/contacts/ajax/updateaddressbook.php +++ b/apps/contacts/ajax/updateaddressbook.php @@ -9,27 +9,27 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $bookid = $_POST['id']; OC_Contacts_App::getAddressbook($bookid); // is owner access check $name = trim(strip_tags($_POST['name'])); if(!$name) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot update addressbook with an empty name.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot update addressbook with an empty name.')))); OCP\Util::writeLog('contacts','ajax/updateaddressbook.php: Cannot update addressbook with an empty name: '.strip_tags($_POST['name']), OCP\Util::ERROR); exit(); } if(!OC_Contacts_Addressbook::edit($bookid, $name, null)) { - OC_JSON::error(array('data' => array('message' => $l->t('Error updating addressbook.')))); + OCP\JSON::error(array('data' => array('message' => $l->t('Error updating addressbook.')))); OCP\Util::writeLog('contacts','ajax/updateaddressbook.php: Error adding addressbook: ', OCP\Util::ERROR); //exit(); } if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { - OC_JSON::error(array('data' => array('message' => $l->t('Error (de)activating addressbook.')))); + OCP\JSON::error(array('data' => array('message' => $l->t('Error (de)activating addressbook.')))); OCP\Util::writeLog('contacts','ajax/updateaddressbook.php: Error (de)activating addressbook: '.$bookid, OCP\Util::ERROR); //exit(); } @@ -37,7 +37,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { $addressbook = OC_Contacts_App::getAddressbook($bookid); $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); -OC_JSON::success(array( +OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), 'addressbook' => $addressbook, )); diff --git a/apps/contacts/ajax/uploadimport.php b/apps/contacts/ajax/uploadimport.php index 51ae949b680..947d4670a29 100755 --- a/apps/contacts/ajax/uploadimport.php +++ b/apps/contacts/ajax/uploadimport.php @@ -23,10 +23,10 @@ require_once('../../../lib/base.php'); // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::ERROR); exit(); } @@ -42,7 +42,7 @@ $fn = (isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : fals if($fn) { if($view->file_put_contents('/'.$tmpfile, file_get_contents('php://input'))) { debug($fn.' uploaded'); - OC_JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile))); + OCP\JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile))); exit(); } else { bailOut(OC_Contacts_App::$l10n->t('Error uploading contacts to storage.')); @@ -52,7 +52,7 @@ if($fn) { // File input transfers are handled here if (!isset($_FILES['importfile'])) { OCP\Util::writeLog('contacts','ajax/uploadphoto.php: No file was uploaded. Unknown error.', OCP\Util::DEBUG); - OC_JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); + OCP\JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); exit(); } $error = $_FILES['importfile']['error']; @@ -73,7 +73,7 @@ $tmpfname = tempnam("/tmp", "occOrig"); if(file_exists($file['tmp_name'])) { if($view->file_put_contents('/'.$tmpfile, file_get_contents($file['tmp_name']))) { debug($fn.' uploaded'); - OC_JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile))); + OCP\JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile))); } else { bailOut(OC_Contacts_App::$l10n->t('Error uploading contacts to storage.')); } diff --git a/apps/contacts/ajax/uploadphoto.php b/apps/contacts/ajax/uploadphoto.php index 1148c271dcd..99015e2d502 100755 --- a/apps/contacts/ajax/uploadphoto.php +++ b/apps/contacts/ajax/uploadphoto.php @@ -24,11 +24,11 @@ // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::setContentTypeHeader('text/plain'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/uploadphoto.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -42,7 +42,7 @@ if ($fn) { // AJAX call if (!isset($_GET['id'])) { OCP\Util::writeLog('contacts','ajax/uploadphoto.php: No contact ID was submitted.', OCP\Util::DEBUG); - OC_JSON::error(array('data' => array( 'message' => 'No contact ID was submitted.' ))); + OCP\JSON::error(array('data' => array( 'message' => 'No contact ID was submitted.' ))); exit(); } $id = $_GET['id']; @@ -58,7 +58,7 @@ if ($fn) { debug('Couldn\'t save correct image orientation: '.$tmpfname); } if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('mime'=>$_SERVER['CONTENT_TYPE'], 'name'=>$fn, 'id'=>$id, 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('mime'=>$_SERVER['CONTENT_TYPE'], 'name'=>$fn, 'id'=>$id, 'tmp'=>$tmpfname))); exit(); } else { bailOut('Couldn\'t save temporary image: '.$tmpfname); @@ -71,12 +71,12 @@ if ($fn) { if (!isset($_POST['id'])) { OCP\Util::writeLog('contacts','ajax/uploadphoto.php: No contact ID was submitted.', OCP\Util::DEBUG); - OC_JSON::error(array('data' => array( 'message' => 'No contact ID was submitted.' ))); + OCP\JSON::error(array('data' => array( 'message' => 'No contact ID was submitted.' ))); exit(); } if (!isset($_FILES['imagefile'])) { OCP\Util::writeLog('contacts','ajax/uploadphoto.php: No file was uploaded. Unknown error.', OCP\Util::DEBUG); - OC_JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); + OCP\JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); exit(); } $error = $_FILES['imagefile']['error']; @@ -104,7 +104,7 @@ if(file_exists($file['tmp_name'])) { debug('Couldn\'t save correct image orientation: '.$tmpfname); } if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('mime'=>$file['type'],'size'=>$file['size'],'name'=>$file['name'], 'id'=>$_POST['id'], 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('mime'=>$file['type'],'size'=>$file['size'],'name'=>$file['name'], 'id'=>$_POST['id'], 'tmp'=>$tmpfname))); exit(); } else { bailOut('Couldn\'t save temporary image: '.$tmpfname); |