Compare commits

...

3 Commits

Author SHA1 Message Date
Andrewkra
bb0aa4bb08 Merge branch 'Fix-getting-freebusy-by-email' into 'master'
Fix getting freebusy info from email

See merge request davical-project/davical!67
2025-01-25 10:30:23 +00:00
Andrew Ruthven
734d5c1f99 The public access endpoint is public.php 2025-01-22 14:48:24 +13:00
root
2f0a9e317f Fix getting freebusy info from email 2019-04-12 12:27:49 -04:00
3 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,6 @@
2025-01-22 Andrew Ruthven <andrew@etc.gen.nz>
* Using a Ticket ID requires public.php
2024-04-15 Andrew Ruthven <andrew@etc.gen.nz>
* Add caching of user credential success/failure

View File

@ -352,8 +352,6 @@ class CalDAVRequest
if ( ! isset($this->timeout) || $this->timeout == 0 ) $this->timeout = (isset($c->default_lock_timeout) ? $c->default_lock_timeout : 900);
}
$this->principal = new Principal('path',$this->path);
/**
* RFC2518, 5.2: URL pointing to a collection SHOULD end in '/', and if it does not then
* we SHOULD return a Content-location header with the correction...
@ -466,7 +464,14 @@ EOSQL;
/**
* Extract the user whom we are accessing
*/
$this->principal = new DAVPrincipal( array( "path" => $this->path, "options" => $this->options ) );
if ( $this->options['allow_by_email'] && preg_match( '{^/(\S+@[a-z0-9][a-z0-9-]*[.][a-z0-9.-]+)/?$}i', $this->path, $matches ) ) {
$this->principal = new DAVPrincipal( array( "email" => $matches[1], "options" => $this->options ) );
// @dbg_error_log('caldav', 'DAVPrincipal by email: %s', print_r($this->principal, true) );
} else {
$this->principal = new DAVPrincipal( array( "path" => $this->path, "options" => $this->options ) );
// @dbg_error_log('caldav', 'Principal by path: %s', $this->path );
}
$this->user_no = $this->principal->user_no();
$this->username = $this->principal->username();
$this->by_email = $this->principal->byEmail();

View File

@ -463,7 +463,7 @@ EOTEMPLATE;
if ($can_write_collection) {
$browser->AddColumn( 'ticket_id', translate('Ticket ID'), '', '' );
}
$browser->AddColumn( 'target', translate('Target'), '', '<td style="white-space:nowrap;">%s</td>', "'".$c->base_url.'/caldav.php'."' ||COALESCE(d.dav_name,c.dav_name)" );
$browser->AddColumn( 'target', translate('Target'), '', '<td style="white-space:nowrap;">%s</td>', "'".$c->base_url.'/public.php'."' ||COALESCE(d.dav_name,c.dav_name)" );
$browser->AddColumn( 'expiry', translate('Expires'), '', '', 'TO_CHAR(expires,\'YYYYMMDD"T"HH:MI:SS\')');
$browser->AddColumn( 'privs', translate('Privileges'), '', '', "privileges_list(privileges)" );
if ($can_write_collection) {