Move password update hook after update

This commit is contained in:
Roeland Jago Douma 2016-02-09 10:38:12 +01:00
parent 623a0e4637
commit 12afd7b005

View file

@ -595,14 +595,6 @@ class Manager implements IManager {
if ($share->getPassword() !== null) {
$share->setPassword($this->hasher->hash($share->getPassword()));
}
\OC_Hook::emit('OCP\Share', 'post_update_password', [
'itemType' => $share->getNode() instanceof \OCP\Files\File ? 'file' : 'folder',
'itemSource' => $share->getNode()->getId(),
'uidOwner' => $share->getSharedBy(),
'token' => $share->getToken(),
'disabled' => is_null($share->getPassword()),
]);
}
if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
@ -627,6 +619,16 @@ class Manager implements IManager {
]);
}
if ($share->getPassword() !== $originalShare->getPassword()) {
\OC_Hook::emit('OCP\Share', 'post_update_password', [
'itemType' => $share->getNode() instanceof \OCP\Files\File ? 'file' : 'folder',
'itemSource' => $share->getNode()->getId(),
'uidOwner' => $share->getSharedBy(),
'token' => $share->getToken(),
'disabled' => is_null($share->getPassword()),
]);
}
if ($share->getPermissions() !== $originalShare->getPermissions()) {
$userFolder = $this->rootFolder->getUserFolder($share->getShareOwner());
\OC_Hook::emit('OCP\Share', 'post_update_permissions', array(