diff options
-rw-r--r-- | config/config.sample.php | 4 | ||||
-rw-r--r-- | lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php | 6 | ||||
-rw-r--r-- | lib/private/Files/Storage/DAV.php | 5 |
3 files changed, 13 insertions, 2 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index e6ef5d90797..d998ce560bc 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -357,8 +357,8 @@ $CONFIG = array( 'mail_smtptimeout' => 10, /** - * This depends on ``mail_smtpmode``. Specify when you are using ``ssl`` or - * ``tls``, or leave empty for no encryption. + * This depends on ``mail_smtpmode``. Specify when you are using ``ssl`` for SSL/TLS or + * ``tls`` for STARTTLS, or leave empty for no encryption. * * Defaults to ``''`` (empty string) */ diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php index fc92bea3dc1..db3157bda64 100644 --- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php @@ -116,6 +116,8 @@ class SecurityMiddleware extends Middleware { * @param Controller $controller the controller * @param string $methodName the name of the method * @throws SecurityException when a security check fails + * + * @suppress PhanUndeclaredClassConstant */ public function beforeController($controller, $methodName) { @@ -123,6 +125,10 @@ class SecurityMiddleware extends Middleware { // for normal HTML requests and not for AJAX requests $this->navigationManager->setActiveEntry($this->appName); + if ($controller === \OCA\Talk\Controller\PageController::class && $methodName === 'showCall') { + $this->navigationManager->setActiveEntry('spreed'); + } + // security checks $isPublicPage = $this->reflector->hasAnnotation('PublicPage'); if(!$isPublicPage) { diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index c4ebb0a44dc..2367c1aab3c 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -35,6 +35,7 @@ namespace OC\Files\Storage; use Exception; use GuzzleHttp\Exception\RequestException; +use OCP\Files\ForbiddenException; use OCP\ILogger; use Psr\Http\Message\ResponseInterface; use Icewind\Streams\CallbackWrapper; @@ -829,6 +830,7 @@ class DAV extends Common { * when the authentication expired or is invalid * @throws StorageNotAvailableException if the storage is not available, * which might be temporary + * @throws ForbiddenException if the action is not allowed */ protected function convertException(Exception $e, $path = '') { \OC::$server->getLogger()->logException($e, ['app' => 'files_external', 'level' => ILogger::DEBUG]); @@ -842,6 +844,9 @@ class DAV extends Common { } else if ($e->getHttpStatus() === Http::STATUS_METHOD_NOT_ALLOWED) { // ignore exception for MethodNotAllowed, false will be returned return; + } else if ($e->getHttpStatus() === Http::STATUS_FORBIDDEN){ + // The operation is forbidden. Fail somewhat gracefully + throw new ForbiddenException(get_class($e) . ':' . $e->getMessage()); } throw new StorageNotAvailableException(get_class($e) . ': ' . $e->getMessage()); } else if ($e instanceof ClientException) { |