From 797a10b15c70ad4a2b38812d0477523124fb7ef9 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 26 Mar 2008 11:35:07 +0000 Subject: [PATCH] Updated connectivity kolab Account -Fixed is_account git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@9990 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../connectivity/class_kolabAccount.inc | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc index 587cd74f7..942e7027a 100644 --- a/plugins/personal/connectivity/class_kolabAccount.inc +++ b/plugins/personal/connectivity/class_kolabAccount.inc @@ -41,6 +41,12 @@ class kolabAccount extends plugin } } + /* Get Boolean value */ + $this->unrestrictedMailSize = FALSE; + if(isset($this->attrs['unrestrictedMailSize'][0]) && preg_match("/true/i",$this->attrs['unrestrictedMailSize'][0])){ + $this->unrestrictedMailSize = TRUE; + } + /* If this one is empty, preset with ACT_MANUAL for anonymous users */ if (count ($this->kolabInvitationPolicy) == 0){ $this->kolabInvitationPolicy= array("ACT_MANUAL"); @@ -51,7 +57,7 @@ class kolabAccount extends plugin if(count($this->kolabDelegate)){ $this->is_account = true; } - foreach(array("calFBURL","unrestrictedMailSize") as $attr){ + foreach(array("calFBURL") as $attr){ if(!empty($this->$attr)){ $this->is_account = true; } @@ -420,6 +426,49 @@ class kolabAccount extends plugin $this->is_modified= TRUE; } + /* Adapt from template, using 'dn' */ + function adapt_from_template($dn) + { + plugin::adapt_from_template($dn); + + /* Setting uid to default */ + if(isset($this->attrs['uid'][0])){ + $this->uid = $this->attrs['uid'][0]; + } + + /* Pull arrays */ + foreach(array("kolabDelegate", "kolabInvitationPolicy") as $attr){ + if (isset($this->attrs["$attr"]["count"])){ + $tmp = array(); + for ($i= 0; $i<$this->attrs["$attr"]["count"]; $i++){ + $tmp[]=$this->attrs["$attr"][$i]; + } + $this->$attr = $tmp; + } + } + + /* If this one is empty, preset with ACT_MANUAL for anonymous users */ + if (count ($this->kolabInvitationPolicy) == 0){ + $this->kolabInvitationPolicy= array("ACT_MANUAL"); + } + + /* Get Boolean value */ + $this->unrestrictedMailSize = FALSE; + if(isset($this->attrs['unrestrictedMailSize'][0]) && preg_match("/true/i",$this->attrs['unrestrictedMailSize'][0])){ + $this->unrestrictedMailSize = TRUE; + } + + /* Check is account state */ + $this->is_account = false; + if(count($this->kolabDelegate)){ + $this->is_account = true; + } + foreach(array("calFBURL") as $attr){ + if(!empty($this->$attr)){ + $this->is_account = true; + } + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -- 2.30.2