send notifications when adding and deleting access

This commit is contained in:
Uwe Steinmann 2023-08-31 17:39:43 +02:00
parent a7d4b786a2
commit 3c92ebd942

View File

@ -182,13 +182,20 @@ else if ($action == "setdefault") {
// Modify permission ------------------------------------------------------
else if ($action == "editaccess") {
$oldmode = $mode;
if (isset($userid)) {
$folder->changeAccess($mode, $userid, true);
$oldmode = $folder->changeAccess($mode, $userid, true);
}
else if (isset($groupid)) {
$folder->changeAccess($mode, $groupid, false);
$oldmode = $folder->changeAccess($mode, $groupid, false);
}
if($oldmode != $mode) {
if($notifier) {
// Send notification to subscribers.
$notifier->sendChangedFolderAccessMail($folder, $user);
}
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_edit_access')));
}
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_edit_access')));
}
// Delete Permission ------------------------------------------------------
@ -200,6 +207,10 @@ else if ($action == "delaccess") {
else if (isset($groupid)) {
$folder->removeAccess($groupid, false);
}
if($notifier) {
// Send notification to subscribers.
$notifier->sendChangedFolderAccessMail($folder, $user);
}
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_delete_access')));
}
@ -212,6 +223,10 @@ else if ($action == "addaccess") {
if (isset($groupid) && $groupid != -1) {
$folder->addAccess($mode, $groupid, false);
}
if($notifier) {
// Send notification to subscribers.
$notifier->sendChangedFolderAccessMail($folder, $user);
}
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_access')));
}