From 4d5fc82107c813ee1f9e6b2ec0cbf48d3a81df5d Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 8 Aug 2006 06:06:52 +0000 Subject: [PATCH] Fixed connectivity intranetAccount acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4421 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../connectivity/class_connectivity.inc | 4 +- .../connectivity/class_intranetAccount.inc | 7 +- plugins/personal/connectivity/main.inc | 74 +++++++------------ 3 files changed, 32 insertions(+), 53 deletions(-) diff --git a/plugins/personal/connectivity/class_connectivity.inc b/plugins/personal/connectivity/class_connectivity.inc index 83252cc8a..7410451c2 100644 --- a/plugins/personal/connectivity/class_connectivity.inc +++ b/plugins/personal/connectivity/class_connectivity.inc @@ -30,14 +30,12 @@ class connectivity extends plugin /* Preseed permissions */ $this->dn= $dn; $ui= get_userinfo(); - $acl= get_permissions ($ui->dn, $ui->subtreeACL); /* Load accounts */ foreach ($config->data['TABS']['CONNECTIVITY'] as $plug){ $name= $plug['CLASS']; $this->plugin_name[]= $name; $this->plugin[$name]= new $name($config, $dn); - $this->plugin[$name]->acl= get_module_permission($acl, "$name", $ui->dn); } } @@ -78,7 +76,7 @@ class connectivity extends plugin /* Execude objects */ $is_first= true; - $ReadOnly = (!is_object($this->parent) && !isset($_SESSION['edit'])); + $ReadOnly = (!isset($this->parent) || !$this->parent) && !isset($_SESSION['edit']); foreach ($this->plugin_name as $name){ $this->plugin[$name]->ReadOnly = $ReadOnly; diff --git a/plugins/personal/connectivity/class_intranetAccount.inc b/plugins/personal/connectivity/class_intranetAccount.inc index 248047c3c..fb7f94020 100644 --- a/plugins/personal/connectivity/class_intranetAccount.inc +++ b/plugins/personal/connectivity/class_intranetAccount.inc @@ -68,10 +68,11 @@ class intranetAccount extends plugin $smarty->assign("tabbed", 0); } - if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) ){ + + $smarty->assign('gosaIntranetACL', " disabled "); + 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 "); } $display.= $smarty->fetch (get_template_path('intranet.tpl', TRUE, dirname(__FILE__))); diff --git a/plugins/personal/connectivity/main.inc b/plugins/personal/connectivity/main.inc index 3b41137e5..386324826 100644 --- a/plugins/personal/connectivity/main.inc +++ b/plugins/personal/connectivity/main.inc @@ -32,6 +32,14 @@ if (!$remove_lock){ if (!isset($_SESSION['connectivity']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ $_SESSION['connectivity']= new connectivity ($config, $ui->dn); + $_SESSION['connectivity']->set_acl_base($ui->dn); + $_SESSION['connectivity']->set_acl_category("users"); + + /* Adjust acl's to mode */ + foreach ($_SESSION['connectivity']->plugin_name as $name){ + $_SESSION['connectivity']->plugin[$name]->set_acl_category( "users"); + $_SESSION['connectivity']->plugin[$name]->set_acl_base($ui->dn); + } } $connectivity= $_SESSION['connectivity']; @@ -44,12 +52,13 @@ if (!$remove_lock){ if (isset($_POST['edit'])){ /* Check locking */ - if (($username= get_lock($ui->dn)) != ""){ + if ((($username= get_lock($ui->dn)) != "") && (!isset($_SESSION['edit']))){ $_SESSION['back_plugin']= $plug; gen_locked_message ($username, $ui->dn); exit (); } + /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); $_SESSION['dn']= $ui->dn; @@ -66,7 +75,6 @@ if (!$remove_lock){ if (count ($message) == 0){ $connectivity->save (); gosa_log ("User/connectivity object'".$ui->dn."' has been saved"); - $connectivity->acl= "#none#"; del_lock ($ui->dn); sess_del ('edit'); @@ -78,22 +86,6 @@ if (!$remove_lock){ } } - /* Adjust acl's to mode */ - if (isset($_SESSION['edit'])){ - $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $connectivity->acl= get_module_permission($acl, "connectivity", $ui->dn); - foreach ($connectivity->plugin_name as $name){ - $connectivity->plugin[$name]->acl= get_module_permission($acl, "$name", $ui->dn); - } - } else { - $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $editacl= get_module_permission($acl, "connectivity", $ui->dn); - $connectivity->acl= "#none#"; - foreach ($connectivity->plugin_name as $name){ - $connectivity->plugin[$name]->acl= "#none#"; - } - } - /* Execute formular */ $display= $connectivity->execute (); @@ -104,39 +96,27 @@ if (!$remove_lock){ $info= ""; - /* Are we in edit mode? */ - $in_edit_mode= false; - foreach ($connectivity->plugin_name as $name){ - $acls = get_module_permission($acl, "$name", $ui->dn); - if($acls != "#none#"){ - $in_edit_mode|= true; - } - } - if ($in_edit_mode){ - $display.="
"; - if (isset($_SESSION['edit'])){ - $display.= "\n"; - $display.= " "; - $display.= "\n"; - $info= "\"\" ".$ui->dn." "; - } else { - $info= "\"\" ".$ui->dn." "; - if ($editacl != "#none#"){ - $info.= "\"\""._("Click the 'Edit' button below to change informations in this dialog"); - $display.= "\n"; - } - $display.= "\n"; - } - $display.="
"; + $display.="
"; + if (isset($_SESSION['edit'])){ + $display.= "\n"; + $display.= " "; + $display.= "\n"; + $info= "\"\" ".$ui->dn." "; + } else { + $info= "\"\" ".$ui->dn." "; + + $info.= "\"\""._("Click the 'Edit' button below to change informations in this dialog"); + $display.= "\n"; + $display.= "\n"; } -// $display.= "

\n"; + $display.="
"; /* Page header*/ $display= print_header(get_template_path('images/proxy.png'), - _("Connectivity"), $info).$display; + _("Connectivity"), $info).$display; } -- 2.30.2