diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc
index e19c3a0691f79e0243d22bd4e3d50afbd240af83..4587546aeb8efd6e1d58c963a4a1c3c0ff421b71 100644 (file)
*/
/* Load sieve support */
-@require_once ("class_sieve.inc");
+require_once ("class_sieve.inc");
/* Load mail methods */
global $BASE_DIR;
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Load templating engine */
$smarty= get_smarty();
$display= "";
+ $mailserver= array();
+ foreach ($this->config->data['SERVERS']['IMAP'] as $key => $val){
+ $mailserver[]= $key;
+ }
+
/* Do we need to flip is_account state? */
if (isset($_POST['modify_state'])){
$this->is_account= !$this->is_account;
}
+ /* Show main page */
+ $mailserver= array();
+ foreach ($this->config->data['SERVERS']['IMAP'] as $key => $val){
+ $mailserver[]= $key;
+ }
+
/* Do we represent a valid account? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
_("This account has no mail extensions.")."</b>";
+
$display.= back_to_main();
return ($display);
}
$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."));
+ $display= $this->show_header(_("Create mail account"), _("This account has mail features disabled. You can enable them by clicking below."));
return ($display);
}
}
return ($display);
}
- /* Show main page */
- $mailserver= array();
- foreach ($this->config->data['SERVERS']['IMAP'] as $key => $val){
- $mailserver[]= $key;
- }
$smarty->assign("mailServers", $mailserver);
foreach(array("gosaMailServer", "gosaMailQuota", "perms", "mail",
"gosaMailAlternateAddress", "gosaMailForwardingAddress",
}
if (is_numeric($this->gosaMailQuota) && $this->gosaMailQuota != 0){
- $smarty->assign("quotausage", $this->quotaUsage * 100 / $this->gosaMailQuota);
+ $smarty->assign("quotausage", progressbar(round(($this->quotaUsage * 100)/ $this->gosaMailQuota,100,15,true)));
$smarty->assign("quotadefined", "true");
} else {
$smarty->assign("quotadefined", "false");
$smarty->assign("custom_sieveACL", chkacl($this->acl, "custom_sieve"));
$smarty->assign("only_localACL", chkacl($this->acl, "only_local"));
- if(count($this->gosaMailAlternateAddress)){
- $smarty->assign("SELECT_gosaMailAlternateAddress",true);
- } else {
- $smarty->assign("SELECT_gosaMailAlternateAddress",false);
- }
-
- if(count($this->mailboxList)){
- $smarty->assign("SELECT_spambox",true);
- } else {
- $smarty->assign("SELECT_spambox",false);
- }
-
- if(count($this->vacation)) {
- $smarty->assign("SELECT_vacationtemplates",true);
- } else {
- $smarty->assign("SELECT_vacationtemplates",false);
- }
-
- if(count($this->gosaMailForwardingAddress)){
- $smarty->assign("SELECT_gosaMailForwardingAddress",true);
- } else {
- $smarty->assign("SELECT_gosaMailForwardingAddress",false);
- }
-
- if(count($mailserver)){
- $smarty->assign("SELECT_mailServers",true);
- } else {
- $smarty->assign("SELECT_mailServers",false);
- }
-
$display.= $smarty->fetch (get_template_path('generic.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
$method->fixAttributesOnRemove($this);
/* Mailmethod wants us to remove the entry from LDAP. Keep uid! */
+ #fixme: || kolab || is differs here, you can't delete all attrs specified in this plugin ....
+ #fixme: there are some attributes we have to keep, i think.
unset ($this->attrs['uid']);
+
+
+
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
$this->attributes, "Save");
$ldap->cd($this->dn);
$id= $method->uattrib;
$method->fixAttributesOnStore($this);
+ /* Remove Mailquota if = "" */
+ if($this->attrs['gosaMailQuota']=="") {
+ $this->attrs['gosaMailQuota']=array();
+ }
+
+ if(empty($this->attrs['gosaSpamMailbox'])){
+ unset($this->attrs['gosaSpamMailbox']);
+ }
+
/* Save data to LDAP */
$ldap->cd($this->dn);
$ldap->modify($this->attrs);
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){
if ($this->is_modified){
- $this->handle_post_events("mofify");
+ $this->handle_post_events("modify");
}
} else {
$this->handle_post_events("add");
$message= array();
+ if(empty($this->gosaMailServer)){
+ $message[]= _("There is no valid mailserver specified, please add one in the system setup.");
+ }
+
/* must: mail */
if ($this->mail == ""){
$message[]= _("The required field 'Primary address' is not set.");
}
}
$ldap->cd($this->config->current['BASE']);
- $ldap->search ("(&(objectClass=gosaMailAccount)(!(objectClass=gosaUserTemplate))(|(mail=".$this->mail.")(gosaMailAlternateAddress=".
+ $ldap->search ("(&(!(objectClass=gosaUserTemplate))(|(mail=".$this->mail.")(gosaMailAlternateAddress=".
$this->mail."))(!(uid=".$this->uid."))(!(cn=".$this->uid.")))", array("uid"));
if ($ldap->count() != 0){
$message[]= _("The primary address you've entered is already in use.");
$message[]= _("You need to set the maximum mail size in order to reject anything.");
}
+ if((preg_match("/S/", $this->gosaMailDeliveryMode))&&(empty($this->gosaSpamMailbox))) {
+ $message[]= _("You specified Spam settings, but there is no Folder specified.");
+ }
+
return ($message);
}