From 0c57cfe10afce8c12f4521ce1bd6bf0543df938b Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 7 Nov 2006 11:21:27 +0000 Subject: [PATCH] Fixed environemnt profile server acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5032 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../environment/class_environment.inc | 31 ++++++++++++++++--- plugins/personal/environment/environment.tpl | 8 +++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 940c63a72..05d04b8d6 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -256,6 +256,30 @@ class environment extends plugin /* Call parent execute */ plugin::execute(); + /* Are we editing from MyAccount and not editing a user */ + $WriteOnly = (!isset($this->parent)|| !$this->parent) && !isset($_SESSION['edit']); + + /* Check profile server */ + if($this->acl_is_writeable("gotoProfileServer",$WriteOnly)){ + if(!empty($this->gotoProfileServer) && !isset($this->gotoProfileServers[$this->gotoProfileServer])){ + if(count($this->gotoProfileServers)){ + + /* Get First Profile */ + $new = key($this->gotoProfileServers); + + /* Another profile server found */ + print_red(sprintf(_("Your selected profile server '%s' is no longer available. Setting profile server to '%s'."), + $this->gotoProfileServer,$new)); + }else{ + + /* No other profile servers found */ + print_red(sprintf(_("Your selected profile server '%s' is no longer available. Profile server configuration is resetted."), + $this->gotoProfileServer)); + $this->gotoProfileServer = ""; + } + } + } + $this->detect_grouptype(); /* Fill templating stuff */ @@ -264,9 +288,6 @@ class environment extends plugin $smarty->assign("is_group",$this->is_group); - /* Are we editing from MyAccount and not editing a user */ - $WriteOnly = (!isset($this->parent)|| !$this->parent) && !isset($_SESSION['edit']); - /* Prepare all variables for smarty */ foreach($this->attributes as $s_attr){ /* Set value*/ @@ -415,8 +436,8 @@ class environment extends plugin }else{ $smarty->assign("useProfileCHK"," checked "); } - - + + $smarty->assign("gotoProfileServerWriteable", $this->acl_is_writeable("gotoProfileServer",$WriteOnly)); $smarty->assign("gotoProfileACL", $this->getacl("gotoProfileServer",$WriteOnly).$this->getacl("gotoProfileQuota",$WriteOnly)); /* HANDLE Profile Settings here diff --git a/plugins/personal/environment/environment.tpl b/plugins/personal/environment/environment.tpl index 1dc24115b..2763b7e4f 100644 --- a/plugins/personal/environment/environment.tpl +++ b/plugins/personal/environment/environment.tpl @@ -36,10 +36,18 @@ {render acl=$gotoProfileServerACL} + +{if $gotoProfileServerWriteable} +{else} + +{/if} {/render} -- 2.30.2