1 | <?php |
||
35 | class ProxyController extends Controller { |
||
36 | |||
37 | /** |
||
38 | * @var \OCP\IURLGenerator |
||
39 | */ |
||
40 | private $urlGenerator; |
||
41 | |||
42 | /** |
||
43 | * @var \OCP\ISession |
||
44 | */ |
||
45 | private $session; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | private $referrer; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | private $hostname; |
||
56 | |||
57 | /** |
||
58 | * @param string $appName |
||
59 | * @param \OCP\IRequest $request |
||
60 | * @param IURLGenerator $urlGenerator |
||
61 | * @param \OCP\ISession $session |
||
62 | */ |
||
63 | 5 | public function __construct($appName, IRequest $request, |
|
71 | |||
72 | /** |
||
73 | * @NoAdminRequired |
||
74 | * @NoCSRFRequired |
||
75 | * |
||
76 | * @param string $src |
||
77 | * |
||
78 | * @throws \Exception If the URL is not valid. |
||
79 | * @return TemplateResponse |
||
80 | */ |
||
81 | 5 | public function redirect($src) { |
|
104 | |||
105 | /** |
||
106 | * @NoAdminRequired |
||
107 | * @NoCSRFRequired |
||
108 | * |
||
109 | * @param string $src |
||
110 | * |
||
111 | * TODO: Cache the proxied content to prevent unnecessary requests from the oC server |
||
112 | * The caching should also already happen in a cronjob so that the sender of the |
||
113 | * mail does not know whether the mail has been opened. |
||
114 | * |
||
115 | * @return ProxyDownloadResponse |
||
116 | */ |
||
117 | public function proxy($src) { |
||
124 | |||
125 | /** |
||
126 | * Version hack for \OCP\IHelper |
||
127 | * |
||
128 | * @todo remove version-hack once core 8.1+ is supported |
||
129 | * |
||
130 | * @param type $src |
||
131 | * @return type |
||
132 | */ |
||
133 | private function getUrlContent($src) { |
||
141 | |||
142 | } |
||
143 |