From: hickert Date: Tue, 4 Jul 2006 04:22:56 +0000 (+0000) Subject: Made kolabAccount compatible with connectivity tab X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=26f897e0faf5c5489f620e63f475a5a8585f4ab7;p=gosa.git Made kolabAccount compatible with connectivity tab git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4018 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc index 389bc753d..3c0056eb1 100644 --- a/plugins/personal/connectivity/class_kolabAccount.inc +++ b/plugins/personal/connectivity/class_kolabAccount.inc @@ -2,28 +2,29 @@ class kolabAccount extends plugin { /* Definitions */ - var $plHeadline= "Kolab"; - var $plDescription= "This does something"; + var $plHeadline = "Kolab"; + var $plDescription = "This does something"; /* CLI vars */ - var $cli_summary= "Manage users Kolab 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 Kolab account"; + var $cli_description = "Some longer text\nfor help"; + var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); /* Kolab attributes */ - var $kolabInvitationPolicy= array(); - var $kolabFreeBusyFuture= 60; - var $unrestrictedMailSize= 0; - var $calFBURL= ""; - var $kolabDelegate= array(); + var $kolabInvitationPolicy = array(); + var $kolabFreeBusyFuture = 60; + var $unrestrictedMailSize = 0; + var $calFBURL = ""; + var $kolabDelegate = array(); /* attribute list for save action */ - var $attributes= array( "kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL"); - var $objectclasses= array("kolab"); + var $attributes = array("kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL","kolabDelegate"); + var $objectclasses = array("kolabInetOrgPerson"); /* Helper */ var $imapping= array(); + function kolabAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); @@ -42,12 +43,23 @@ class kolabAccount extends plugin $this->kolabInvitationPolicy= array("ACT_MANUAL"); } + /* Check is account state */ + $this->is_account = false; + if(count($this->kolabDelegate)){ + $this->is_account = true; + } + foreach(array("calFBURL","unrestrictedMailSize") as $attr){ + if(!empty($this->$attr)){ + $this->is_account = true; + } + } } + function execute() { /* Call parent execute */ -// plugin::execute(); + plugin::execute(); /* Show tab dialog headers */ $display= ""; @@ -153,9 +165,9 @@ class kolabAccount extends plugin /* Transfer account states for this union */ if (isset($this->parent) && $this->parent->by_object['mailAccount']->is_account){ - $smarty->assign('is_account', 'true'); + $smarty->assign('mail_account', 'true'); } else { - $smarty->assign('is_account', ''); + $smarty->assign('mail_account', ''); } /* Transfer delegation list */ @@ -212,14 +224,31 @@ class kolabAccount extends plugin } $smarty->assign("invitation", $invitation); + $smarty->assign("kolabState",$this->is_account); $display.= $smarty->fetch (get_template_path('kolab.tpl', TRUE, dirname(__FILE__))); + + return ($display); } function remove_from_parent() { /* Optionally execute a command after we're done */ + plugin::remove_from_parent(); + + if(!in_array("kolabInetOrgPerson",$this->attrs['objectClass'])){ + $this->attrs['objectClass'][] = "kolabInetOrgPerson"; + } + + $ldap = $this->config->get_ldap_linK(); + $ldap->cd($this->config->current['BASE']); + $ldap->cd ($this->dn); + $ldap->modify($this->attrs); + + print_a($this->attrs); + $this->handle_post_events('remove'); + show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/kolab account with dn '%s' failed."),$this->dn)); } @@ -272,6 +301,13 @@ class kolabAccount extends plugin { /* Do we need to flip is_account state? */ if (isset($_POST['connectivityTab'])){ + + if(isset($_POST["kolabState"])){ + $this->is_account = true; + }else{ + $this->is_account = false; + } + if (chkacl('unrestrictedMailSize', $this->acl == "")){ if (isset($_POST['unrestrictedMailSize']) && $_POST['unrestrictedMailSize'] == 1){ $this->unrestrictedMailSize= 1; @@ -322,7 +358,9 @@ class kolabAccount extends plugin $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/kolav account with dn '%s' failed."),$this->dn)); + print_a($this->attrs); + + show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/kolab account with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/plugins/personal/connectivity/kolab.tpl b/plugins/personal/connectivity/kolab.tpl index f5d8c1075..5a1522566 100644 --- a/plugins/personal/connectivity/kolab.tpl +++ b/plugins/personal/connectivity/kolab.tpl @@ -1,27 +1,40 @@ -

{t}Kolab account{/t}

-{if $is_account ne 'true'} +{if $mail_account ne 'true'} +

{t}Kolab account{/t}

{t}The kolab account is currently disabled. It's features can be adjusted if you add a mail account.{/t} {else} - + +{t}Kolab account{/t} +
+

- {html_options values=$kolabDelegate output=$kolabDelegate}
- -   - + +   +

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

@@ -33,11 +46,11 @@ - + - +
{t}days{/t} {t}days{/t}