summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 538ef17)
raw | patch | inline | side by side (parent: 538ef17)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Dec 2008 12:29:01 +0000 (12:29 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Dec 2008 12:29:01 +0000 (12:29 +0000) |
-Add and remove acls if user is removed or mail account is created.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13203 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13203 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/mail/personal/mail/class_mail-methods.inc | patch | blob | history | |
gosa-plugins/mail/personal/mail/class_mailAccount.inc | patch | blob | history |
diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods.inc b/gosa-plugins/mail/personal/mail/class_mail-methods.inc
index 7490d8c3fc2fdefcbc142d8f76f931d10554bdbc..b22c042683cb4041fa0b6949cb5f98cbd2fe3e92 100644 (file)
protected $parent = NULL;
protected $MailServer = "";
-
protected $acl_map = array(
"lrsw" => "read",
"lrswp" => "post",
diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc
index ccad100f2d001db248428ab9266ff98710a8c131..d5b87ef2e9c3b370544a1e09cc4c8c86e754d48d 100644 (file)
function execute()
{
+
/* Call parent execute */
$display = plugin::execute();
$this->mail = $this->mail."@".$this->mailDomainPart;
}
+ /* Update sharedFolder dependencies.
+ Open each shared folder and remove this account.
+ Then Save the group to ensure that all necessary
+ actions will be taken (imap acls updated aso.).
+ */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(&(objectClass=posixGroup)(objectClass=gosaMailAccount)(memberUid=".$this->uid."))",array("dn"));
+ while($attrs = $ldap->fetch()){
+ $grp = new grouptabs($this->config, $this->config->data['TABS']['GROUPTABS'], $attrs['dn']);
+ if(isset($grp->by_object['mailgroup']) && isset($grp->by_object['group'])){
+ $grp->by_object['group']->removeUser($this->uid);
+
+ /* Do not save the complete group! This will quit the complete membership
+ */
+ $grp->by_object['mailgroup']->save();
+ }
+ }
+
/* Remove GOsa attributes */
plugin::remove_from_parent();
msg_dialog::display(_("Mail error"), sprintf(_("Cannot remove mailbox! Error was: %s."),
$this->mailMethod->get_error()), ERROR_DIALOG);
}
- if(!$this->mailMethod->updateSharedFolder()){
- msg_dialog::display(_("Mail error"), sprintf(_("Cannot update shared folder permissions! Error was: %s."),
- $this->mailMethod->get_error()), ERROR_DIALOG);
- }
}
}
$this->mailMethod->disconnect();
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
-
-
if (!$ldap->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
if (!is_integer(strpos($this->gosaMailDeliveryMode, "C"))){
-
/* Do not write sieve settings if this account is new and
doesn't seem to exist.
*/
}
}
}else{
-
echo "Check sieve management here";
-
@DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,
"User uses an own sieve script, skipping sieve update.".$str."</b>","");
}
+ }
+ }
+ $this->mailMethod->disconnect();
- if(!$this->mailMethod->updateSharedFolder()){
- msg_dialog::display(_("Mail error"), sprintf(_("Cannot update shared folder permissions! Error was: %s."),
- $this->mailMethod->get_error()), ERROR_DIALOG);
+ /* Update sharedFolder dependencies.
+ Open each shared folder and remove this account.
+ Then Save the group to ensure that all necessary
+ actions will be taken (imap acls updated aso.).
+ */
+ if(!$this->initially_was_account){
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(&(objectClass=posixGroup)(objectClass=gosaMailAccount)(memberUid=".$this->uid."))",array("dn"));
+ while($attrs = $ldap->fetch()){
+ $grp = new grouptabs($this->config, $this->config->data['TABS']['GROUPTABS'], $attrs['dn']);
+ if(isset($grp->by_object['mailgroup'])){
+ /* Do not save the complete group! This will quit the complete membership
+ */
+ $grp->by_object['mailgroup']->save();
}
}
}
- $this->mailMethod->disconnect();
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){