From: hickert Date: Fri, 11 Aug 2006 05:06:24 +0000 (+0000) Subject: Fixed environemnt save_object. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=794f1cb44bbdc4393931358ade83e1f1f855ba0a;p=gosa.git Fixed environemnt save_object. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4474 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index c86f52d00..55a9216a1 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -855,35 +855,49 @@ class environment extends plugin /* Get all Posted vars * Setup checkboxes */ - + $WriteOnly = (!isset($this->parent)|| !$this->parent) && !isset($_SESSION['edit']); if(isset($_POST['iamposted'])){ - if(isset($_POST['useProfile'])){ - $this->useProfile = true; - }else{ - $this->useProfile = false; + + $PACL = $this->getacl("gotoProfileServer",$WriteOnly).$this->getacl("gotoProfileQuota",$WriteOnly); + + if(preg_match("/w/",$PACL)){ + if(isset($_POST['useProfile'])){ + $this->useProfile = true; + }else{ + $this->useProfile = false; + } } - if(isset($_POST['gotoProfileFlagC'])){ - $this->gotoProfileFlagC = $_POST['gotoProfileFlagC']; - }else{ - $this->gotoProfileFlagC = false; + + if($this->acl_is_writeable("gotoProfileFlagC")){ + if(isset($_POST['gotoProfileFlagC'])){ + $this->gotoProfileFlagC = $_POST['gotoProfileFlagC']; + }else{ + $this->gotoProfileFlagC = false; + } } - if(isset($_POST['gotoProfileFlagL'])){ - $this->gotoProfileFlagL = $_POST['gotoProfileFlagL']; - }else{ - $this->gotoProfileFlagL = false; + + if($this->acl_is_writeable("gotoProfileFlagL")){ + if(isset($_POST['gotoProfileFlagL'])){ + $this->gotoProfileFlagL = $_POST['gotoProfileFlagL']; + }else{ + $this->gotoProfileFlagL = false; + } } - $tmp= $this->gosaDefaultPrinter; plugin::save_object(); foreach($this->attributes as $s_attr){ - if(in_array($s_attr,array("gotoShares","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue; - if(isset($_POST[$s_attr])){ - $this->$s_attr = $_POST[$s_attr]; - }else{ - $this->$s_attr = false; + if((!isset($_POST[$s_attr])) || + in_array($s_attr,array("gosaDefaultPrinter","gotoShares","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue; + if(!$this->acl_is_writeable($s_attr)){ + continue; + }else{ + if(isset($_POST[$s_attr])){ + $this->$s_attr = $_POST[$s_attr]; + }else{ + $this->$s_attr = false; + } } } - $this->gosaDefaultPrinter= $tmp; } }