diff --git a/lib/Dav/CheckPlugin.php b/lib/Dav/CheckPlugin.php index 21b8eb9c..77abe07e 100644 --- a/lib/Dav/CheckPlugin.php +++ b/lib/Dav/CheckPlugin.php @@ -11,12 +11,13 @@ use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; -use Sabre\DAV\Exception\Forbidden; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; use OCA\TermsOfService\AppInfo\Application; use OCA\TermsOfService\Checker; +use OCA\TermsOfService\TermsNotSignedException; + class CheckPlugin extends ServerPlugin { /** @var Server */ @@ -53,7 +54,7 @@ public function checkToS(RequestInterface $request, ResponseInterface $response) // we instantiate the checker here to make sure sabre auth backend was triggered $checker = \OCP\Server::get(Checker::class); if (!$checker->currentUserHasSigned()) { - throw new Forbidden($checker->getForbiddenMessage()); + throw new TermsNotSignedException($checker->getForbiddenMessage()); } return true; } diff --git a/lib/TermsNotSignedException.php b/lib/TermsNotSignedException.php new file mode 100644 index 00000000..f14ae8b4 --- /dev/null +++ b/lib/TermsNotSignedException.php @@ -0,0 +1,15 @@ +