Code

Updated all connectivity plugins:
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 07:47:05 +0000 (07:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 07:47:05 +0000 (07:47 +0000)
 - Extension is only addable when the 'create' acl is given.
 - To Remove the extension we need all acls.
 - Updated the show_header function to use create and #all# to grey out button.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5526 594d385d-05f5-0310-b6e9-bd551577e9d8

12 files changed:
include/class_plugin.inc
plugins/admin/groups/acl_definition.inc
plugins/personal/connectivity/class_intranetAccount.inc
plugins/personal/connectivity/class_kolabAccount.inc
plugins/personal/connectivity/class_opengwAccount.inc
plugins/personal/connectivity/class_oxchangeAccount.inc
plugins/personal/connectivity/class_phpgwAccount.inc
plugins/personal/connectivity/class_phpscheduleitAccount.inc
plugins/personal/connectivity/class_pptpAccount.inc
plugins/personal/connectivity/class_proxyAccount.inc
plugins/personal/connectivity/class_pureftpdAccount.inc
plugins/personal/connectivity/class_webdavAccount.inc

index c41ac56fa96d78e279ab205772067eec37dfd660..da3441eaab7d4417e18116ebe1116060b373c19d 100644 (file)
@@ -506,15 +506,20 @@ class plugin
   /* Show header message for tab dialogs */
   function show_header($button_text, $text, $disabled= FALSE)
   {
+    $state = "disabled";
+    if($this->is_account && $this->acl == "#all#"){
+      $state= "";
+    }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $state= "";
+    }
+
     if ($disabled == TRUE){
       $state= "disabled";
-    } else {
-      $state= "";
     }
+
     $display= "<table summary=\"\" width=\"100%\"><tr>\n<td colspan=2><p><b>$text</b></p>\n";
-    $display.= "<input type=submit value=\"$button_text\" name=\"modify_state\" ".
-      chkacl($this->acl, "all")." ".$state.
-      "><p class=\"seperator\">&nbsp;</p></td></tr></table>";
+    $display.= "<input type=submit value=\"$button_text\" name=\"modify_state\" ".$state.">".
+                "<p class=\"seperator\">&nbsp;</p></td></tr></table>";
 
     return($display);
   }
