mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-01-27 00:33:34 +00:00
Return a nicer error message if no user is found for Free/Busy via email
Previously a stack trace would be returned as the call to dav_name failed, for example: Exception [0] Can't calculate dav_name for unknown username At line 382 of /usr/share/davical/inc/Principal.php ================= Stack Trace =================== /usr/share/davical/htdocs/freebusy.php[49] Principal->dav_name()
This commit is contained in:
parent
90bcfba683
commit
bda3db6da8
@ -46,6 +46,11 @@ $request = new CalDAVRequest(array("allow_by_email" => 1));
|
||||
$path_match = '^'.$request->path;
|
||||
if ( preg_match( '{^/(\S+@[a-z0-9][a-z0-9-]*[.][a-z0-9.-]+)/?$}i', $request->path, $matches ) ) {
|
||||
$principal = new Principal('email',$matches[1]);
|
||||
|
||||
if ( !$principal->Exists() ) {
|
||||
$request->DoResponse( 404, translate('No user found matching') . ' ' . $matches[1] . "\n" );
|
||||
}
|
||||
|
||||
$path_match = '^'.$principal->dav_name();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user