Code

Updated acl list handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Dec 2009 12:11:17 +0000 (12:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Dec 2009 12:11:17 +0000 (12:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14933 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/acl/acl-filter.xml
gosa-core/plugins/admin/acl/acl-list.xml
gosa-core/plugins/admin/acl/class_aclManagement.inc

index eda0371c8211d5b4f030d5a58b292cb1c5857823..01b9a7b56b6fff46d422a52f4620bf573be762c1 100644 (file)
     <maxlength>60</maxlength>
     <default></default>
     <unset></unset>
-    <set>(|(ou=*$*)(description=*$*))</set>
+    <set>(|(cn=*$*)(ou=*$*)(description=*$*))</set>
     <alphabet>true</alphabet>
     <autocomplete>
       <backend>LDAP</backend>
-      <filter>(&amp;(|(objectClass=gosaAcl)(objectClass=gosaAclRole))(|(ou=*$NAME*)(description=*$NAME*)))</filter>
+      <filter>(&amp;(|(objectClass=gosaAcl)(objectClass=gosaRole))(|(ou=*$NAME*)(description=*$NAME*)(cn=*$NAME*)))</filter>
       <attribute>ou</attribute>
       <attribute>description</attribute>
       <frequency>0.5</frequency>
@@ -62,7 +62,7 @@
     <tag>ROLE</tag>
     <default>true</default>
     <unset></unset>
-    <set>(objectClass=gosaAclRole)</set>
+    <set>(objectClass=gosaRole)</set>
   </element>
 
 </filterdef>
index ca8d4c45f7c51809ecdaed85a5d74c701dbdb0e0..8e3ce12d763e03ed7983ad9ed25f1496c4e37d57 100644 (file)
@@ -21,7 +21,7 @@
 
     <objectType>
       <label>Role</label>
-      <objectClass>gosaAclRole</objectClass>
+      <objectClass>gosaRole</objectClass>
       <category>acl</category>
       <class>acl</class>
       <image>plugins/users/images/select_user.png</image>
@@ -49,7 +49,7 @@
       <label>Name</label>
       <sortAttribute>ou</sortAttribute>
       <sortType>string</sortType>
-      <value>%{filter:link(row,dn,"%s",ou)}</value>
+      <value>%{filter:filterLabel(row,dn,"%s",ou,cn,pid,base)}</value>
       <export>true</export>
     </column>
 
index ad6c316538f7d1e5c204616a00f26cfce93b3b1e..dc652a6e57861638ef49b11cc41de4c5744c1683 100644 (file)
@@ -51,6 +51,7 @@ class aclManagement extends management
 
     // Build headpage
     $headpage = new listing(get_template_path("acl-list.xml", true));
+    $headpage->registerElementFilter("filterLabel", "aclManagement::filterLabel");
     $headpage->setFilter($filter);
 
     // Add copy&paste and snapshot handler.
@@ -64,6 +65,23 @@ class aclManagement extends management
     parent::__construct($config, $ui, "acl", $headpage);
 
   }
+
+  // A filter which allows to open a department by clicking on the departments name.
+  static function filterLabel($row,$dn,$params,$ou= array(),$cn=array(),$pid=0,$base="")
+  {
+    if(!isset($ou[0])){
+      $ou = $cn[0];
+    }else{
+      $ou = $ou[0];
+    }
+    if($dn == $base){
+      $ou =".";
+    }
+    $dn= LDAP::fix(func_get_arg(1));
+    return("<a href='?plug=".$_GET['plug']."&amp;PID=$pid&amp;act=listing_open_$row' title='$dn'>$ou</a>");
+  }
+
+
 } 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>