index 68745830f0a241c4fd57f0a36a5d741f7086b87b..736f41446cb495160e43cab22776446ec4c6290c 100644 (file)
@@ -240,6 +240,7 @@ $ACLD['user']=       array("academicTitle",
                        "uid",
                        "vocation");
 $ACLD['mailAccount']=       array(
+                       "create",
                        "custom_sieve",
                        "gosaMailAlternateAddress",
 #                      "gosaMailDeliveryMode",
@@ -253,7 +254,9 @@ $ACLD['mailAccount']=       array(
                         "drop_own_mails",
                        "mail",
                        "only_local");
-$ACLD['posixAccount']=      array("allowedHosts",
+$ACLD['posixAccount']=      
+               array(  "create",       
+                       "allowedHosts",
                        "force_ids",
                        "gidNumber",
                        "gosaDefaultLanguage",
@@ -273,7 +276,9 @@ $ACLD['posixAccount']=      array("allowedHosts",
                        "shadowWarning",
                        "uidNumber");
 $ACLD['sambaAccount']=      
-                       array("acctFlags" => "samba2:acctFlags", 
+               array(
+                       "create",
+                       "acctFlags" => "samba2:acctFlags", 
                        "allow_pwchange" => "samba2:allow_pwchange",
                        "homeDrive"     => "samba2:homeDrive",
                        "no_password_required" => "samba2:no_password_required",
@@ -327,22 +332,6 @@ $ACLD['netatalk']= array(
                        "netatalkUserHomepath");
 
 
-$ACLD['proxyAccount']=      array(
-                       "proxyAccount",
-                       "gosaProxyAcctFlags",
-                       "gosaProxyQuota",
-                       "gosaProxyWorkingStart",
-                       "gosaProxyWorkingStop");
-
-$ACLD['pureftpdAccount']=   array(
-                       "pureftpd",     
-                       "FTPUploadBandwidth",
-                       "FTPStatus",
-                       "FTPDownloadBandwidth",
-                       "FTPQuotaFiles",
-                       "FTPQuotaMBytes",
-                       "FTPUploadRatio",
-                       "FTPDownloadRatio");
 $ACLD['conference']= array(
                        "goFonConference",
                        "goFonPIN",
@@ -365,6 +354,7 @@ $ACLD['conference']= array(
                        "goFonConferenceOwner");
 
 $ACLD['environment']=array(
+                                       "create",
                                        "gotoPrinter",
                                        "gotoEnvironment",
                                        "gotoShare",
@@ -377,21 +367,29 @@ $ACLD['environment']=array(
                                        "gotoHotplugDevice",
                                        "gotoShareAppleMounts"
                                        );
+/* Connectivity accounts */
+$ACLD['phpgwAccount']                  =array("create");
+$ACLD['webdavAccount']                 =array("create");
+$ACLD['intranetAccount']               =array("create");
+$ACLD['phpscheduleitAccount']          =array("create");
+$ACLD['pptpAccount']                   =array("create");
+$ACLD['proxyAccount']                  =array("create","proxyAccount","gosaProxyAcctFlags","gosaProxyQuota",
+                                               "gosaProxyWorkingStart","gosaProxyWorkingStop");
+$ACLD['pureftpdAccount']               =array("create","FTPUploadBandwidth","FTPStatus",
+                                               "FTPDownloadBandwidth","FTPQuotaFiles","FTPQuotaMBytes",
+                                               "FTPUploadRatio","FTPDownloadRatio");
+$ACLD['kolabAccount']                  =array("create","kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL","kolabDelegate");
+$ACLD['opengwAccount']                 =array("create" =>"Enable/disable account",     
+               "LocationTeam"  =>"Location team",
+               "TemplateUser"  =>"Template user",
+               "is_locked"             =>"Lock status",
+               "TeamIDs"               =>"Teams");
+
 
-$ACLD['phpgwAccount']                  =array("phpgwAccount"                   );
-$ACLD['webdavAccount']                 =array("webdavAccount"                  );
-$ACLD['intranetAccount']               =array("intranetAccount"                );
 $ACLD['systems']                       =array("systems"                );
 $ACLD['FAIclass']                      =array("FAIclass"               );
-$ACLD['pptpAccount']                   =array("gosapptp"                               );
-$ACLD['phpscheduleitAccount']  =array("gosaphpscheduleit"              );
-$ACLD['opengwAccount']                 =array( "opengwAccount" =>"Enable/disable account",     
-                                                                               "LocationTeam"  =>"Location team",
-                                                                               "TemplateUser"  =>"Template user",
-                                                                               "is_locked"             =>"Lock status",
-                                                                               "TeamIDs"               =>"Teams");
 
-$ACLD['phoneAccount'] = array("goFonDeliveryMode",
+$ACLD['phoneAccount'] = array("create","goFonDeliveryMode",
       "goFonHardware","goFonPIN","goFonVoicemailPIN","telephoneNumber", "goFonMacro");
 
 $ACLD['nagiosAccount'] = array("NagiosAlias"
@@ -428,6 +426,5 @@ $ACLD['FAIclass']   =       array(
                                                                // Allow displaying of FAI menu element
                                                                "FAIclass"      => "FAI management enabled");
 $ACLD['goFonMacro']    =array("goFonMacro","edit","delete");
-$ACLD['kolabAccount']  =array("kolabAccount","kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL","kolabDelegate");
 
 ?>
index 1f475bf2578b022e78771964ef8bddd448cb9a92..949eee08b8c9659dfc5b2e307ca71f964aa295bb 100644 (file)
@@ -81,7 +81,13 @@ class intranetAccount extends plugin
                $smarty->assign("tabbed", 0);   
        }
 
-   $smarty->assign('gosaIntranetACL', chkacl($this->acl, 'intranetAccount'));
+       /* Allow account status toogle?  */
+       $smarty->assign("gosaIntranetACL", "disabled");
+       if(!$this->is_account && chkacl($this->acl,"create") == ""){
+               $smarty->assign("gosaIntranetACL", "");
+       }elseif($this->is_account && $this->acl == "#all#" ){
+               $smarty->assign("gosaIntranetACL", "");
+       }
 
        $display.= $smarty->fetch (get_template_path('intranet.tpl', TRUE, dirname(__FILE__)));
        return ($display);
@@ -124,15 +130,15 @@ class intranetAccount extends plugin
   function save_object()
   {
         /* Do we need to flip is_account state? */
-        if (isset($_POST['connectivityTab'])){
-                if (isset($_POST['intranet'])){
-                        if (!$this->is_account && $_POST['intranet'] == "B"){
-                                $this->is_account= TRUE;
-                        }
-                } else {
-                        $this->is_account= FALSE;
-                }
-        }
+         if (isset($_POST['connectivityTab'])){
+
+                 /* Change state if needed */
+                 if(!$this->is_account && isset($_POST["intranet"]) && chkacl($this->acl,"create") == ""){
+                         $this->is_account = true;
+                 }elseif($this->is_account && !isset($_POST["intranet"]) && $this->acl == "#all#"){
+                         $this->is_account = false;
+                 }
+         }
 
        plugin::save_object();
        if (isset($_POST["INTRANETStatus"])){
index 0518d9606a55f962cbcc4692feb45afb988c8a8e..20b26b0aab59f1cc5b8e79966a745052b93bc86b 100644 (file)
@@ -80,7 +80,14 @@ class kolabAccount extends plugin
       $smarty->assign("$val", $this->$val);
       $smarty->assign($val."ACL", chkacl($this->acl, "$val"));
     }
-    $smarty->assign("kolabAccountACL", chkacl($this->acl, "kolabAccountACL"));
+  
+    /* Allow account status toogle?  */
+    $smarty->assign("kolabAccountACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("kolabAccountACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("kolabAccountACL", "");
+    }
 
     /* Check for invitation action */
     $nr= 0;
@@ -324,9 +331,10 @@ class kolabAccount extends plugin
     /* Do we need to flip is_account state? */
     if (isset($_POST['connectivityTab'])){
 
-      if(isset($_POST["kolabState"])){
+      /* Change state if needed */
+      if(!$this->is_account && isset($_POST["kolabState"]) && chkacl($this->acl,"create") == ""){
         $this->is_account = true;
-      }else{
+      }elseif($this->is_account && !isset($_POST["kolabState"]) && $this->acl == "#all#"){
         $this->is_account = false;
       }
 
index e33682c3ec7fced4b29e5f0b230281751fd59dea..2ddb1fbcb94ddcfbb8a5bd21b7249daa4214c613 100644 (file)
@@ -134,12 +134,20 @@ class opengwAccount extends plugin
                        $smarty->assign($ar,array());
                }
                $smarty->assign("OGWstate"," disabled ");
-               foreach(array("LocationTeam","TemplateUser","is_locked","validTeams","opengwAccount","is_account"/*,"OGWPassword"*/) as $ar){
+               foreach(array("LocationTeam","TemplateUser","is_locked","validTeams","is_account"/*,"OGWPassword"*/) as $ar){
                        $smarty->assign($ar,"");
                        $smarty->assign($ar."CHK","");
                        $smarty->assign($ar."ACL"," disabled ");
                }
 
+    /* Allow account status toogle?  */
+    $smarty->assign("opengwAccountACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("opengwAccountACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("opengwAccountACL", "");
+    }
+
                /* Check database extension */    
                if(!is_callable("pg_connect")){
                        print_red(_("OpenGroupware: Your configuration is missing a postgresql extension. Can't perform any database queries."));
@@ -308,13 +316,12 @@ class opengwAccount extends plugin
                        }
                }
 
-               /* change account status */
-               if(isset($_POST['is_account'])){
-                       $this->is_account = $_POST['is_account'];
-               }else{
-                       $this->is_account = false;//$_POST['is_account'];
-               }
-
+    /* Change state if needed */
+    if(!$this->is_account && isset($_POST["is_account"]) && chkacl($this->acl,"create") == ""){
+      $this->is_account = true;
+    }elseif($this->is_account && !isset($_POST["is_account"]) && $this->acl == "#all#"){
+      $this->is_account = false;
+    }
        }
 
 
index 58c998f1e2c97cb081c69ce5225aaef0a21b1a4a..feb6154633758ba91a2544ea794880112dd8b17b 100644 (file)
@@ -643,7 +643,15 @@ class oxchangeAccount extends plugin
       $smarty->assign("$val", $this->$val);
       $smarty->assign($val."ACL", chkacl($this->acl, "$val"));
     }
-    $smarty->assign("oxchangeAccountACL", chkacl($this->acl, "oxchangeAccount"));
+
+    /* Allow account status toogle?  */
+    $smarty->assign("oxchangeAccountACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("oxchangeAccountACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("oxchangeAccountACL", "");
+    }
+
     if ($this->is_account){
       $smarty->assign("oxchangeState", "checked");
       $smarty->assign("oxState", "");
@@ -765,16 +773,18 @@ class oxchangeAccount extends plugin
   {
     /* Do we need to flip is_account state? */
     if (isset($_POST['connectivityTab'])){
-      if (isset($_POST['oxchange'])){
-        if (!$this->is_account && $_POST['oxchange'] == "B"){
-          $this->is_account= TRUE;
-        }
-      } else {
-        $this->is_account= FALSE;
+
+      /* Change state if needed */
+      if(!$this->is_account && isset($_POST["oxchange"]) && chkacl($this->acl,"create") == ""){
+        $this->is_account = true;
+      }elseif($this->is_account && !isset($_POST["oxchange"]) && $this->acl == "#all#"){
+        $this->is_account = false;
       }
     }
 
     plugin::save_object();
+
+#FIXME seams to be unused code !
     if (isset($_POST["oxchangeStatus"])){
       $this->oxchangeStatus = "disabled";
     } else {
index 6dd83674cc9baf3b9a7794327bc396863126a291..f9388a8619a82dc0337c931f0ee3718b0e362259 100644 (file)
@@ -54,7 +54,13 @@ class phpgwAccount extends plugin
       $smarty->assign("phpgwState", "");
     }
 
-    $smarty->assign('phpgwAccountACL', chkacl($this->acl, 'phpgwAccount'));
+    /* Allow account status toogle?  */
+    $smarty->assign("phpgwAccountACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("phpgwAccountACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("phpgwAccountACL", "");
+    }
 
     $display.= $smarty->fetch (get_template_path('phpgw.tpl', TRUE, dirname(__FILE__)));
     return ($display);
@@ -90,16 +96,18 @@ class phpgwAccount extends plugin
   {
     /* Do we need to flip is_account state? */
     if (isset($_POST['connectivityTab'])){
-      if (isset($_POST['phpgw'])){
-        if (!$this->is_account && $_POST['phpgw'] == "B"){
-          $this->is_account= TRUE;
-        }
-      } else {
-        $this->is_account= FALSE;
+
+      /* Change state if needed */
+      if(!$this->is_account && isset($_POST["phpgw"]) && chkacl($this->acl,"create") == ""){
+        $this->is_account = true;
+      }elseif($this->is_account && !isset($_POST["phpgw"]) && $this->acl == "#all#"){
+        $this->is_account = false;
       }
     }
 
     plugin::save_object();
+
+    #FIXME seams to be unused code !
     if (isset($_POST["phpgwStatus"])){
       $this->phpgwStatus = "disabled";
     } else {
index 073da05ca75e3d12179cb87eeb73c3c9d40a40f9..5fb939dd596463f53b5606b2397ebe224bc0aaf5 100644 (file)
@@ -59,7 +59,13 @@ class phpscheduleitAccount extends plugin
       $smarty->assign("wstate", "disabled");
     }
 
-    $smarty->assign('gosaphpscheduleitACL', chkacl($this->acl, 'gosaphpscheduleit'));
+    /* Allow account status toogle?  */
+    $smarty->assign("gosaphpscheduleitACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("gosaphpscheduleitACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("gosaphpscheduleitACL", "");
+    }
 
     $display.= $smarty->fetch (get_template_path('phpscheduleit.tpl', TRUE, dirname(__FILE__)));
     return ($display);
@@ -92,16 +98,18 @@ class phpscheduleitAccount extends plugin
   {
     /* Do we need to flip is_account state? */
     if (isset($_POST['connectivityTab'])){
-      if (isset($_POST['phpscheduleit'])){
-        if (!$this->is_account && $_POST['phpscheduleit'] == "B"){
-          $this->is_account= TRUE;
-        }
-      } else {
-        $this->is_account= FALSE;
+
+      /* Change state if needed */
+      if(!$this->is_account && isset($_POST["phpscheduleit"]) && $_POST['phpscheduleit'] == "B" && chkacl($this->acl,"create") == ""){
+        $this->is_account = true;
+      }elseif($this->is_account && !isset($_POST["phpscheduleit"]) && $this->acl == "#all#"){
+        $this->is_account = false;
       }
     }
 
     plugin::save_object();
+    
+    #FIXME seams to be unused code !
     if (isset($_POST["phpscheduleitStatus"])){
       $this->pptpStatus = "disabled";
     } else {
index ba416e37c3e040e1bbcd935877a3d7d8f5a53070..8ef6988c540ca32c4b12d0f92a70e12f30ad0a1c 100644 (file)
@@ -66,7 +66,13 @@ class pptpAccount extends plugin
       $smarty->assign("wstate", "disabled");
     }
 
-    $smarty->assign('gosapptpACL', chkacl($this->acl, 'gosapptp'));
+    /* Allow account status toogle?  */
+    $smarty->assign("gosapptpACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("gosapptpACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("gosapptpACL", "");
+    }
 
     $display.= $smarty->fetch (get_template_path('pptp.tpl', TRUE, dirname(__FILE__)));
     return ($display);
@@ -102,16 +108,18 @@ class pptpAccount extends plugin
   {
     /* Do we need to flip is_account state? */
     if (isset($_POST['connectivityTab'])){
-      if (isset($_POST['pptp'])){
-        if (!$this->is_account && $_POST['pptp'] == "B"){
-          $this->is_account= TRUE;
-        }
-      } else {
-        $this->is_account= FALSE;
+
+      /* Change state if needed */
+      if(!$this->is_account && isset($_POST["pptp"]) && chkacl($this->acl,"create") == ""){
+        $this->is_account = true;
+      }elseif($this->is_account && !isset($_POST["pptp"]) && $this->acl == "#all#"){
+        $this->is_account = false;
       }
     }
 
     plugin::save_object();
+    
+    #FIXME seams to be unused code !
     if (isset($_POST["pptpStatus"])){
       $this->pptpStatus = "disabled";
     } else {
index cb03ec2d10b2ae254f35478873103f98ad46307c..50fb8f5594ca9fba620d6385b86865d358b51643 100644 (file)
@@ -45,7 +45,15 @@ class proxyAccount extends plugin
 
     /* Prepare templating */
     $smarty= get_smarty();
-    $smarty->assign("proxyAccountACL",          chkacl($this->acl, "proxyAccount"));
+
+    /* Allow account status toogle?  */
+    $smarty->assign("proxyAccountACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("proxyAccountACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("proxyAccountACL", "");
+    }
+
     $smarty->assign("gosaProxyAcctFlagsACL",    chkacl($this->acl, "gosaProxyAcctFlags"));
     $smarty->assign("gosaProxyWorkingStartACL", chkacl($this->acl, "gosaProxyWorkingStart"));
     $smarty->assign("gosaProxyWorkingStopACL",  chkacl($this->acl, "gosaProxyWorkingStop"));
@@ -194,22 +202,16 @@ class proxyAccount extends plugin
     /* Do we need to flip is_account state? */
     if ($this->parent != NULL){
       if (isset($_POST['connectivityTab'])){
-        if (isset($_POST['proxy'])){
-          if (!$this->is_account && $_POST['proxy'] == "B"){
-            $this->is_account= TRUE;
-          }
-        } else {
-          $this->is_account= FALSE;
+
+        /* Change state if needed */
+        if(!$this->is_account && isset($_POST["proxy"]) && chkacl($this->acl,"create") == ""){
+          $this->is_account = true;
+        }elseif($this->is_account && !isset($_POST["proxy"]) && $this->acl == "#all#"){
+          $this->is_account = false;
         }
       }
     }
 
-    if(isset($_POST['proxy'])){
-      $this->is_account = TRUE; 
-    }else{
-      $this->is_account = FALSE;
-    }
-
     /* Save flag value */
     if ($this->is_account){
       if (chkacl ($this->acl, "gosaProxyAcctFlags") == ""){
index 03f60b432c29d9b7285c610556468dba2ace041b..c77bc702706e1d5c757a343c9e5a9087f5bbd5f1 100644 (file)
@@ -69,9 +69,16 @@ class pureftpdAccount extends plugin
         $smarty->assign("fstate", "");
       }
     }
-    $smarty->assign("use_FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : "");
+    
+    /* Allow account status toogle?  */
+    $smarty->assign("pureftpdACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("pureftpdACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("pureftpdACL", "");
+    }
 
-    $smarty->assign("pureftpdACL", chkacl($this->acl, 'pureftpd'));
+    $smarty->assign("use_FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : "");
 
     $changeState = "";
     foreach($this->attributes as $attr){
@@ -113,17 +120,18 @@ class pureftpdAccount extends plugin
   {
     /* Do we need to flip is_account state? */
     if (isset($_POST['connectivityTab'])){
-      if (isset($_POST['pureftpd'])){
-        if (!$this->is_account && $_POST['pureftpd'] == "B"){
-          $this->is_account= TRUE;
-        }
-      } else {
-        $this->is_account= FALSE;
+
+      /* Change state if needed */
+      if(!$this->is_account && isset($_POST["pureftpd"]) && chkacl($this->acl,"create") == ""){
+        $this->is_account = true;
+      }elseif($this->is_account && !isset($_POST["pureftpd"]) && $this->acl == "#all#"){
+        $this->is_account = false;
       }
     }
 
     plugin::save_object();
 
+    #FIXME seams to be unused code !
     $old= $this->FTPStatus;
     if (isset($_POST["FTPStatus"])){
       $this->FTPStatus = "disabled";
index 0edecd3bddd1c8d046a07ea9b96c1e1541d94144..6b9abca2742064112fba500511715b804508179c 100644 (file)
@@ -50,7 +50,14 @@ class webdavAccount extends plugin
       $smarty->assign("tabbed", 1);
     }
 
-    $smarty->assign('webdavAccountACL', chkacl($this->acl, 'webdavAccount'));
+    /* Allow account status toogle?  */
+    $smarty->assign("webdavAccountACL", "disabled");
+    if(!$this->is_account && chkacl($this->acl,"create") == ""){
+      $smarty->assign("webdavAccountACL", "");
+    }elseif($this->is_account && $this->acl == "#all#" ){
+      $smarty->assign("webdavAccountACL", "");
+    }
+
 
     $display.= $smarty->fetch (get_template_path('webdav.tpl', TRUE, dirname(__FILE__)));
     return ($display);
@@ -86,16 +93,18 @@ class webdavAccount extends plugin
   {
     /* Do we need to flip is_account state? */
     if (isset($_POST['connectivityTab'])){
-      if (isset($_POST['webdav'])){
-        if (!$this->is_account && $_POST['webdav'] == "B"){
-          $this->is_account= TRUE;
-        }
-      } else {
-        $this->is_account= FALSE;
+
+      /* Change state if needed */
+      if(!$this->is_account && isset($_POST["webdav"]) && chkacl($this->acl,"create") == ""){
+        $this->is_account = true;
+      }elseif($this->is_account && !isset($_POST["webdav"]) && $this->acl == "#all#"){
+        $this->is_account = false;
       }
     }
 
     plugin::save_object();
+
+    #FIXME seams to be unused code !
     if (isset($_POST["WEBDAVStatus"])){
       $this->WEBDAVStatus = "disabled";
     } else {