From: hickert Date: Thu, 10 Aug 2006 06:10:30 +0000 (+0000) Subject: Fixed kolabAccount (Connectivity) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0d202b22255e0d12c16731f34964f7999b127b13;p=gosa.git Fixed kolabAccount (Connectivity) - Deleigations are only available if the user has already a valid kolabAccount Fixed mailAccount - If there are kolabDelegations configured you can't remove the mailAcoount until the delegations are removed. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4453 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc index 6fcbd06f9..6ef941200 100644 --- a/plugins/personal/connectivity/class_kolabAccount.inc +++ b/plugins/personal/connectivity/class_kolabAccount.inc @@ -18,7 +18,7 @@ class kolabAccount extends plugin var $kolabDelegate = array(); /* attribute list for save action */ - var $attributes = array("kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL","kolabDelegate"); + var $attributes = array("kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL","kolabDelegate","kolabInvitationPolicy"); var $objectclasses = array("kolabInetOrgPerson"); /* Helper */ @@ -166,9 +166,10 @@ class kolabAccount extends plugin /* Transfer account states for this union */ if (isset($this->parent) && $this->parent->by_object['mailAccount']->is_account){ $smarty->assign('mail_account', 'true'); - } elseif($this-> initially_was_account && (isset($this->attrs['objectClass']) && (in_array("kolabInetOrgPerson",$this->attrs['objectClass'])))){ + }elseif( isset($this->attrs) && isset($this->attrs['kolabHomeServer'])){ $smarty->assign('mail_account', 'true'); }else{ + $this->is_account= false; $smarty->assign('mail_account', ''); } @@ -249,6 +250,10 @@ class kolabAccount extends plugin /* Optionally execute a command after we're done */ plugin::remove_from_parent(); + /* This plugin and the mailAccount plugin are using the same objectClass + check here if the mail account still activated. + If mailAccount is activated we must re-add the the objectClass. + */ if(!in_array("kolabInetOrgPerson",$this->attrs['objectClass'])){ $this->attrs['objectClass'][] = "kolabInetOrgPerson"; } diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index ffaabee6e..95a46b165 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -257,15 +257,19 @@ class mailAccount extends plugin /* Show tab dialog headers */ if ($this->parent != NULL){ if ($this->is_account){ - $display= $this->show_header(_("Remove mail account"), - _("This account has mail features enabled. You can disable them by clicking below.")); + if($this->accountDelegationsConfigured()){ + $display= $this->show_header(_("Remove mail account"), + _("This account can't be removed while there are delegations configured. Remove those delegations first."),TRUE,TRUE); + }else{ + $display= $this->show_header(_("Remove mail account"), + _("This account has mail features enabled. You can disable them by clicking below.")); + } } else { $display= $this->show_header(_("Create mail account"), _("This account has mail features disabled. You can enable them by clicking below.")); return ($display); } } - /* Forwarder subdialog */ /* Trigger forward add dialog? */ @@ -595,6 +599,22 @@ class mailAccount extends plugin return ($display); } + /* check if we have some delegations configured, those delegations must be removed first */ + function accountDelegationsConfigured() + { + /* We are in administrational edit mode. + Check tab configurations directly */ + if(isset($this->attrs)){ + $checkArray = array("kolabInvitationPolicy","unrestrictedMailSize", "calFBURL","kolabDelegate","kolabFreeBusyFuture"); + foreach($checkArray as $index){ + if(isset($this->attrs[$index])){ + return(true); + } + } + } + return(false); + } + /* remove object from parent */ function remove_from_parent()