From: hickert Date: Wed, 26 Jul 2006 09:52:39 +0000 (+0000) Subject: Added a flag for connectivity classes, to allow grey out of every input when not... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7cdb51219584c626f3364475ed406fbe20620835;p=gosa.git Added a flag for connectivity classes, to allow grey out of every input when not in edit mode git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4312 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/connectivity/class_connectivity.inc b/plugins/personal/connectivity/class_connectivity.inc index 534541ecd..83252cc8a 100644 --- a/plugins/personal/connectivity/class_connectivity.inc +++ b/plugins/personal/connectivity/class_connectivity.inc @@ -77,7 +77,11 @@ class connectivity extends plugin /* Execude objects */ $is_first= true; + + $ReadOnly = (!is_object($this->parent) && !isset($_SESSION['edit'])); + foreach ($this->plugin_name as $name){ + $this->plugin[$name]->ReadOnly = $ReadOnly; if (!$is_first){ $display.= '

 

'; } else { diff --git a/plugins/personal/connectivity/class_intranetAccount.inc b/plugins/personal/connectivity/class_intranetAccount.inc index 49c540d27..46f44deab 100644 --- a/plugins/personal/connectivity/class_intranetAccount.inc +++ b/plugins/personal/connectivity/class_intranetAccount.inc @@ -19,6 +19,7 @@ class intranetAccount extends plugin var $attributes= array(); /* ObjectClasses list for save action */ var $objectclasses= array("gosaIntranetAccount"); + var $ReadOnly = false; /*! \brief Konstructor @@ -67,7 +68,7 @@ class intranetAccount extends plugin $smarty->assign("tabbed", 0); } - if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { + if((!$this->ReadOnly) && ($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { $smarty->assign('gosaIntranetACL', ""); }else{ $smarty->assign('gosaIntranetACL', " disabled "); diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc index 9d8899e30..84ea03a25 100644 --- a/plugins/personal/connectivity/class_kolabAccount.inc +++ b/plugins/personal/connectivity/class_kolabAccount.inc @@ -19,6 +19,7 @@ class kolabAccount extends plugin /* Helper */ var $imapping= array(); var $mail_Account = false; + var $ReadOnly = false; function kolabAccount ($config, $dn= NULL) { @@ -78,12 +79,18 @@ class kolabAccount extends plugin $tmp = $this->plInfo(); foreach($tmp['plProvidedAcls'] as $acl => $description){ - $smarty->assign($acl."ACL",$this->getacl($acl)); - $smarty->assign($acl."_W", $this->acl_is_writeable($acl)); + $smarty->assign($acl."ACL",$this->getacl($acl,$this->ReadOnly)); + $smarty->assign($acl."_W", $this->acl_is_writeable($acl,$this->ReadOnly)); } $smarty->assign("is_account" , $this->is_account); - $smarty->assign("is_removeable",$this->acl_is_removeable()); - $smarty->assign("is_createable",$this->acl_is_createable()); + + if($this->ReadOnly){ + $smarty->assign("is_removeable",false); + $smarty->assign("is_createable",false); + }else{ + $smarty->assign("is_removeable",$this->acl_is_removeable()); + $smarty->assign("is_createable",$this->acl_is_createable()); + } /* Check for invitation action */ $nr= 0; diff --git a/plugins/personal/connectivity/class_opengwAccount.inc b/plugins/personal/connectivity/class_opengwAccount.inc index 03da9692e..e282f0c45 100644 --- a/plugins/personal/connectivity/class_opengwAccount.inc +++ b/plugins/personal/connectivity/class_opengwAccount.inc @@ -31,6 +31,7 @@ class opengwAccount extends plugin var $is_account = false; var $initialy_was_account = false; var $OGWPassword = ""; + var $ReadOnly = false; function opengwAccount ($config, $dn= NULL) { diff --git a/plugins/personal/connectivity/class_phpgwAccount.inc b/plugins/personal/connectivity/class_phpgwAccount.inc index 130bbe2d6..c458f8eb0 100644 --- a/plugins/personal/connectivity/class_phpgwAccount.inc +++ b/plugins/personal/connectivity/class_phpgwAccount.inc @@ -13,6 +13,7 @@ class phpgwAccount extends plugin /* attribute list for save action */ var $attributes= array("phpgwAccountExpires", "phpgwAccountStatus", "phpgwAccountType"); var $objectclasses= array("phpgwAccount"); + var $ReadOnly = false; function phpgwAccount ($config, $dn= NULL) { @@ -41,7 +42,7 @@ class phpgwAccount extends plugin $smarty->assign("phpgwState", ""); } - if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { + if((!$this->ReadOnly)&&($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { $smarty->assign('phpgwAccountACL', ""); }else{ $smarty->assign('phpgwAccountACL', " disabled "); diff --git a/plugins/personal/connectivity/class_phpscheduleitAccount.inc b/plugins/personal/connectivity/class_phpscheduleitAccount.inc index 76cc349d5..558481ab9 100644 --- a/plugins/personal/connectivity/class_phpscheduleitAccount.inc +++ b/plugins/personal/connectivity/class_phpscheduleitAccount.inc @@ -30,6 +30,7 @@ class phpscheduleitAccount extends plugin /* attribute list for save action */ var $attributes= array(); var $objectclasses= array("phpscheduleitAccount"); + var $ReadOnly =false; function phpscheduleitAccount ($config, $dn= NULL) { @@ -51,7 +52,7 @@ class phpscheduleitAccount extends plugin $smarty->assign("wstate", "disabled"); } - if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { + if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable()))) { $smarty->assign('gosaphpscheduleitACL', ""); }else{ $smarty->assign('gosaphpscheduleitACL', " disabled "); diff --git a/plugins/personal/connectivity/class_pptpAccount.inc b/plugins/personal/connectivity/class_pptpAccount.inc index 622fc0126..a03777944 100644 --- a/plugins/personal/connectivity/class_pptpAccount.inc +++ b/plugins/personal/connectivity/class_pptpAccount.inc @@ -30,6 +30,8 @@ class pptpAccount extends plugin var $attributes= array(); var $objectclasses= array("pptpServerAccount"); + var $ReadOnly = false; + function pptpAccount ($config, $dn= NULL) { plugin::plugin ($config, $dn); @@ -53,7 +55,7 @@ class pptpAccount extends plugin $smarty->assign("wstate", "disabled"); } - if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { + if((!$this->ReadOnly) && ($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { $smarty->assign('gosapptpACL', ""); }else{ $smarty->assign('gosapptpACL', " disabled "); diff --git a/plugins/personal/connectivity/class_proxyAccount.inc b/plugins/personal/connectivity/class_proxyAccount.inc index 495924237..1280d3b9f 100644 --- a/plugins/personal/connectivity/class_proxyAccount.inc +++ b/plugins/personal/connectivity/class_proxyAccount.inc @@ -17,6 +17,7 @@ class proxyAccount extends plugin var $attributes= array("gosaProxyID", "gosaProxyAcctFlags", "gosaProxyWorkingStart", "gosaProxyWorkingStop", "gosaProxyQuota", "gosaProxyQuotaPeriod"); var $objectclasses= array("gosaProxyAccount"); + var $ReadOnly = false; function proxyAccount ($config, $dn= NULL) { @@ -34,7 +35,7 @@ class proxyAccount extends plugin $smarty= get_smarty(); - if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { + if((!$this->ReadOnly)&& ($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { $smarty->assign('proxyAccountACL', ""); }else{ $smarty->assign('proxyAccountACL', " disabled "); @@ -63,8 +64,8 @@ class proxyAccount extends plugin $tmp = $this->plInfo(); foreach($tmp['plProvidedAcls'] as $acl => $desc){ - $smarty->assign($acl."ACL",$this->getacl($acl)); - $smarty->assign($acl."_W",$this->acl_is_writeable($acl)); + $smarty->assign($acl."ACL",$this->getacl($acl,$this->ReadOnly)); + $smarty->assign($acl."_W",$this->acl_is_writeable($acl,$this->ReadOnly)); } /* Assign working time */ diff --git a/plugins/personal/connectivity/class_pureftpdAccount.inc b/plugins/personal/connectivity/class_pureftpdAccount.inc index 596ab556b..47c5aaf18 100644 --- a/plugins/personal/connectivity/class_pureftpdAccount.inc +++ b/plugins/personal/connectivity/class_pureftpdAccount.inc @@ -21,6 +21,7 @@ class pureftpdAccount extends plugin var $attributes= array("FTPQuotaFiles","FTPQuotaMBytes","FTPUploadRatio","FTPDownloadRatio", "FTPUploadBandwidth","FTPDownloadBandwidth","FTPStatus","FTPuid","FTPgid"); var $objectclasses= array("PureFTPdUser"); + var $ReadOnly; function pureftpdAccount ($config, $dn= NULL) { @@ -44,8 +45,8 @@ class pureftpdAccount extends plugin $tmp = $this->plInfo(); $changeState = ""; foreach($tmp['plProvidedAcls'] as $key => $desc){ - $smarty->assign($key."ACL", $this->getacl($key)); - $smarty->assign($key."_W", $this->acl_is_writeable($key)); + $smarty->assign($key."ACL", $this->getacl($key,$this->ReadOnly)); + $smarty->assign($key."_W", $this->acl_is_writeable($key,$this->ReadOnly)); if($this->acl_is_writeable($key)){ $changeState.= " changeState('".$key."'); \n"; @@ -69,7 +70,7 @@ class pureftpdAccount extends plugin } $smarty->assign("use_FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : ""); - if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { + if((!$this->ReadOnly)&&($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) { $smarty->assign('pureftpdACL', ""); }else{ $smarty->assign('pureftpdACL', " disabled ");