1 | <?php |
||
30 | class SharingCheckMiddleware extends CheckMiddleware { |
||
31 | |||
32 | /** @var IConfig */ |
||
33 | private $config; |
||
34 | /** @var IControllerMethodReflector */ |
||
35 | protected $reflector; |
||
36 | |||
37 | /*** |
||
38 | * Constructor |
||
39 | * |
||
40 | * @param string $appName |
||
41 | * @param IRequest $request |
||
42 | * @param IConfig $appConfig |
||
43 | * @param IControllerMethodReflector $reflector |
||
44 | * @param IURLGenerator $urlGenerator |
||
45 | * @param ILogger $logger |
||
46 | */ |
||
47 | 33 | public function __construct( |
|
65 | |||
66 | /** |
||
67 | * Checks if sharing is enabled before the controllers is executed |
||
68 | * |
||
69 | * Inspects the controller method annotations and if PublicPage is found |
||
70 | * it makes sure that sharing is enabled in the configuration settings |
||
71 | * |
||
72 | * The check is not performed on "guest" pages which don't require sharing |
||
73 | * to be enabled |
||
74 | * |
||
75 | * @inheritDoc |
||
76 | */ |
||
77 | 30 | public function beforeController($controller, $methodName) { |
|
88 | |||
89 | /** |
||
90 | * Checks whether public sharing (via links) is enabled |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | 31 | private function isSharingEnabled() { |
|
103 | |||
104 | } |
||
105 |