From: hickert Date: Thu, 26 Jun 2008 06:21:25 +0000 (+0000) Subject: Updated phoneAccount X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7bfd167683eed20cb63b3a558966b5312ce71235;p=gosa.git Updated phoneAccount -Ensure that we don't edit an entry twice, be reloading the browser. -Keep the currently selected macro selected, also if we have no acls to read the currently selected macro. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11445 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc index 548bc34ad..111bfc8a8 100644 --- a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc +++ b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc @@ -159,7 +159,7 @@ class phoneAccount extends plugin * Search for all available phone hardware */ $tmp = get_sub_list("(objectClass=goFonHardware)","phone",array(get_ou("phoneou")), - $this->config->current['BASE'],array("cn","description"), GL_NO_ACL_CHECK); + $this->config->current['BASE'],array("cn","description"), GL_SUBSEARCH); foreach($tmp as $attrs){ $cn= $attrs['cn'][0]; $description= ""; @@ -186,7 +186,7 @@ class phoneAccount extends plugin get_ou("phoneou")); $tmp = get_sub_list("(goFonHardware=*)","phone",$deps_a,$this->config->current['BASE'], - array('cn','dn','goFonHardware'),GL_NO_ACL_CHECK); + array('cn','dn','goFonHardware'),GL_SUBSEARCH); foreach($tmp as $attrs){ $cn = $attrs['goFonHardware'][0]; if(isset($this->hardware_list[$cn])){ @@ -200,7 +200,7 @@ class phoneAccount extends plugin * an array with name and parameters */ $tmp = get_sub_list("(&(objectClass=goFonMacro)(goFonMacroVisible=1))","gofonmacro",array(get_ou("macroou")), - $this->config->current['BASE'],array("displayName","goFonMacroParameter","dn","cn"), GL_NONE); + $this->config->current['BASE'],array("displayName","goFonMacroParameter","dn","cn"), GL_NO_ACL_CHECK | GL_SUBSEARCH ); /* Add none for no macro*/ @@ -210,6 +210,16 @@ class phoneAccount extends plugin /* Fetch all Macros*/ foreach($tmp as $attrs){ + $ui = get_userinfo(); + $acl = $ui->get_permissions($attrs['dn'],"gofonmacro/macro",""); + + /* Skip all macros we are not able to read + execpt, the currently selected macro. + */ + if(!preg_match("/r/",$acl) && !preg_match("/^".normalizePreg($attrs['dn'])."/",$this->goFonMacro)){ + continue; + } + /* unset Count, we don't need that here */ unset($attrs['displayName']['count']); diff --git a/gosa-plugins/gofon/gofon/phoneaccount/main.inc b/gosa-plugins/gofon/gofon/phoneaccount/main.inc index 04318a13a..179b22af8 100644 --- a/gosa-plugins/gofon/gofon/phoneaccount/main.inc +++ b/gosa-plugins/gofon/gofon/phoneaccount/main.inc @@ -45,7 +45,7 @@ if (!$remove_lock){ } /* Enter edit mode? */ - if (isset($_POST['edit'])){ + if (isset($_POST['edit']) && !session::is_set('edit')){ /* Check locking */ if (($username= get_lock($ui->dn)) != ""){