|
@@ 156-172 (lines=17) @@
|
| 153 |
|
* Show the authentication page |
| 154 |
|
* The form has to submit to the authenticate method route |
| 155 |
|
*/ |
| 156 |
|
public function showAuthenticate(): TemplateResponse { |
| 157 |
|
$templateParameters = ['share' => $this->share]; |
| 158 |
|
|
| 159 |
|
$event = new GenericEvent(null, $templateParameters); |
| 160 |
|
$this->eventDispatcher->dispatch('OCA\Files_Sharing::loadAdditionalScripts::publicShareAuth', $event); |
| 161 |
|
|
| 162 |
|
$response = new TemplateResponse('core', 'publicshareauth', $templateParameters, 'guest'); |
| 163 |
|
if ($this->share->getSendPasswordByTalk()) { |
| 164 |
|
$csp = new ContentSecurityPolicy(); |
| 165 |
|
$csp->addAllowedConnectDomain('*'); |
| 166 |
|
$csp->addAllowedMediaDomain('blob:'); |
| 167 |
|
$csp->allowEvalScript(true); |
| 168 |
|
$response->setContentSecurityPolicy($csp); |
| 169 |
|
} |
| 170 |
|
|
| 171 |
|
return $response; |
| 172 |
|
} |
| 173 |
|
|
| 174 |
|
/** |
| 175 |
|
* The template to show when authentication failed |
|
@@ 177-193 (lines=17) @@
|
| 174 |
|
/** |
| 175 |
|
* The template to show when authentication failed |
| 176 |
|
*/ |
| 177 |
|
protected function showAuthFailed(): TemplateResponse { |
| 178 |
|
$templateParameters = ['share' => $this->share, 'wrongpw' => true]; |
| 179 |
|
|
| 180 |
|
$event = new GenericEvent(null, $templateParameters); |
| 181 |
|
$this->eventDispatcher->dispatch('OCA\Files_Sharing::loadAdditionalScripts::publicShareAuth', $event); |
| 182 |
|
|
| 183 |
|
$response = new TemplateResponse('core', 'publicshareauth', $templateParameters, 'guest'); |
| 184 |
|
if ($this->share->getSendPasswordByTalk()) { |
| 185 |
|
$csp = new ContentSecurityPolicy(); |
| 186 |
|
$csp->addAllowedConnectDomain('*'); |
| 187 |
|
$csp->addAllowedMediaDomain('blob:'); |
| 188 |
|
$csp->allowEvalScript(true); |
| 189 |
|
$response->setContentSecurityPolicy($csp); |
| 190 |
|
} |
| 191 |
|
|
| 192 |
|
return $response; |
| 193 |
|
} |
| 194 |
|
|
| 195 |
|
protected function verifyPassword(string $password): bool { |
| 196 |
|
return $this->shareManager->checkPassword($this->share, $password); |