christian-putzke / CardDAV-PHP

A cardDAV PHP-Class
http://www.graviox.de/
GNU Affero General Public License v3.0
97 stars 47 forks source link

Can't interact with ownCloud cardDAV-Server #1

Closed chrisb86 closed 12 years ago

chrisb86 commented 12 years ago

I'm going to develop a frontend for cardDAV-Servers and for this purpose I tried to use your class with my instance of ownCloud for testing. I can connect to the server but I can't get any data from it. Adding contacts is also not possible.

This ist my code:

<?php

include_once "CardDAV-PHP/carddav.php";

$carddav = new carddav_backend('https://dblx.io/owncloud/apps/contacts/carddav.php');
$carddav->set_auth('test', 'test');

var_dump($carddav->check_connection());

echo $carddav->get();

$vcard = 'BEGIN:VCARD
VERSION:3.0
UID:1f5ea45f-b28a-4b96-25as-ed4f10edf57b
FN:Christian Putzke
N:Christian;Putzke;;;
EMAIL;TYPE=OTHER:christian.putzke@graviox.de
END:VCARD';

$carddav->add($vcard);

?>

And this is the result I get.

bool(true)
<?xml version="1.0" encoding="UTF-8"?>
<response/>

You can use the credentials for my server for testing, if you want to. If I can help finding errors, let me know.

christian-putzke commented 12 years ago

Hi, I'll have a look at the issue. Which version of owncloud do you use? The current development branch of 3.0?

chrisb86 commented 12 years ago

No, at the moment I'm running 2.0 with the 1.0 CardDAV plugin.

Should I test it with the 3.0 branch? I don't use it productive at the moment so I have nothing to lose ;)

christian-putzke commented 12 years ago

It's okay that you use 2.0. I just wanted to know. I'll let you know if I get any interessting result.

christian-putzke commented 12 years ago

I've added a new vCard via the webfrontend of ownCloud and if I use this URL "https://dblx.io/owncloud/apps/contacts/carddav.php/addressbooks/test/default/" for the CardDAV access via my CardDAV-PHP Client I get all contacts and I can add new contacts.

I'm not sure why the URL which ownCloud said to use is not working but I'll try to figure that out.

The only thing that is strange is that the added vCard (via the CardDAV-PHP Client) is not shown in the webfrontend of ownCloud but I get the the added vCard if I use the get() method and if I access the URL within the browser.

christian-putzke commented 12 years ago

You have to add a telephone number then the contact will be displayed in ownCloud as well.