index 4c77b2f77b76242d097f7cfa3c94d8c17b57d87b..6eab34624149c8839487f202fed8ec6e1ac8cb32 100644 (file)
/* Connect to IMAP server. I don't want to see these warning here... */
$this->gosaMailServer= $gosaMailServer;
if (!isset($this->config[$gosaMailServer])){
/* Connect to IMAP server. I don't want to see these warning here... */
$this->gosaMailServer= $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."));
+ print_red(_("Warning: Account has an invalid mailserver string!"));
} else {
$cfg= $this->config[$gosaMailServer];
}
} else {
$cfg= $this->config[$gosaMailServer];
}
if(is_array($quota_value)) {
if (isset($quota_value["STORAGE"]) && is_array($quota_value["STORAGE"])){
/* use for PHP >= 4.3 */
if(is_array($quota_value)) {
if (isset($quota_value["STORAGE"]) && is_array($quota_value["STORAGE"])){
/* use for PHP >= 4.3 */
- $result['quotaUsage']= $quota_value["STORAGE"]['usage'];
- $result['gosaMailQuota']= $quota_value["STORAGE"]['limit'];
+ if($quota_value["STORAGE"]['limit'] == 2147483647){
+ $result['quotaUsage']= (int) ($quota_value["STORAGE"]['usage'] / 1024);
+ $result['gosaMailQuota']= (int) ($quota_value["STORAGE"]['limit'] );
+ }else{
+ $result['quotaUsage']= (int) ($quota_value["STORAGE"]['usage'] / 1024);
+ $result['gosaMailQuota']= (int) ($quota_value["STORAGE"]['limit'] / 1024);
+ }
} else {
/* backward icompatible */
} else {
/* backward icompatible */
- $result['quotaUsage']= $quota_value['usage'];
- $result['gosaMailQuota']= $quota_value['limit'];
+ if($quota_value['usage'] == 2147483647){
+ $result['quotaUsage']= (int) ($quota_value['usage'] / 1024);
+ $result['gosaMailQuota']= (int) ($quota_value['limit'] );
+ }else{
+ $result['quotaUsage']= (int) ($quota_value['usage'] / 1024);
+ $result['gosaMailQuota']= (int) ($quota_value['limit'] / 1024);
+ }
}
}
+ }elseif(!$quota_value){
+ return(false);
}
}
+
error_reporting (E_ALL);
error_reporting (E_ALL);
-
return ($result);
}
return ($result);
}
function setQuota($folder, $gosaMailQuota)
{
/* Workaround for the php imap extension */
function setQuota($folder, $gosaMailQuota)
{
/* Workaround for the php imap extension */
- if ($gosaMailQuota == ""){
- $gosaMailQuota= "-1";
+ if (($gosaMailQuota == "") || ($gosaMailQuota== "2147483647")){
+ $gosaMailQuota= "2147483647";
+ }elseif($gosaMailQuota > 0){
+ $gosaMailQuota = $gosaMailQuota *1024;
}
}
-
+
+
/* Write mail quota */
if (!imap_set_quota($this->mbox, $folder, $gosaMailQuota)){
print_red(sprintf(_("Can't write IMAP quota. Server says '%s'."), imap_last_error()));
/* Write mail quota */
if (!imap_set_quota($this->mbox, $folder, $gosaMailQuota)){
print_red(sprintf(_("Can't write IMAP quota. Server says '%s'."), imap_last_error()));
if (function_exists('imap_getacl')){
/* Remove all acl's for this folder */
if (function_exists('imap_getacl')){
/* Remove all acl's for this folder */
- $users= imap_getacl ($this->mbox, $subfolder);
- foreach ($users as $userid => $perms){
- imap_setacl ($this->mbox, $subfolder, $userid, "");
+ $users= @imap_getacl ($this->mbox, $subfolder);
+ if(is_array($users)){
+ 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."));
}
} else {
print_red (_("Warning: imap_getacl is not implemented, can't remove acl informations."));