From 5ce31fee3d6718c6840495377830cf593c47eb12 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 11 Dec 2008 09:11:33 +0000 Subject: [PATCH] Updated group mail checks. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13257 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/groups/mail/class_groupMail.inc | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc index 8590f619c..78cf45519 100644 --- a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc +++ b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc @@ -43,6 +43,7 @@ class mailgroup extends plugin var $uid = ""; var $cn =""; + var $orig_cn = ""; function __construct (&$config, $dn= NULL, $ui= NULL) { @@ -57,6 +58,7 @@ class mailgroup extends plugin $this->$attr = $this->attrs[$attr][0]; } } + $this->orig_cn = $this->cn; /* Intialize the used mailMethod */ @@ -299,6 +301,16 @@ class mailgroup extends plugin } } + + /**************** + Preset mail attribute + ****************/ + if(empty($this->mail) && $this->mailMethod->mailEqualsCN() && !$this->initially_was_account){ + if($this->mailMethod->domainSelectionEnabled()){ + $this->mail = &$this->parent->by_object['group']->cn; + } + } + /**************** Forward addresses @@ -786,9 +798,19 @@ class mailgroup extends plugin if(!$this->is_account) return array(); $ldap= $this->config->get_ldap_link(); + /* Call common method to give check the hook */ $message= plugin::check(); + /* Ensure that this group isn't renamed if the mailMethod enforces cn mailAttributes + */ + if($this->mailMethod->mailEqualsCN() && $this->initially_was_account){ + if($this->cn != $this->orig_cn){ + $message[] = sprintf(_("The groups 'cn' has changed! The cn attribute can't be changed due to the fact that this mail method '%s' relies on it.") + ,get_class($this->mailMethod)); + } + } + if(empty($this->gosaMailServer)){ $message[]= msgPool::noserver(_("Mail")); } -- 2.30.2