*
*/
-// 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.
$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);
*
*/
-// Init owncloud
-
-
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
* 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)));
}
$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();
*
*/
-// 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);
*
*/
-// Init owncloud
-
-
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
exit();
}
-// Init owncloud
-
-
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
*
*/
-// Init owncloud
-
-
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
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('', '', '', '', '');
*
*/
-// 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');
* 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;
*
*/
-// Init owncloud
-
-
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
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.'));
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());
$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 {
$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.'));