mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-29 18:26:05 +00:00
Use the permissions to allow/disallow a GET for a person's calendar.
This commit is contained in:
parent
9bea26010c
commit
7c3482cc89
@ -12,7 +12,15 @@ dbg_error_log("get", "GET method handler");
|
||||
|
||||
// The GET method is not sent with any wrapping XML so we simply fetch it
|
||||
|
||||
$qry = new PgQuery( "SELECT * FROM caldav_data WHERE user_no = ? AND dav_name = ? ;", $session->user_no, $request_path);
|
||||
if ( ! isset($permissions['read']) ) {
|
||||
header("HTTP/1.1 403 Forbidden");
|
||||
header("Content-type: text/plain");
|
||||
echo "You may not access that calendar.";
|
||||
dbg_error_log("GET", "Access denied for User: %d, Path: %s", $session->user_no, $get_path);
|
||||
return;
|
||||
}
|
||||
|
||||
$qry = new PgQuery( "SELECT * FROM caldav_data WHERE dav_name = ? ;", $request_path);
|
||||
dbg_error_log("get", "%s", $qry->querystring );
|
||||
if ( $qry->Exec("GET") && $qry->rows == 1 ) {
|
||||
$event = $qry->Fetch();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user