* update/set share password * * @param $shareId * @param string|null $password * @param string|null $canEdit * @param string|null $domain * @return bool */
($shareId, $password = null, $canEdit = null, $domain = null)
| 326 | * @return bool |
| 327 | */ |
| 328 | public function update($shareId, $password = null, $canEdit = null, $domain = null) { |
| 329 | if ($password !== null) { |
| 330 | $password = password_hash($password, PASSWORD_DEFAULT); |
| 331 | return $this->ShareMapper->updateSharePassword($shareId, $password); |
| 332 | } |
| 333 | if ($domain !== null) { |
| 334 | return $this->ShareMapper->updateShareDomain($shareId, $domain); |
| 335 | } |
| 336 | if ($canEdit !== null) { |
| 337 | $canEdit === true ? $canEdit = \OCP\Constants::PERMISSION_UPDATE : $canEdit = \OCP\Constants::PERMISSION_READ; |
| 338 | return $this->ShareMapper->updateSharePermissions($shareId, $canEdit); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | /** |
| 343 | * generate to token used to authenticate federated shares |
nothing calls this directly
no test coverage detected