aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2021-03-22 14:21:38 +0000
committerMax Kostikov <max@kostikov.co>2021-03-22 14:21:38 +0000
commit67d65d878dca79e5f14ab1522505411ca7c73842 (patch)
treeb3f761de144401675f8d2665bb02bd7ed3deddda /Zotlabs/Module
parente19bb638577ba7476e1237092eea8efc85cbf0d3 (diff)
parentdbc5e54a92058ebafc92f7137a6869a101cffaa8 (diff)
downloadvolse-hubzilla-67d65d878dca79e5f14ab1522505411ca7c73842.tar.gz
volse-hubzilla-67d65d878dca79e5f14ab1522505411ca7c73842.tar.bz2
volse-hubzilla-67d65d878dca79e5f14ab1522505411ca7c73842.zip
Merge branch 'dev' into 'dev'
Fix DAV calendars and addressbooks sync on remote access See merge request hubzilla/core!1931
Diffstat (limited to 'Zotlabs/Module')
-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);