Code

Added application to ogroup tabs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Jun 2007 13:36:21 +0000 (13:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Jun 2007 13:36:21 +0000 (13:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6659 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupApplication.inc
plugins/admin/ogroups/tabs_ogroups.inc

index 3468c735a00275f282a76ddc53bcbc627d91bad2..c774568645da6706865d3da69877a8a92e7d351f 100644 (file)
@@ -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));
index 1e2c75fb50e87bcba273027849ead9c4112d5362..7575a134e1b0ef18ae7aaa0b513f5a57b0c12408 100644 (file)
@@ -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'];