From 45f0fbca03be26d33c7474bd62c76df999793cb0 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 12 May 2005 15:16:06 +0000 Subject: [PATCH] Broke kolab invitation policies git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@198 594d385d-05f5-0310-b6e9-bd551577e9d8 --- TODO | 2 + .../connectivity/class_kolabAccount.inc | 77 +++++++++++++++++-- plugins/personal/connectivity/kolab.tpl | 17 ++-- 3 files changed, 80 insertions(+), 16 deletions(-) diff --git a/TODO b/TODO index ff35559ba..2f10b65fc 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,8 @@ Things to fix in 2.3.9: - shared folders - server - setup + * check is present + * modify connectivity tab! * Make it "barrierefrei" diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc index aadc9cd34..0bff3f326 100644 --- a/plugins/personal/connectivity/class_kolabAccount.inc +++ b/plugins/personal/connectivity/class_kolabAccount.inc @@ -11,28 +11,34 @@ class kolabAccount extends plugin var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); /* Kolab attributes */ - var $kolabInvitationPolicy= "ACT_MANUAL"; + var $kolabInvitationPolicy= array(); var $kolabFreeBusyFuture= 60; var $unrestrictedMailSize= 0; var $calFBURL= ""; var $kolabDelegate= array(); /* attribute list for save action */ - var $attributes= array( "kolabInvitationPolicy", "kolabFreeBusyFuture", - "unrestrictedMailSize", "calFBURL"); + var $attributes= array( "kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL"); var $objectclasses= array(); function kolabAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); - /* Pull delegation array */ - if (isset($this->attrs["kolabDelegate"]["count"])){ - for ($i= 0; $i<$this->attrs["kolabDelegate"]["count"]; $i++){ - array_push($this->kolabDelegate, $this->attrs["kolabDelegate"][$i]); + /* Pull arrays */ + foreach(array("kolabDelegate", "kolabInvitationPolicy") as $attr){ + if (isset($this->attrs["$attr"]["count"])){ + for ($i= 0; $i<$this->attrs["$attr"]["count"]; $i++){ + array_push($this->$attr, $this->attrs["$attr"][$i]); + } } } + /* If this one is empty, preset with ACT_MANUAL for anonymous users */ + if (count ($this->kolabInvitationPolicy) == 0){ + $this->kolabInvitationPolicy= array("ACT_MANUAL"); + } + } function execute() @@ -117,6 +123,47 @@ class kolabAccount extends plugin /* Transfer delegation list */ $smarty->assign("kolabDelegate", $this->kolabDelegate); + /* Create InvitationPolicy table */ + $invitation= ""; + $nr= 0; + $acl= chkacl($this->acl, "kolabInvitationPolicy"); + foreach ($this->kolabInvitationPolicy as $entry){ + $invitation.= ""; + + /* The default entry does not have colons... */ + if (!preg_match('/:/', $entry)){ + $invitation.= _("Anonymous"); + $mode= $entry; + } else { + $name= preg_replace('/:.*$/', '', $entry); + $mode= preg_replace('/^[^:]+: */', '', $entry); + $invitation.= ""; + } + $invitation.= ""; + + /* Add mode switch */ + $invitation.= " $button\n"; + $nr++; + } + $smarty->assign("invitation", $invitation); + $display.= $smarty->fetch (get_template_path('kolab.tpl', TRUE, dirname(__FILE__))); return ($display); } @@ -160,6 +207,22 @@ class kolabAccount extends plugin } plugin::save_object(); + + /* Save changes done in invitation policies */ + $nr= 0; + $this->kolabInvitationPolicy= array(); + while (isset($_POST["policy$nr"])){ + + /* Anonymous? */ + if (!isset($_POST["address$nr"])){ + $this->kolabInvitationPolicy[]= $_POST["policy$nr"]; + } else { + $this->kolabInvitationPolicy[]= $_POST["address$nr"].": ".$_POST["policy$nr"]; + } + + $nr++; + } + } diff --git a/plugins/personal/connectivity/kolab.tpl b/plugins/personal/connectivity/kolab.tpl index d0a02bc3e..92e2eb7d4 100644 --- a/plugins/personal/connectivity/kolab.tpl +++ b/plugins/personal/connectivity/kolab.tpl @@ -18,18 +18,15 @@ {$kolabDelegateACL}>  +

+ {t}Mail size{/t}
+   {t}No mail size restriction for this account{/t} +

  -

- {t}Invitation{/t}
-  {t}Policy{/t}   - -

{t}Free Busy information{/t}
@@ -44,8 +41,10 @@

- {t}Misc{/t}
-   {t}No mail size restriction{/t} + {t}Invitation policy{/t}
+ + {$invitation} +

-- 2.30.2