From ba8b3b5491ab6fcd36e8e4e096568b725afbad14 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 21 Jun 2007 13:36:21 +0000 Subject: [PATCH] Added application to ogroup tabs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6659 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/class_groupApplication.inc | 12 ++++++------ plugins/admin/ogroups/tabs_ogroups.inc | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc index 3468c735a..c77456864 100644 --- a/plugins/admin/groups/class_groupApplication.inc +++ b/plugins/admin/groups/class_groupApplication.inc @@ -840,9 +840,9 @@ class appgroup extends plugin /* Show main page */ if ($this->dialog){ $smarty->assign("table", $this->table); - $display.= $smarty->fetch (get_template_path('application_options.tpl', TRUE)); + $display.= $smarty->fetch (get_template_path('application_options.tpl', TRUE,dirname(__FILE__))); } else { - $display.= $smarty->fetch (get_template_path('application.tpl', TRUE)); + $display.= $smarty->fetch (get_template_path('application.tpl', TRUE,dirname(__FILE__))); } return ($display); @@ -858,8 +858,8 @@ class appgroup extends plugin $ret =array(); foreach($res as $attrs){ - if(preg_match("/ou=fai,/",$attrs['dn'])){ - $bb = preg_replace("/ou=fai,.*/","",$attrs['dn']); + if(preg_match("/ou=apps,/",$attrs['dn'])){ + $bb = preg_replace("/ou=apps,.*/","",$attrs['dn']); $parts = array_reverse(split("ou=",$bb)); $str =""; @@ -980,9 +980,9 @@ class appgroup extends plugin $ldap->modify ($this->attrs); if($this->initially_was_account){ - new log("modify","group/".get_class($this),$use_dn,array_keys($this->attrs),$ldap->get_error()); + new log("modify","group/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); }else{ - new log("create","group/".get_class($this),$use_dn,array_keys($this->attrs),$ldap->get_error()); + new log("create","group/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } show_ldap_error($ldap->get_error(), sprintf(_("Saving of groups/applications with dn '%s' failed."),$this->dn)); diff --git a/plugins/admin/ogroups/tabs_ogroups.inc b/plugins/admin/ogroups/tabs_ogroups.inc index 1e2c75fb5..7575a134e 100644 --- a/plugins/admin/ogroups/tabs_ogroups.inc +++ b/plugins/admin/ogroups/tabs_ogroups.inc @@ -112,6 +112,21 @@ class ogrouptabs extends tabs } } + /* Add application tab if user or group is member in this object group*/ + if((preg_match("/G/",$objects) || preg_match("/U/",$objects)) && !isset($this->by_name['appgroup'])){ + $this->by_name['appgroup']= _("Application"); + $this->by_object['appgroup']= new appgroup($this->config, $this->dn); + $this->by_object['appgroup']->acl = "#all#"; + $this->by_object['appgroup']->parent= &$this; + } + + /* Remove application tab if not required any longer */ + if(!preg_match("/G/",$objects) && !preg_match("/U/",$objects) && isset($this->by_name['appgroup'])){ + $this->by_object['appgroup']->remove_from_parent(); + unset($this->by_name['appgroup']); + unset($this->by_object['appgroup']); + } + /* Move reference tab to second position from right */ if(isset($this->by_name['acl'])){ $tmp = $this->by_name['acl']; -- 2.30.2