| @@ 100-103 (lines=4) @@ | ||
| 97 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) { |
|
| 98 | if ($this->shareManager->checkPassword($share, $password)) { |
|
| 99 | return true; |
|
| 100 | } elseif ($this->session->exists('public_link_authenticated') |
|
| 101 | && $this->session->get('public_link_authenticated') === (string)$share->getId()) { |
|
| 102 | return true; |
|
| 103 | } else { |
|
| 104 | if (\in_array('XMLHttpRequest', \explode(',', $this->request->getHeader('X-Requested-With')))) { |
|
| 105 | // do not re-authenticate over ajax, use dummy auth name to prevent browser popup |
|
| 106 | \http_response_code(401); |
|
| @@ 189-195 (lines=7) @@ | ||
| 186 | $this->emitAccessShareHook($share, 403, 'Wrong password'); |
|
| 187 | return false; |
|
| 188 | } |
|
| 189 | } else { |
|
| 190 | // not authenticated ? |
|
| 191 | if (! $this->session->exists('public_link_authenticated') |
|
| 192 | || $this->session->get('public_link_authenticated') !== (string)$share->getId()) { |
|
| 193 | return false; |
|
| 194 | } |
|
| 195 | } |
|
| 196 | return true; |
|
| 197 | } |
|
| 198 | ||