* 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)
| 345 | * @return bool |
| 346 | */ |
| 347 | public function update($shareId, $password = null, $canEdit = null, $domain = null) { |
| 348 | if ($password !== null) { |
| 349 | $password = password_hash($password, PASSWORD_DEFAULT); |
| 350 | return $this->ShareMapper->updateSharePassword($shareId, $password); |
| 351 | } |
| 352 | if ($domain !== null) { |
| 353 | return $this->ShareMapper->updateShareDomain($shareId, $domain); |
| 354 | } |
| 355 | if ($canEdit !== null) { |
| 356 | $canEdit === true ? $canEdit = \OCP\Constants::PERMISSION_UPDATE : $canEdit = \OCP\Constants::PERMISSION_READ; |
| 357 | return $this->ShareMapper->updateSharePermissions($shareId, $canEdit); |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | /** |
| 362 | * generate to token used to authenticate federated shares |
nothing calls this directly
no test coverage detected