Code

Updated filter registration and list xml
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 14 Aug 2009 10:06:36 +0000 (10:06 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 14 Aug 2009 10:06:36 +0000 (10:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14065 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/users/class_userManagement.inc
gosa-core/plugins/admin/users/user-list.xml

index f9368e414e89c244177135f8a7222e4b80165701..1375040a68092775b5ab0d07ed02bc2bb79d0834 100644 (file)
@@ -979,7 +979,6 @@ class userManagement extends plugin
     $this->DivListUsers->setEntries($this->list);
 
     # FILTER Test #################################################
-
     ## Build filter
     #$filter = new filter(get_template_path("user-filter.xml", true));
     #$filter->setObjectStorage(get_people_ou());
@@ -993,6 +992,8 @@ class userManagement extends plugin
     ## Build headpage
     #$headpage = new listing(get_template_path("user-list.xml", true));
     #$headpage->registerElementFilter("accountProperties", "userManagement::filterProperties");
+    #$headpage->registerElementFilter("lockLabel", "userManagement::filterLockLabel");
+    #$headpage->registerElementFilter("lockImage", "userManagement::filterLockImage");
     #$headpage->setFilter($filter);
 
     ## Needs to be called before update!
@@ -1008,6 +1009,38 @@ class userManagement extends plugin
   }
 
 
+  static function filterLockImage($userPassword)
+  {
+    $image= "images/empty.png";
+
+    if(isset($userPassword[0]) && preg_match("/^\{[^\}]/",$userPassword[0])){
+      if(preg_match("/^[^\}]*+\}!/",$userPassword[0])){
+        $image= "images/lists/locked.png";
+      }else{
+        $image= "images/lists/unlocked.png";
+      }
+    }
+
+    return $image;
+  }
+
+
+  static function filterLockLabel($userPassword)
+  {
+    $label= "";
+
+    if(isset($userPassword[0]) && preg_match("/^\{[^\}]/",$userPassword[0])){
+      if(preg_match("/^[^\}]*+\}!/",$userPassword[0])){
+        $label= _("Unlock account");
+      }else{
+        $label= _("Lock account");
+      }
+    }
+
+    return $label;
+  }
+
+
   static function filterProperties($dn, $row, $class)
   {
     $result= "";
index 0cd971cda786ba1dc263c8a701b44b70f36dd525..f1a8f8dc5c5fd5c5a60d5a5407fe2ac4dbd5cab0 100644 (file)
@@ -24,7 +24,7 @@
   </definition>
 
   <table>
-    <layout>|20px||145px|80px;r|</layout>
+    <layout>|20px||145px|100px;r|</layout>
 
     <column>
       <value>%{filter:objectType(dn,objectClass)}</value>
     </action>
 
     <action>
-      <name>edit</name>
+      <name>templatize</name>
       <type>entry</type>
-      <objectclass>gosaUserTemplate</objectclass>
-      <image>images/lists/edit.png</image>
-      <label>Edit user</label>
+      <objectclass>!gosaUserTemplate</objectclass>
+      <image>plugins/users/images/wizard.png</image>
+      <label>Apply template</label>
     </action>
 
     <action>