1 | <?php |
||
36 | class PageController extends Controller { |
||
37 | |||
38 | use HttpError; |
||
39 | |||
40 | /** @var Environment */ |
||
41 | private $environment; |
||
42 | /** @var IURLGenerator */ |
||
43 | private $urlGenerator; |
||
44 | /** @var IConfig */ |
||
45 | private $appConfig; |
||
46 | /** @var IAppManager */ |
||
47 | private $appManager; |
||
48 | |||
49 | /** |
||
50 | * Constructor |
||
51 | * |
||
52 | * @param string $appName |
||
53 | * @param IRequest $request |
||
54 | * @param Environment $environment |
||
55 | * @param IURLGenerator $urlGenerator |
||
56 | * @param IConfig $appConfig |
||
57 | * @param IAppManager $appManager |
||
58 | */ |
||
59 | 12 | public function __construct( |
|
74 | |||
75 | /** |
||
76 | * @NoAdminRequired |
||
77 | * @NoCSRFRequired |
||
78 | * |
||
79 | * Shows the albums and pictures at the root folder or a message if |
||
80 | * there are no pictures. |
||
81 | * |
||
82 | * This is the entry page for logged-in users accessing the app from |
||
83 | * within ownCloud. |
||
84 | * A TemplateResponse response uses a template from the templates folder |
||
85 | * and parameters provided here to build the page users will see |
||
86 | * |
||
87 | * @return TemplateResponse |
||
88 | */ |
||
89 | 4 | public function index() { |
|
113 | |||
114 | /** |
||
115 | * @PublicPage |
||
116 | * @NoCSRFRequired |
||
117 | * |
||
118 | * Shows the albums and pictures or redirects to the download location the token gives access to |
||
119 | * |
||
120 | * @param string $token |
||
121 | * @param null|string $filename |
||
122 | * |
||
123 | * @return TemplateResponse|ImageResponse|RedirectResponse |
||
124 | */ |
||
125 | 4 | public function publicIndex($token, $filename) { |
|
142 | |||
143 | /** |
||
144 | * @PublicPage |
||
145 | * @NoCSRFRequired |
||
146 | * @Guest |
||
147 | * |
||
148 | * Generates an error page based on the error code |
||
149 | * |
||
150 | * @param int $code |
||
151 | * |
||
152 | * @return TemplateResponse |
||
153 | */ |
||
154 | 3 | public function errorPage($code) { |
|
169 | |||
170 | /** |
||
171 | * Adds the domain "data:" to the allowed image domains |
||
172 | * this function is called by reference |
||
173 | * |
||
174 | * @param TemplateResponse $response |
||
175 | */ |
||
176 | 4 | private function addContentSecurityToResponse($response) { |
|
182 | |||
183 | /** |
||
184 | * @PublicPage |
||
185 | * @NoCSRFRequired |
||
186 | * @Guest |
||
187 | * |
||
188 | * Returns the slideshow template |
||
189 | * |
||
190 | * @return TemplateResponse |
||
191 | */ |
||
192 | 1 | public function slideshow() { |
|
195 | |||
196 | /** |
||
197 | * Shows the albums and pictures the token gives access to |
||
198 | * |
||
199 | * @param $token |
||
200 | * |
||
201 | * @return TemplateResponse |
||
202 | */ |
||
203 | 1 | private function showPublicPage($token) { |
|
224 | |||
225 | /** |
||
226 | * Determines if we can add external shared to this instance |
||
227 | * |
||
228 | * @return array<bool,string> |
||
229 | */ |
||
230 | 1 | private function getServer2ServerProperties() { |
|
240 | } |
||
241 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.