Add some DRYness to logging.
This commit is contained in:
parent
f10c51193b
commit
3afbc3d2dc
|
@ -25,11 +25,7 @@ OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
OCP\JSON::callCheck();
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/addproperty.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$id = isset($_POST['id'])?$_POST['id']:null;
|
$id = isset($_POST['id'])?$_POST['id']:null;
|
||||||
$name = isset($_POST['name'])?$_POST['name']:null;
|
$name = isset($_POST['name'])?$_POST['name']:null;
|
||||||
|
|
|
@ -10,18 +10,7 @@
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
foreach ($_POST as $key=>$element) {
|
require_once('../loghandler.php');
|
||||||
debug('_POST: '.$key.'=>'.print_r($element, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
function bailOut($msg) {
|
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/categories/delete.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
function debug($msg) {
|
|
||||||
OCP\Util::writeLog('contacts','ajax/categories/delete.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
}
|
|
||||||
|
|
||||||
$categories = isset($_POST['categories'])?$_POST['categories']:null;
|
$categories = isset($_POST['categories'])?$_POST['categories']:null;
|
||||||
|
|
||||||
|
|
|
@ -10,18 +10,7 @@
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
foreach ($_POST as $key=>$element) {
|
require_once('../loghandler.php');
|
||||||
debug('_POST: '.$key.'=>'.print_r($element, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
function bailOut($msg) {
|
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
function debug($msg) {
|
|
||||||
OCP\Util::writeLog('contacts','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
}
|
|
||||||
|
|
||||||
$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
|
$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
|
||||||
if(count($addressbooks) == 0) {
|
if(count($addressbooks) == 0) {
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
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
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
|
|
@ -12,25 +12,20 @@
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
OCP\JSON::callCheck();
|
OCP\JSON::callCheck();
|
||||||
|
require_once('loghandler.php');
|
||||||
|
|
||||||
$userid = OCP\USER::getUser();
|
$userid = OCP\USER::getUser();
|
||||||
$name = trim(strip_tags($_POST['name']));
|
$name = trim(strip_tags($_POST['name']));
|
||||||
if(!$name) {
|
if(!$name) {
|
||||||
OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add addressbook with an empty name.'))));
|
bailOut('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);
|
$bookid = OC_Contacts_Addressbook::add($userid, $name, null);
|
||||||
if(!$bookid) {
|
if(!$bookid) {
|
||||||
OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding addressbook.'))));
|
bailOut('Error adding addressbook: '.$name);
|
||||||
OCP\Util::writeLog('contacts','ajax/createaddressbook.php: Error adding addressbook: '.$_POST['name'], OCP\Util::ERROR);
|
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!OC_Contacts_Addressbook::setActive($bookid, 1)) {
|
if(!OC_Contacts_Addressbook::setActive($bookid, 1)) {
|
||||||
OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error activating addressbook.'))));
|
bailOut('Error activating addressbook.');
|
||||||
OCP\Util::writeLog('contacts','ajax/createaddressbook.php: Error activating addressbook: '.$bookid, OCP\Util::ERROR);
|
|
||||||
//exit();
|
|
||||||
}
|
}
|
||||||
$addressbook = OC_Contacts_App::getAddressbook($bookid);
|
$addressbook = OC_Contacts_App::getAddressbook($bookid);
|
||||||
$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
|
$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
|
||||||
|
|
|
@ -24,11 +24,7 @@
|
||||||
OCP\JSON::setContentTypeHeader('text/plain');
|
OCP\JSON::setContentTypeHeader('text/plain');
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/currentphoto.php: '.$msg, OCP\Util::ERROR);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_GET['id'])) {
|
if (!isset($_GET['id'])) {
|
||||||
bailOut(OC_Contacts_App::$l10n->t('No contact ID was submitted.'));
|
bailOut(OC_Contacts_App::$l10n->t('No contact ID was submitted.'));
|
||||||
|
|
|
@ -19,26 +19,21 @@
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function bailOut($msg) {
|
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
OCP\JSON::callCheck();
|
OCP\JSON::callCheck();
|
||||||
|
require_once('loghandler.php');
|
||||||
|
|
||||||
// foreach($_SERVER as $key=>$value) {
|
// foreach($_SERVER as $key=>$value) {
|
||||||
// OCP\Util::writeLog('contacts','ajax/saveproperty.php: _SERVER: '.$key.'=>'.$value, OCP\Util::DEBUG);
|
// OCP\Util::writeLog('contacts','ajax/saveproperty.php: _SERVER: '.$key.'=>'.$value, OCP\Util::DEBUG);
|
||||||
// }
|
// }
|
||||||
foreach($_POST as $key=>$value) {
|
// foreach($_POST as $key=>$value) {
|
||||||
OCP\Util::writeLog('contacts','ajax/saveproperty.php: _POST: '.$key.'=>'.print_r($value, true), OCP\Util::DEBUG);
|
// debug($key.'=>'.print_r($value, true));
|
||||||
}
|
// }
|
||||||
foreach($_GET as $key=>$value) {
|
// foreach($_GET as $key=>$value) {
|
||||||
OCP\Util::writeLog('contacts','ajax/saveproperty.php: _GET: '.$key.'=>'.print_r($value, true), OCP\Util::DEBUG);
|
// debug($key.'=>'.print_r($value, true));
|
||||||
}
|
// }
|
||||||
|
|
||||||
$id = isset($_POST['id'])?$_POST['id']:null;
|
$id = isset($_POST['id'])?$_POST['id']:null;
|
||||||
if(!$id) {
|
if(!$id) {
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
OCP\JSON::callCheck();
|
OCP\JSON::callCheck();
|
||||||
|
require_once('loghandler.php');
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
$checksum = $_POST['checksum'];
|
$checksum = $_POST['checksum'];
|
||||||
|
@ -31,16 +32,14 @@ $checksum = $_POST['checksum'];
|
||||||
$vcard = OC_Contacts_App::getContactVCard( $id );
|
$vcard = OC_Contacts_App::getContactVCard( $id );
|
||||||
$line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum);
|
$line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum);
|
||||||
if(is_null($line)){
|
if(is_null($line)){
|
||||||
OCP\JSON::error(array('data' => array( 'message' => OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page.'))));
|
bailOut(OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page.'));
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($vcard->children[$line]);
|
unset($vcard->children[$line]);
|
||||||
|
|
||||||
if(!OC_Contacts_VCard::edit($id,$vcard)) {
|
if(!OC_Contacts_VCard::edit($id,$vcard)) {
|
||||||
OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error deleting contact property.'))));
|
bailOut(OC_Contacts_App::$l10n->t('Error deleting contact property.'));
|
||||||
OCP\Util::writeLog('contacts','ajax/deleteproperty.php: Error deleting contact property', OCP\Util::ERROR);
|
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OCP\JSON::success(array('data' => array( 'id' => $id )));
|
OCP\JSON::success(array('data' => array( 'id' => $id )));
|
||||||
|
|
|
@ -9,11 +9,7 @@
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmpl = new OCP\Template("contacts", "part.edit_name_dialog");
|
$tmpl = new OCP\Template("contacts", "part.edit_name_dialog");
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,7 @@
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/loadphoto.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$id = isset($_GET['id']) ? $_GET['id'] : '';
|
$id = isset($_GET['id']) ? $_GET['id'] : '';
|
||||||
$refresh = isset($_GET['refresh']) ? true : false;
|
$refresh = isset($_GET['refresh']) ? true : false;
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* ownCloud - Addressbook
|
||||||
|
*
|
||||||
|
* @author Thomas Tanghus
|
||||||
|
* @copyright 2012 Thomas Tanghus <thomas@tanghus.net>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 3 of the License, or any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function bailOut($msg, $tracelevel=1, $debuglevel=OCP\Util::ERROR) {
|
||||||
|
OCP\JSON::error(array('data' => array('message' => $msg)));
|
||||||
|
debug($msg, $tracelevel, $debuglevel);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function debug($msg, $tracelevel=0, $debuglevel=OCP\Util::DEBUG) {
|
||||||
|
if(PHP_VERSION >= "5.4") {
|
||||||
|
$call = debug_backtrace(false, $tracelevel+1);
|
||||||
|
} else {
|
||||||
|
$call = debug_backtrace(false);
|
||||||
|
}
|
||||||
|
error_log('trace: '.print_r($call, true));
|
||||||
|
$call = $call[$tracelevel];
|
||||||
|
if($debuglevel !== false) {
|
||||||
|
OCP\Util::writeLog('contacts', $call['file'].'. Line: '.$call['line'].': '.$msg, $debuglevel);
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,11 +22,7 @@
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/oc_photo.php: '.$msg, OCP\Util::ERROR);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!isset($_GET['id'])) {
|
if(!isset($_GET['id'])) {
|
||||||
bailOut(OC_Contacts_App::$l10n->t('No contact ID was submitted.'));
|
bailOut(OC_Contacts_App::$l10n->t('No contact ID was submitted.'));
|
||||||
|
|
|
@ -27,11 +27,7 @@ OCP\JSON::callCheck();
|
||||||
// Firefox and Konqueror tries to download application/json for me. --Arthur
|
// Firefox and Konqueror tries to download application/json for me. --Arthur
|
||||||
OCP\JSON::setContentTypeHeader('text/plain');
|
OCP\JSON::setContentTypeHeader('text/plain');
|
||||||
|
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/savecrop.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$image = null;
|
$image = null;
|
||||||
|
|
||||||
|
|
|
@ -19,21 +19,11 @@
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
require_once('loghandler.php');
|
||||||
function bailOut($msg) {
|
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
function debug($msg) {
|
|
||||||
OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
OCP\JSON::callCheck();
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = isset($_POST['id'])?$_POST['id']:null;
|
$id = isset($_POST['id'])?$_POST['id']:null;
|
||||||
$name = isset($_POST['name'])?$_POST['name']:null;
|
$name = isset($_POST['name'])?$_POST['name']:null;
|
||||||
$value = isset($_POST['value'])?$_POST['value']:null;
|
$value = isset($_POST['value'])?$_POST['value']:null;
|
||||||
|
|
|
@ -11,27 +11,22 @@
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
|
require_once('loghandler.php');
|
||||||
|
|
||||||
$bookid = $_POST['id'];
|
$bookid = $_POST['id'];
|
||||||
OC_Contacts_App::getAddressbook($bookid); // is owner access check
|
OC_Contacts_App::getAddressbook($bookid); // is owner access check
|
||||||
|
|
||||||
$name = trim(strip_tags($_POST['name']));
|
$name = trim(strip_tags($_POST['name']));
|
||||||
if(!$name) {
|
if(!$name) {
|
||||||
OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot update addressbook with an empty name.'))));
|
bailOut(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)) {
|
if(!OC_Contacts_Addressbook::edit($bookid, $name, null)) {
|
||||||
OCP\JSON::error(array('data' => array('message' => $l->t('Error updating addressbook.'))));
|
bailOut(OC_Contacts_App::$l10n->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'])) {
|
if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) {
|
||||||
OCP\JSON::error(array('data' => array('message' => $l->t('Error (de)activating addressbook.'))));
|
bailOut(OC_Contacts_App::$l10n->t('Error (de)activating addressbook.'));
|
||||||
OCP\Util::writeLog('contacts','ajax/updateaddressbook.php: Error (de)activating addressbook: '.$bookid, OCP\Util::ERROR);
|
|
||||||
//exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$addressbook = OC_Contacts_App::getAddressbook($bookid);
|
$addressbook = OC_Contacts_App::getAddressbook($bookid);
|
||||||
|
|
|
@ -23,11 +23,7 @@
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('contacts');
|
OCP\JSON::checkAppEnabled('contacts');
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::ERROR);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$view = OCP\Files::getStorage('contacts');
|
$view = OCP\Files::getStorage('contacts');
|
||||||
$tmpfile = md5(rand());
|
$tmpfile = md5(rand());
|
||||||
|
|
|
@ -27,14 +27,7 @@ OCP\JSON::callCheck();
|
||||||
|
|
||||||
// Firefox and Konqueror tries to download application/json for me. --Arthur
|
// Firefox and Konqueror tries to download application/json for me. --Arthur
|
||||||
OCP\JSON::setContentTypeHeader('text/plain');
|
OCP\JSON::setContentTypeHeader('text/plain');
|
||||||
function bailOut($msg) {
|
require_once('loghandler.php');
|
||||||
OCP\JSON::error(array('data' => array('message' => $msg)));
|
|
||||||
OCP\Util::writeLog('contacts','ajax/uploadphoto.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
function debug($msg) {
|
|
||||||
OCP\Util::writeLog('contacts','ajax/uploadphoto.php: '.$msg, OCP\Util::DEBUG);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If it is a Drag'n'Drop transfer it's handled here.
|
// If it is a Drag'n'Drop transfer it's handled here.
|
||||||
$fn = (isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : false);
|
$fn = (isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : false);
|
||||||
|
|
Loading…
Reference in New Issue