aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2021-03-22 14:16:54 +0000
committerMax Kostikov <max@kostikov.co>2021-03-22 14:16:54 +0000
commitdbc5e54a92058ebafc92f7137a6869a101cffaa8 (patch)
tree489d2a36fb13fd1c4a80a19ef0d8e1bc95b8cee8 /Zotlabs
parentb8913335b1202a670915db244f32b8933ddab1ad (diff)
downloadvolse-hubzilla-dbc5e54a92058ebafc92f7137a6869a101cffaa8.tar.gz
volse-hubzilla-dbc5e54a92058ebafc92f7137a6869a101cffaa8.tar.bz2
volse-hubzilla-dbc5e54a92058ebafc92f7137a6869a101cffaa8.zip
Fix DAV calendars and addressbooks sync on remote access
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Cdav.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php
index fe697a526..a6cab8639 100644
--- a/Zotlabs/Module/Cdav.php
+++ b/Zotlabs/Module/Cdav.php
@@ -135,7 +135,7 @@ class Cdav extends Controller {
$auth = new \Zotlabs\Storage\BasicAuth();
$auth->setRealm(ucfirst(\Zotlabs\Lib\System::get_platform_name()) . 'CalDAV/CardDAV');
- if (local_channel()) {
+ if(local_channel()) {
logger('loggedin');
@@ -151,15 +151,15 @@ class Cdav extends Controller {
if($channel['channel_timezone'])
$auth->setTimezone($channel['channel_timezone']);
$auth->observer = $channel['channel_hash'];
+ }
+ else
+ $channel = channelx_by_nick(argv(2));
- $principalUri = 'principals/' . $channel['channel_address'];
- if(!cdav_principal($principalUri)) {
- $this->activate($pdo, $channel);
- if(!cdav_principal($principalUri)) {
- return;
- }
- }
-
+ $principalUri = 'principals/' . $channel['channel_address'];
+ if(! cdav_principal($principalUri)) {
+ $this->activate($pdo, $channel);
+ if(! cdav_principal($principalUri))
+ return;
}
// Track CDAV updates from remote clients
@@ -173,11 +173,11 @@ class Cdav extends Controller {
logger("debug: method: " . $httpmethod, LOGGER_DEBUG);
logger("debug: uri: " . $httpuri, LOGGER_DEBUG);
- if(strpos($httpuri, 'cdav/addressbooks')) {
+ if(strpos($httpuri, 'cdav/addressbooks') !== false) {
$sync = 'addressbook';
$cdavtable = 'addressbooks';
}
- elseif(strpos($httpuri, 'cdav/calendars')) {
+ elseif(strpos($httpuri, 'cdav/calendars') !== false) {
$sync = 'calendar';
$cdavtable = 'calendarinstances';
}
@@ -191,7 +191,7 @@ class Cdav extends Controller {
logger("debug: body: " . $httpbody, LOGGER_DEBUG);
- if($x = get_cdav_id($principalUri, explode("/", $httpuri)[4], $cdavtable)) {
+ if($x = get_cdav_id($principalUri, argv(3), $cdavtable)) {
$cdavdata = $this->get_cdav_data($x['id'], $cdavtable);