aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-08-10 21:58:44 +0200
committergit-marijus <mario@mariovavti.com>2017-08-10 22:01:45 +0200
commit80ff7fa35378da13dbfe57549963dc7b88080918 (patch)
tree1085ff02d72ba9eb97711f704e0efcf3edc7361d
parentecfb608518df223986c95b6405314f829bbf4878 (diff)
downloadvolse-hubzilla-80ff7fa35378da13dbfe57549963dc7b88080918.tar.gz
volse-hubzilla-80ff7fa35378da13dbfe57549963dc7b88080918.tar.bz2
volse-hubzilla-80ff7fa35378da13dbfe57549963dc7b88080918.zip
create cdav principal also on client access and remove redundant pconfig check in authentication process
-rw-r--r--Zotlabs/Module/Cdav.php9
-rw-r--r--Zotlabs/Storage/BasicAuth.php9
2 files changed, 12 insertions, 6 deletions
diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php
index bc563ab43..d0619ef0b 100644
--- a/Zotlabs/Module/Cdav.php
+++ b/Zotlabs/Module/Cdav.php
@@ -85,6 +85,15 @@ class Cdav extends \Zotlabs\Web\Controller {
if($channel['channel_timezone'])
$auth->setTimezone($channel['channel_timezone']);
$auth->observer = $channel['channel_hash'];
+
+ $principalUri = 'principals/' . $channel['channel_address'];
+ if(!cdav_principal($principalUri)) {
+ $this->activate($pdo, $channel);
+ if(!cdav_principal($principalUri)) {
+ return;
+ }
+ }
+
}
diff --git a/Zotlabs/Storage/BasicAuth.php b/Zotlabs/Storage/BasicAuth.php
index 0ff9fad13..ad2582bb2 100644
--- a/Zotlabs/Storage/BasicAuth.php
+++ b/Zotlabs/Storage/BasicAuth.php
@@ -188,13 +188,10 @@ class BasicAuth extends DAV\Auth\Backend\AbstractBasic {
protected function check_module_access($channel_id) {
if($channel_id && \App::$module === 'cdav') {
- $x = get_pconfig($channel_id,'cdav','enabled');
- if(! $x) {
- $this->module_disabled = true;
- return false;
- }
+ return true;
}
- return true;
+ $this->module_disabled = true;
+ return false;
}
/**