SharingCheckMiddleware

Extends \OCA\Gallery\Middleware\CheckMiddleware

Checks whether the "sharing check" is enabled

package

OCA\Gallery\SharingCheckMiddleware

Methods

__construct

__construct( $appName, \OCP\IRequest $request, \OCP\IURLGenerator $urlGenerator, \OCP\ILogger $logger) 
inherited

Arguments

$appName

$request

\OCP\IRequest

$urlGenerator

\OCP\IURLGenerator

$logger

\OCP\ILogger

If a CheckException is being caught, clients who sent an ajax requests get a JSON error response while the others are redirected to an error page

afterException( $controller,  $methodName, \Exception $exception) 
inherited
inheritDoc

Arguments

$controller

$methodName

$exception

\Exception

Checks if sharing is enabled before the controllers is executed

beforeController( $controller,  $methodName) 

Inspects the controller method annotations and if PublicPage is found it makes sure that sharing is enabled in the configuration settings

The check is not performed on "guest" pages which don't require sharing to be enabled

inheritDoc

Arguments

$controller

$methodName

Decides which type of response to send

computeResponse(string $message, integer $code) : \OCP\AppFramework\Http\JSONResponse|\OCP\AppFramework\Http\RedirectResponse|\OCP\AppFramework\Http\TemplateResponse
inherited

Arguments

$message

string

$code

integer

Response

\OCP\AppFramework\Http\JSONResponse|\OCP\AppFramework\Http\RedirectResponse|\OCP\AppFramework\Http\TemplateResponse

Checks whether public sharing (via links) is enabled

isSharingEnabled() : boolean

Response

boolean

Redirects the client to an error page

redirectToErrorPage(string $message, integer $code) : \OCP\AppFramework\Http\RedirectResponse
inherited

Arguments

$message

string

$code

integer

Response

\OCP\AppFramework\Http\RedirectResponse

Shows an authentication form

sendHtml401() : \OCP\AppFramework\Http\TemplateResponse
inherited

Response

\OCP\AppFramework\Http\TemplateResponse

Redirects the client to an error page or shows an authentication form

sendHtmlResponse(string $message, integer $code) : \OCP\AppFramework\Http\RedirectResponse|\OCP\AppFramework\Http\TemplateResponse
inherited

Arguments

$message

string

$code

integer

Response

\OCP\AppFramework\Http\RedirectResponse|\OCP\AppFramework\Http\TemplateResponse

Returns a JSON response to the client

sendJsonResponse(string $message, integer $code) : \OCP\AppFramework\Http\JSONResponse
inherited

Arguments

$message

string

$code

integer

Response

\OCP\AppFramework\Http\JSONResponse

Properties

config

config : \OCP\IConfig
var

Type(s)

\OCP\IConfig

reflector

reflector : \OCP\AppFramework\Utility\IControllerMethodReflector
var

Type(s)

\OCP\AppFramework\Utility\IControllerMethodReflector

appName

appName : string
inherited
var

Type(s)

string

request

request : \OCP\IRequest
inherited
var

Type(s)

\OCP\IRequest

urlGenerator

urlGenerator : \OCP\IURLGenerator
inherited
var

Type(s)

\OCP\IURLGenerator

logger

logger : \OCP\ILogger
inherited
var

Type(s)

\OCP\ILogger