aboutsummaryrefslogtreecommitdiffstats
path: root/mod/cloud.php
diff options
context:
space:
mode:
authorroyalterra <royalterra@users.noreply.github.com>2015-12-11 09:39:01 +0000
committerroyalterra <royalterra@users.noreply.github.com>2015-12-11 09:39:01 +0000
commit4ff31d0a4140d923cbb8ddbe18ccf578a367375f (patch)
tree1f63d4b042c3dbf7bfe2c3e74f0a24ef2e5f94ec /mod/cloud.php
parentb92cc852d142940f0f8dd78ddf7be835dc8b9e07 (diff)
parentf73c82632f213ac7971b54220b4a0c87d354ca1e (diff)
downloadvolse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.tar.gz
volse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.tar.bz2
volse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.zip
Merge pull request #1 from redmatrix/master
merge branches
Diffstat (limited to 'mod/cloud.php')
-rw-r--r--mod/cloud.php42
1 files changed, 12 insertions, 30 deletions
diff --git a/mod/cloud.php b/mod/cloud.php
index efb33f935..67fc199bf 100644
--- a/mod/cloud.php
+++ b/mod/cloud.php
@@ -73,36 +73,18 @@ function cloud_init(&$a) {
$server->addPlugin($lockPlugin);
-/* This next bit should no longer be needed... */
-
- // The next section of code allows us to bypass prompting for http-auth if a
- // FILE is being accessed anonymously and permissions allow this. This way
- // one can create hotlinks to public media files in their cloud and anonymous
- // viewers won't get asked to login.
- // If a DIRECTORY is accessed or there are permission issues accessing the
- // file and we aren't previously authenticated via zot, prompt for HTTP-auth.
- // This will be the default case for mounting a DAV directory.
- // In order to avoid prompting for passwords for viewing a DIRECTORY, add
- // the URL query parameter 'davguest=1'.
-
-// $isapublic_file = false;
-// $davguest = ((x($_SESSION, 'davguest')) ? true : false);
-
-// if ((! $auth->observer) && ($_SERVER['REQUEST_METHOD'] === 'GET')) {
-// try {
-// $x = RedFileData('/' . $a->cmd, $auth);
-// if($x instanceof RedDAV\RedFile)
-// $isapublic_file = true;
-// }
-// catch (Exception $e) {
-// $isapublic_file = false;
-// }
-// }
-
-// if ((! $auth->observer) && (! $isapublic_file) && (! $davguest)) {
-// logger('mod_cloud: auth exception');
-// http_status_exit(401, 'Permission denied.');
-// }
+ $is_readable = false;
+
+ if($_SERVER['REQUEST_METHOD'] === 'GET') {
+ try {
+ $x = RedFileData('/' . $a->cmd, $auth);
+ }
+ catch(\Exception $e) {
+ if($e instanceof Sabre\DAV\Exception\Forbidden) {
+ http_status_exit(401, 'Permission denied.');
+ }
+ }
+ }
require_once('include/RedDAV/RedBrowser.php');
// provide a directory view for the cloud in Hubzilla