X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_mail-methods-cyrus.inc;h=6448e94bd5ade42f29726c4267eaf738bc258c69;hb=e4bf3ecc1b431adcb5b9ad1bdf58d7e3739f6849;hp=239cd2e8a10522f10576c7701a2ab7246be7dfeb;hpb=c2c6a6e54355a1b67c25bb4d761d847513810d02;p=gosa.git diff --git a/include/class_mail-methods-cyrus.inc b/include/class_mail-methods-cyrus.inc index 239cd2e8a..6448e94bd 100644 --- a/include/class_mail-methods-cyrus.inc +++ b/include/class_mail-methods-cyrus.inc @@ -18,7 +18,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - class mailMethodCyrus extends mailMethod { var $mbox= "-"; @@ -32,12 +31,21 @@ class mailMethodCyrus extends mailMethod function connect($gosaMailServer) { + $cfg=array(); + /* Connect to IMAP server. I don't want to see these warning here... */ - error_reporting (0); $this->gosaMailServer= $gosaMailServer; - $cfg= $this->config[$gosaMailServer]; + if (!isset($this->config[$gosaMailServer])){ + print_red(_("Warning: Account has an invalid mailserver string! Please check the mail server settings in the mail tab.")); + } else { + $cfg= $this->config[$gosaMailServer]; + } + /* For some reason, hiding errors with @ does not wor here... */ + if(!isset($cfg['connect'])) $cfg['connect']=""; + if(!isset($cfg['admin'])) $cfg['admin']=""; + if(!isset($cfg['password'])) $cfg['password']=""; + $this->mbox = @imap_open($cfg['connect'], $cfg['admin'], $cfg['password'], OP_HALFOPEN); - error_reporting (E_ALL); /* Mailbox reachable? */ if ($this->mbox === FALSE){ @@ -65,7 +73,7 @@ class mailMethodCyrus extends mailMethod $result['quotaUsage']= $quota_value["STORAGE"]['usage']; $result['gosaMailQuota']= $quota_value["STORAGE"]['limit']; } else { - /* backward compatible */ + /* backward icompatible */ $result['quotaUsage']= $quota_value['usage']; $result['gosaMailQuota']= $quota_value['limit']; } @@ -115,7 +123,7 @@ class mailMethodCyrus extends mailMethod { /* Workaround for the php imap extension */ if ($gosaMailQuota == ""){ - $gosaMailQuota= "0"; + $gosaMailQuota= "-1"; } /* Write mail quota */ @@ -129,12 +137,6 @@ class mailMethodCyrus extends mailMethod function setSharedFolderPermissions($folder, $permissions) { - /* Show warning message in case of missing imap_getacl */ - if (!function_exists('imap_getacl')){ - print_red (_("Warning: imap_getacl is not implemented, wouldn't modify acl informations.")); - return; - } - /* Get list of subfolders */ $folders= $this->getMailboxList($folder, ""); $folders[]= $folder; @@ -145,10 +147,12 @@ class mailMethodCyrus extends mailMethod if (function_exists('imap_getacl')){ /* Remove all acl's for this folder */ - $users= imap_getacl ($this->mbox, $subfolder); + $users= @imap_getacl ($this->mbox, $subfolder); foreach ($users as $userid => $perms){ imap_setacl ($this->mbox, $subfolder, $userid, ""); } + } else { + print_red (_("Warning: imap_getacl is not implemented, can't remove acl informations.")); } /* Set permissions for this folder */