From: hickert Date: Tue, 2 Nov 2010 08:48:22 +0000 (+0000) Subject: Updated groupware account. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8eb4041af817489918a00670ce99bc10b1ef06de;p=gosa.git Updated groupware account. -Fixed seqfault problems, endless loops within save(). -Added check to prevent selecting a used mailAddress. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20164 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc index e12df2ad8..70325a35c 100644 --- a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc @@ -225,6 +225,7 @@ class Groupware extends plugin $this->initially_was_account = $this->is_account = $status; if($this->is_account){ $response = $this->groupwareDao->getComprehensiverUser($this->uid); + $this->saved_attributes = $response; $this->mapComprehensiveUserData($response); } $this->accountInitialized = TRUE; @@ -886,18 +887,31 @@ class Groupware extends plugin if(!tests::is_email ($this->mailAddress)){ $messages[] = msgPool::invalid(_("Mail address"),$this->mailAddress , "", "user@exdom.intranet.gonicus.de knibbel"); } + + // Ensure that the mailAddress isn't used yet. + if(!count($messages) && ( + !$this->initially_was_account || + $this->mailAddress != $this->saved_attributes['primaryMail'])){ + $exists = $this->rpcExec("gwMailAddressExists", $this->mailAddress); + if($this->rpcError){ + $messages[] = sprintf(_("Failed to validate mail address '%s'."), $this->mailAddress); + }elseif($exists){ + $messages[] = msgPool::duplicated(_("Mail address")); + } + } } - //checks for feature "quotaUsage" - if ($this->isFeatureEnabled("quotaUsage")){} - - //checks for feature "mailLocations" - if ($this->isFeatureEnabled("mailLocations")){} - - //checks for feature "mailFilter" - if ($this->isFeatureEnabled("mailFilter")){} - //checks for feature "alternateAddresses" - if ($this->isFeatureEnabled("alternateAddresses")){} +# //checks for feature "quotaUsage" +# if ($this->isFeatureEnabled("quotaUsage")){} +# +# //checks for feature "mailLocations" +# if ($this->isFeatureEnabled("mailLocations")){} +# +# //checks for feature "mailFilter" +# if ($this->isFeatureEnabled("mailFilter")){} +# +# //checks for feature "alternateAddresses" +# if ($this->isFeatureEnabled("alternateAddresses")){} //checks for feature "forwardingAddresses" if ($this->isFeatureEnabled("forwardingAddresses")){ @@ -954,17 +968,17 @@ class Groupware extends plugin } } - //checks for feature "mailBoxAutomaticRemoval" - if ($this->isFeatureEnabled("mailBoxAutomaticRemoval")){} - - //checks for feature "localDeliveryOnly" - if ($this->isFeatureEnabled("localDeliveryOnly")){} - - //checks for feature "dropOwnMails" - if ($this->isFeatureEnabled("dropOwnMails")){} - - //checks for feature "mailFolder" - if ($this->isFeatureEnabled("mailFolder")){} +# //checks for feature "mailBoxAutomaticRemoval" +# if ($this->isFeatureEnabled("mailBoxAutomaticRemoval")){} +# +# //checks for feature "localDeliveryOnly" +# if ($this->isFeatureEnabled("localDeliveryOnly")){} +# +# //checks for feature "dropOwnMails" +# if ($this->isFeatureEnabled("dropOwnMails")){} +# +# //checks for feature "mailFolder" +# if ($this->isFeatureEnabled("mailFolder")){} return($messages); } @@ -1069,7 +1083,12 @@ class Groupware extends plugin break; } } - $this->save("private_folderACLS", $id, $val["acls"]); + + #FIXME: HAPE: + # What the hell is this? + # You call save() from save() from save() aso... + # Got seqfaults in apache client ... + # - $this->save("private_folderACLS", $id, $val["acls"]); } } }