From: hickert Date: Fri, 4 Aug 2006 04:29:21 +0000 (+0000) Subject: Some fixes for acls X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3a4195127bd221f6db94ba0b311b4e96d2991868;p=gosa.git Some fixes for acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4381 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 96f9bd883..976ebd641 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -653,15 +653,17 @@ class environment extends plugin */ /* If there is a new entry wanted, open a new entry by initilising the dialog */ - if(isset($_POST['gotoHotplugDeviceNew'])){ + if((isset($_POST['gotoHotplugDeviceNew'])) && ($this->acl_is_writeable("gotoHotplugDevice"))){ $this->dialog = new hotplugDialog($this->config,$this->dn); $this->is_dialog = true; } /* We have to delete the selected hotplug from the list*/ if((isset($_POST['gotoHotplugDeviceDel']))&&(isset($_POST['gotoHotplugDevice'])) && $this->acl_is_writeable("gotoHotplugDevice")){ - foreach($_POST['gotoHotplugDevice'] as $name){ - unset($this->gotoHotplugDevices[$name]); + if($this->acl_is_writeable("gotoHotplugDevice")){ + foreach($_POST['gotoHotplugDevice'] as $name){ + unset($this->gotoHotplugDevices[$name]); + } } } @@ -685,30 +687,23 @@ class environment extends plugin /* Dialod saved */ if(isset($_POST['HotPlugSave'])){ - if(!$this->acl_is_writeable("gotoHotplug")){ - unset($this->dialog); - $this->dialog= NULL; - $this->is_dialog = false; + $this->dialog->save_object(); + if(count($this->dialog->check())!=0){ + foreach($this->dialog->check() as $msg){ + print_red($msg); + } }else{ - $this->dialog->save_object(); - if(count($this->dialog->check())!=0){ - foreach($this->dialog->check() as $msg){ - print_red($msg); - } - }else{ - $this->dialog->save_object(); - $a_tmp = $this->dialog->save(); + $a_tmp = $this->dialog->save(); - if(is_array($a_tmp)){ - foreach($a_tmp as $name => $hotplug){ - $this->gotoHotplugDevices[$name]= $hotplug; - } + if(is_array($a_tmp)){ + foreach($a_tmp as $name => $hotplug){ + $this->gotoHotplugDevices[$name]= $hotplug; } - unset($this->dialog); - $this->dialog= NULL; - $this->is_dialog = false; } + unset($this->dialog); + $this->dialog= NULL; + $this->is_dialog = false; } } $smarty->assign("gotoHotplugDevices",$this->printOutHotPlugDevices()); @@ -796,6 +791,7 @@ class environment extends plugin $smarty->assign("gotoPrinterKeys",array_flip($this->printOutPrinterDevices())); /* General behavior */ + if($this->acl_is_writeable("gotoKioskProfile")){ if((isset($this->dialog))&&($this->dialog!=NULL)&&(!empty($this->dialog))){ $this->dialog->save_object(); $disp =$this->dialog->execute(); @@ -809,6 +805,7 @@ class environment extends plugin $this->gotoKioskProfile = 'none'; } return($disp); + } } /* Als smarty vars are set. Get smarty template and generate output */ diff --git a/plugins/personal/environment/class_logonManagementDialog.inc b/plugins/personal/environment/class_logonManagementDialog.inc index 98ce41ff3..3a16c6555 100644 --- a/plugins/personal/environment/class_logonManagementDialog.inc +++ b/plugins/personal/environment/class_logonManagementDialog.inc @@ -81,9 +81,16 @@ class logonManagementDialog extends plugin foreach($this->attributes as $attr){ if(isset($_POST[$attr])){ $this->$attr = stripslashes($_POST[$attr]); + } + } + + foreach(array("LogonLast","LogonOverload") as $checkBoxes){ + if(isset($_POST[$checkBoxes])){ + $this->$checkBoxes = stripslashes($_POST[$checkBoxes]); }else{ - $this->$attr = false; + $this->$checkBoxes = ""; } + } } } diff --git a/plugins/personal/environment/environment.tpl b/plugins/personal/environment/environment.tpl index ed4e32a9c..e5f70c1b2 100644 --- a/plugins/personal/environment/environment.tpl +++ b/plugins/personal/environment/environment.tpl @@ -215,7 +215,7 @@ {/render} {render acl=$gotoHotplugDeviceACL} - {/render} diff --git a/plugins/personal/environment/main.inc b/plugins/personal/environment/main.inc index 4c04e5a0e..0af0fb11e 100644 --- a/plugins/personal/environment/main.inc +++ b/plugins/personal/environment/main.inc @@ -31,6 +31,7 @@ if (!$remove_lock){ if (!isset($_SESSION['environment']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ $_SESSION['environment']= new environment ($config, $ui->dn); $_SESSION['environment']->set_acl_category('users'); + $_SESSION['environment']->set_acl_base($ui->dn); } $environment= $_SESSION['environment']; @@ -65,7 +66,6 @@ if (!$remove_lock){ if (count ($message) == 0){ $environment->save (); gosa_log ("User/environment object'".$ui->dn."' has been saved"); - $environment->acl= "#none#"; del_lock ($ui->dn); sess_del ('edit'); @@ -101,7 +101,7 @@ if (!$remove_lock){ $info= "\"\" ".$ui->dn." "; # if (isset($editacl) && $editacl != "#none#"){ - echo "FIxme, only display edit button if there is at least one attribute writeable"; + $display .= "FIxme, only display edit button if there is at least one attribute writeable"; $info.= "\"\" "._("Click the 'Edit' button below to change informations in this dialog"); $display.= "\n"; diff --git a/plugins/personal/generic/main.inc b/plugins/personal/generic/main.inc index 3c804fabe..40b00534a 100644 --- a/plugins/personal/generic/main.inc +++ b/plugins/personal/generic/main.inc @@ -166,7 +166,8 @@ if (!$remove_lock){ } /* Only display edit button if there is at least one attribute editable */ - if(preg_match("/w/",$ui->get_category_permissions($ui->dn,"users"))){ + $display .= "edit buttons does not work."; + if(preg_match("/w/",$ui->get_category_permissions($ui->dn,"users/user"))){ if ($fn == "edit"){ $info.= "\"\" ". _("Click the 'Edit' button below to change informations in this dialog"); diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index 79a8149f0..4c2790d2b 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -1132,8 +1132,9 @@ class posixAccount extends plugin $base = get_groups_ou().$base; } - $res= get_list($filter, "groups", $base,$attrs, $Flags); - + $res= get_list($filter, "groups/group", $base,$attrs, $Flags); + print_a($res); + /* check sizelimit */ if (preg_match("/size limit/i", $ldap->error)){ $_SESSION['limit_exceeded']= TRUE; diff --git a/plugins/personal/posix/main.inc b/plugins/personal/posix/main.inc index c1b0c30e1..5d68f0f21 100644 --- a/plugins/personal/posix/main.inc +++ b/plugins/personal/posix/main.inc @@ -105,12 +105,15 @@ if (!$remove_lock){ } else { $info= "\"\" ".$ui->dn." "; - - $display .= "FIXME : user -> posix, 109, Only display edit button if there is at least one attribute editable."; + + /* Only display edit button if there is at least one attribute editable */ + $display .= "edit buttons does not work."; + if(preg_match("/w/",$ui->get_category_permissions($ui->dn,"users"))){ $info.= "\"\" ". - _("Click the 'Edit' button below to change informations in this dialog"); + _("Click the 'Edit' button below to change informations in this dialog"); $display.= "\n"; + } $display.= "\n"; } $display.= "

\n";