summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e5831eb)
raw | patch | inline | side by side (parent: e5831eb)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 31 May 2006 03:49:01 +0000 (03:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 31 May 2006 03:49:01 +0000 (03:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3570 594d385d-05f5-0310-b6e9-bd551577e9d8
TODO | patch | blob | history | |
include/class_mail-methods-cyrus.inc | patch | blob | history | |
plugins/personal/mail/class_mailAccount.inc | patch | blob | history |
index 6bbda208ddc14476d6ca28448635ca9966838e22..27bf74f60563e659b050723e8aad7f221e4d7037 100644 (file)
--- a/TODO
+++ b/TODO
* Change FAIstate when triggering actions
(install, sysinfo, softupdate)
-* Fix hotplug device adding -> multi[] select
-
* Fix error messages on login
* Fix DNS plugin
index a8e563b604c06349afc0b33902e21a60df0bae02..0e51a9c86d9ab027119270e423097bc3a5622535 100644 (file)
$result['quotaUsage']= $quota_value['usage'];
$result['gosaMailQuota']= $quota_value['limit'];
}
+ }elseif(!$quota_value){
+ return(false);
}
+
error_reporting (E_ALL);
-
return ($result);
}
diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc
index 29ab414ef6034793c0fa24492f05dfa2ca416727..c7eea83a8681709d3277880718877d1b5ade267e 100644 (file)
class mailAccount extends plugin
{
/* Definitions */
- var $plHeadline= "Mail";
- var $plDescription= "This does something";
- var $method= "mailMethod";
+ var $plHeadline = "Mail";
+ var $plDescription = "This does something";
+ var $method = "mailMethod";
/* CLI vars */
- var $cli_summary= "Manage users mail account";
- var $cli_description= "Some longer text\nfor help";
- var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
+ var $cli_summary = "Manage users mail account";
+ var $cli_description = "Some longer text\nfor help";
+ var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
/* plugin specific values */
- var $mail= "";
- var $uid= "";
- var $gosaMailAlternateAddress= array();
- var $gosaMailForwardingAddress= array();
- var $gosaMailDeliveryMode= "[L ]";
- var $gosaMailServer= "";
- var $gosaMailQuota= "";
- var $gosaMailMaxSize= "";
- var $gosaVacationMessage= "";
- var $gosaSpamSortLevel= "";
- var $gosaSpamMailbox= "";
-
- var $quotaUsage= 0;
- var $forward_dialog= FALSE;
- var $folder_prefix= "";
- var $mailboxList= array();
- var $default_permissions= "none";
- var $member_permissions= "post";
- var $members= array();
- var $admins= array();
- var $vacations= array();
- var $perms= array( "lrs" => "read", "lrsp" => "post", "lrsip" => "append",
- "lrswipcd" => "write", "lrswipcda" => "all" );
+ var $mail = "";
+ var $uid = "";
+ var $gosaMailAlternateAddress = array();
+ var $gosaMailForwardingAddress = array();
+ var $gosaMailDeliveryMode = "[L ]";
+ var $gosaMailServer = "";
+ var $gosaMailQuota = "";
+ var $gosaMailMaxSize = "";
+ var $gosaVacationMessage = "";
+ var $gosaSpamSortLevel = "";
+ var $gosaSpamMailbox = "";
+
+ var $quotaUsage = 0;
+ var $forward_dialog = FALSE;
+ var $folder_prefix = "";
+ var $mailboxList = array();
+ var $default_permissions = "none";
+ var $member_permissions = "post";
+ var $members = array();
+ var $admins = array();
+ var $vacations = array();
+ var $perms = array( "lrs" => "read",
+ "lrsp" => "post",
+ "lrsip" => "append",
+ "lrswipcd" => "write",
+ "lrswipcda" => "all" );
/* attribute list for save action */
var $attributes= array("mail", "gosaMailServer", "gosaMailQuota", "gosaMailMaxSize","gosaMailForwardingAddress",
'dn' from LDAP */
function mailAccount ($config, $dn= NULL)
{
- /* Configuration is fine, allways */
- $this->config= $config;
-
/* Load bases attributes */
plugin::plugin($config, $dn);
- /* Set mailMethod to the one defined in gosa.conf */
+
+ /**********************
+ Set mailMethod to the one defined in gosa.conf
+ **********************/
+
if (isset($this->config->current['MAILMETHOD'])){
$method= $this->config->current['MAILMETHOD'];
if (class_exists("mailMethod$method")){
}
}
+
+ /**********************
+ Create the account prefix user. user/
+ **********************/
+
/* Preset folder prefix. Will change it later to respect
altnamespace. */
if (isset($this->config->current['CYRUSUNIXSTYLE']) && $this->config->current['CYRUSUNIXSTYLE'] == "true"){
$this->folder_prefix= "user.";
}
- if ($dn != NULL){
+
+ /**********************
+ This is not a new account, parse additional attributes
+ **********************/
+
+ #FIXME i think is_account would be enough
+ if (($dn != NULL) && ($dn != "new") && $this->is_account){
/* Load attributes containing arrays */
foreach (array("gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){
}
}
+ if(is_array($this->gosaMailServer) && isset($this->gosaMailServer[0])){
+ $this->gosaMailServer = $this->gosaMailServer[0];
+ }
+
+ /* Save initial account state */
+ $this->initially_was_account= $this->is_account;
+
+
+ /**********************
+ If there is a server defined, connect and get some more infos
+ **********************/
+
/* Only do IMAP actions if gosaMailServer attribute is set */
if (isset ($this->attrs["gosaMailServer"][0])){
- $method= new $this->method($this->config);
- $id= $method->uattrib;
+ $method = new $this->method($this->config);
+ $id = $method->uattrib;
/* Adapt attributes if needed */
$method->fixAttributesOnLoad($this);
if ($method->connect($this->attrs["gosaMailServer"][0])){
- $quota= $method->getQuota($this->folder_prefix.$this->$id);
/* Update quota values */
- if ($quota['gosaMailQuota'] == 2147483647){
- $this->quotaUsage= "";
- $this->gosaMailQuota= "";
- } else {
- $this->quotaUsage= $quota['quotaUsage'];
- $this->gosaMailQuota= $quota['gosaMailQuota'];
+ $quota= $method->getQuota($this->folder_prefix.$this->$id);
+
+ if($quota){
+
+ if ($quota['gosaMailQuota'] == 2147483647){
+ $this->quotaUsage = "";
+ $this->gosaMailQuota = "";
+ } else {
+ $this->quotaUsage = $quota['quotaUsage'];
+ $this->gosaMailQuota = $quota['gosaMailQuota'];
+ }
+ }else{
+ print_red(sprintf(_("Can't get quota for for '%s'."),$this->folder_prefix.$this->$id));
}
- $this->mailboxList= $method->getMailboxList(
- $this->folder_prefix.$this->$id,
- $this->$id);
+
+
+ /* Get mailboxes / folder like INBOX ..*/
+ $this->mailboxList= $method->getMailboxList($this->folder_prefix.$this->$id,$this->$id);
+
$method->disconnect();
}else{
/* Could not connect to ldap.
}
}
+
+ /**********************
+ Get vacation message
+ **********************/
+
/* Fill vacation array */
$this->vacation= array();
if (isset($this->config->current['VACATIONDIR'])){
}
}
+
+ /**********************
+ Create filter
+ **********************/
+
/* Get global filter config */
if (!is_global("mailfilter")){
$ui= get_userinfo();
"regex" => "*");
register_global("mailfilter", $mailfilter);
}
-
- if(is_array($this->gosaMailServer) && isset($this->gosaMailServer[0])){
- $this->gosaMailServer = $this->gosaMailServer[0];
- }
-
- /* Save initial account state */
- $this->initially_was_account= $this->is_account;
}
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
-
+
show_ldap_error($ldap->get_error(), _("Saving mail account failed"));
/* Only do IMAP actions if we are not a template */