don't spit out sabre xml on permission denied exceptions, just provide a 401
This commit is contained in:
parent
2340092008
commit
7fa944ed95
@ -73,36 +73,18 @@ function cloud_init(&$a) {
|
|||||||
|
|
||||||
$server->addPlugin($lockPlugin);
|
$server->addPlugin($lockPlugin);
|
||||||
|
|
||||||
/* This next bit should no longer be needed... */
|
$is_readable = false;
|
||||||
|
|
||||||
// The next section of code allows us to bypass prompting for http-auth if a
|
if($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||||
// FILE is being accessed anonymously and permissions allow this. This way
|
try {
|
||||||
// one can create hotlinks to public media files in their cloud and anonymous
|
$x = RedFileData('/' . $a->cmd, $auth);
|
||||||
// viewers won't get asked to login.
|
}
|
||||||
// If a DIRECTORY is accessed or there are permission issues accessing the
|
catch(\Exception $e) {
|
||||||
// file and we aren't previously authenticated via zot, prompt for HTTP-auth.
|
if($e instanceof Sabre\DAV\Exception\Forbidden) {
|
||||||
// This will be the default case for mounting a DAV directory.
|
http_status_exit(401, 'Permission denied.');
|
||||||
// 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.');
|
|
||||||
// }
|
|
||||||
|
|
||||||
require_once('include/RedDAV/RedBrowser.php');
|
require_once('include/RedDAV/RedBrowser.php');
|
||||||
// provide a directory view for the cloud in Hubzilla
|
// provide a directory view for the cloud in Hubzilla
|
||||||
|
@ -1 +1 @@
|
|||||||
2015-12-09.1241
|
2015-12-10.1242
|
||||||
|
Reference in New Issue
Block a user