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