X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-plugins%2Fmail%2Fpersonal%2Fmail%2Fclass_mailAccount.inc;h=3f1a07d78f2a3260ddcabd6da315bb234ce24276;hb=fbf8e4356f625423e3ccfcb0c6520942726a44e1;hp=09ae77ebfdad26db3e7e07aa85fe6586a71355bd;hpb=64e1a22ee53e552e1ed52bedc9afdc72da267c6a;p=gosa.git diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc index 09ae77ebf..3f1a07d78 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -89,7 +89,7 @@ class mailAccount extends plugin if ($cls && class_exists($cls)){ $this->method= $cls; } else { - msg_dialog::display(_("Configuration error"), sprintf(_("Unkown mail method '%s' specified!"), $method), ERROR_DIALOG); + msg_dialog::display(_("Configuration error"), sprintf(_("Mail method '%s' is unknown!"), $method), ERROR_DIALOG); } } @@ -286,7 +286,7 @@ class mailAccount extends plugin if(!$this->multiple_support_active){ if (!$this->is_account && $this->parent === NULL){ $display= "\"\" ". - _("This account has no mail extensions.").""; + msgPool::noValidExtension(_("Mail")).""; $display.= back_to_main(); return ($display); @@ -296,14 +296,15 @@ class mailAccount extends plugin if ($this->parent !== NULL){ if ($this->is_account){ if($this->accountDelegationsConfigured()){ - $display= $this->show_disable_header(_("Remove mail account"), - _("This account can't be removed while there are delegations configured. Remove those delegations first."),TRUE,TRUE); + $display= $this->show_disable_header(msgPool::removeFeaturesButton(_("Mail")), + _("Mail settings cannot be removed while there are delegations configured!"),TRUE,TRUE); }else{ - $display= $this->show_disable_header(_("Remove mail account"), - _("This account has mail features enabled. You can disable them by clicking below.")); + $display= $this->show_disable_header(msgPool::removeFeaturesButton(_("Mail")), + msgPool::featuresEnabled(_("Mail"))); } } else { - $display= $this->show_enable_header(_("Create mail account"), _("This account has mail features disabled. You can enable them by clicking below.")); + $display= $this->show_enable_header(msgPool::addFeaturesButton(_("Mail")), + msgPool::featuresDisabled(_("Mail"))); return ($display); } } @@ -326,21 +327,26 @@ class mailAccount extends plugin /* Finished adding of locals? */ if (isset($_POST['add_locals_finish'])){ - /* Check if we are able to write gosaMailForwardingAddress */ - if($this->acl_is_writeable("gosaMailForwardingAddress")){ + if (isset($_POST['local_list'])){ - /* Walk through list of forwarders, ignore own addresses */ - foreach ($_POST['local_list'] as $val){ - if (!in_array ($val, $this->gosaMailAlternateAddress) && - $val != $this->mail){ + /* Check if we are able to write gosaMailForwardingAddress */ + if($this->acl_is_writeable("gosaMailForwardingAddress")){ - $this->addForwarder($val); - $this->is_modified= TRUE; + /* Walk through list of forwarders, ignore own addresses */ + foreach ($_POST['local_list'] as $val){ + if (!in_array ($val, $this->gosaMailAlternateAddress) && + $val != $this->mail){ + + $this->addForwarder($val); + $this->is_modified= TRUE; + } } } + $this->forward_dialog= FALSE; + $this->dialog= FALSE; + } else { + msg_dialog::display(_("Error"), _("Please select an entry!"), ERROR_DIALOG); } - $this->forward_dialog= FALSE; - $this->dialog= FALSE; } /* Add forward email addresses */ @@ -356,13 +362,13 @@ class mailAccount extends plugin $valid= TRUE; } else { msg_dialog::display(_("Error"), - msgPool::invalid(_("Mail address"),"","","example@your-domain.com"), + msgPool::invalid(_("Mail address"),"","","your-domain@your-domain.com"), ERROR_DIALOG); } } } elseif ($address == $this->mail || in_array($address, $this->gosaMailAlternateAddress)) { - msg_dialog::display(_("Error"),_("Cannot add your primary address to the list of forwarders.") , ERROR_DIALOG); + msg_dialog::display(_("Error"),_("Cannot add primary address to the list of forwarders!") , ERROR_DIALOG); } else { $valid= TRUE; } @@ -392,7 +398,7 @@ class mailAccount extends plugin if ($this->is_template){ if (!(tests::is_email($_POST['alternate_address'], TRUE))){ msg_dialog::display(_("Error"), - msgPool::invalid(_("Mail address"),"","","example@your-domain.com"), + msgPool::invalid(_("Mail address"),"","","your-domain@your-domain.com"), ERROR_DIALOG); } else { @@ -400,7 +406,7 @@ class mailAccount extends plugin } } else { msg_dialog::display(_("Error"), - msgPool::invalid(_("Mail address"),"","","example@your-domain.com"), + msgPool::invalid(_("Mail address"),"","","your-domain@your-domain.com"), ERROR_DIALOG); } @@ -412,7 +418,7 @@ class mailAccount extends plugin $ui= get_userinfo(); if ($user != $ui->username){ msg_dialog::display(_("Error"), msgPool::duplicated(_("Mail address"))." ". - sprintf(_("Already used by user '%s'."), $user), ERROR_DIALOG); + sprintf(_("Address is already in use by user '%s'."), $user), ERROR_DIALOG); } } } @@ -505,7 +511,7 @@ class mailAccount extends plugin $smarty->assign("usearch_image", get_template_path('images/search_user.png')); $smarty->assign("tree_image", get_template_path('images/tree.png')); $smarty->assign("infoimage", get_template_path('images/info.png')); - $smarty->assign("launchimage", get_template_path('images/small_filter.png')); + $smarty->assign("launchimage", get_template_path('images/lists/action.png')); $smarty->assign("mailusers", $mailusers); if (isset($_POST['depselect'])){ $smarty->assign("depselect", $_POST['depselect']); @@ -598,9 +604,7 @@ class mailAccount extends plugin for($y= $date['year']-10; $y<$date['year']+10; $y++){ $years[]= $y; } - $months= array(_("January"), _("February"), _("March"), _("April"), - _("May"), _("June"), _("July"), _("August"), _("September"), - _("October"), _("November"), _("December")); + $months= msgPool::months(); $smarty->assign("start_day", $date["mday"]); $smarty->assign("days", $days); $smarty->assign("months", $months); @@ -687,7 +691,9 @@ class mailAccount extends plugin /* Add "view" to logging class */ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/mail account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Connect to IMAP server for account deletion */ if ($this->gosaMailServer != ""){ @@ -853,7 +859,9 @@ class mailAccount extends plugin $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/mail account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Log last action */ if($this->initially_was_account){ @@ -916,7 +924,7 @@ class mailAccount extends plugin $message= plugin::check(); if(empty($this->gosaMailServer)){ - $message[]= _("There is no valid mailserver specified, please add one in the system setup."); + $message[]= msgPool::noserver(_("Mail")); } /* must: mail */ @@ -929,7 +937,7 @@ class mailAccount extends plugin } } else { if (!tests::is_email($this->mail)){ - $message[]= msgPool::invalid(_("Mail address"),"","","example@your-domain.com"); + $message[]= msgPool::invalid(_("Mail address"),"","","your-domain@your-domain.com"); } } $ldap->cd($this->config->current['BASE']); @@ -974,11 +982,16 @@ class mailAccount extends plugin /* Adapt from template, using 'dn' */ - function adapt_from_template($dn) + function adapt_from_template($dn, $skip= array()) { - plugin::adapt_from_template($dn); + plugin::adapt_from_template($dn, $skip); foreach (array("gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){ + + if (in_array($val, $skip)){ + continue; + } + $this->$val= array(); if (isset($this->attrs["$val"]["count"])){ for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){ @@ -1006,7 +1019,7 @@ class mailAccount extends plugin reset ($this->gosaMailForwardingAddress); $this->is_modified= TRUE; }else{ - msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses."), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses!"), ERROR_DIALOG); } } @@ -1018,7 +1031,7 @@ class mailAccount extends plugin $this->gosaMailForwardingAddress= array_remove_entries ($addresses, $this->gosaMailForwardingAddress); $this->is_modified= TRUE; }else{ - msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses."), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses!"), ERROR_DIALOG); } } @@ -1051,7 +1064,7 @@ class mailAccount extends plugin reset ($this->gosaMailAlternateAddress); return (""); }else{ - msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses."), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses!"), ERROR_DIALOG); } } @@ -1062,7 +1075,7 @@ class mailAccount extends plugin $this->gosaMailAlternateAddress= array_remove_entries ($addresses,$this->gosaMailAlternateAddress); $this->is_modified= TRUE; }else{ - msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses."), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses!"), ERROR_DIALOG); } } @@ -1127,9 +1140,9 @@ class mailAccount extends plugin if($ldap->count()){ $attrs = $ldap->fetch(); if(isset($attrs['kolabDeleteFlag'])){ - return(_("Waiting for kolab to remove mail properties.")); + return(_("Waiting for kolab to remove mail properties...")); }elseif(in_array("gosaMailAccount",$attrs['objectClass'])){ - return(_("Please remove the mail account first, to allow kolab to call its remove methods.")); + return(_("Please remove the mail settings first to allow kolab to call its remove methods!")); } } } @@ -1325,13 +1338,13 @@ class mailAccount extends plugin $message = plugin::multiple_check(); if(empty($this->gosaMailServer) && in_array("gosaMailServer",$this->multi_boxes)){ - $message[]= _("There is no valid mailserver specified, please add one in the system setup."); + $message[]= msgPool::noserver(_("Mail")); } /* Check quota */ if ($this->gosaMailQuota != '' && in_array("gosaMailQuota",$this->multi_boxes)){ if (!is_numeric($this->gosaMailQuota)) { - $message[]= _("Value in 'Quota size' is not valid."); + $message[]= msgPool::invalid(_("Quota size"),$this->gosaMailQuota,"/^[0-9]*/"); } else { $this->gosaMailQuota= (int) $this->gosaMailQuota; } @@ -1340,19 +1353,19 @@ class mailAccount extends plugin /* Check rejectsize for integer */ if ($this->gosaMailMaxSize != '' && in_array("gosaMailMaxSize",$this->multi_boxes)){ if (!is_numeric($this->gosaMailMaxSize)){ - $message[]= _("Please specify a vaild mail size for mails to be rejected."); + $message[]= msgPool::invalid(_("Mail reject size"),$this->gosaMailMaxSize,"/^[0-9]*/"); } else { $this->gosaMailMaxSize= (int) $this->gosaMailMaxSize; } } if(empty($this->gosaSpamMailbox) && in_array("gosaSpamMailbox",$this->multi_boxes)){ - $message[]= _("You specified Spam settings, but there is no Folder specified."); + $message[]= msgPool::required(_("Spam folder")); } if ( in_array("use_vacation",$this->multi_boxes) && preg_match('/V/', $this->gosaMailDeliveryMode) && $this->gosaVacationStart > $this->gosaVacationStop){ - $message[]= _("Time interval to show vacation message is not valid."); + $message[]= msgPool::invalid(_("Vacation interval")); } return($message); }