From: cajus Date: Fri, 14 Aug 2009 10:06:36 +0000 (+0000) Subject: Updated filter registration and list xml X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7d61c47c54019ce4f468d3f9a5089faffea15f84;p=gosa.git Updated filter registration and list xml git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14065 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index f9368e414..1375040a6 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -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= ""; diff --git a/gosa-core/plugins/admin/users/user-list.xml b/gosa-core/plugins/admin/users/user-list.xml index 0cd971cda..f1a8f8dc5 100644 --- a/gosa-core/plugins/admin/users/user-list.xml +++ b/gosa-core/plugins/admin/users/user-list.xml @@ -24,7 +24,7 @@ - |20px||145px|80px;r| + |20px||145px|100px;r| %{filter:objectType(dn,objectClass)} @@ -134,11 +134,11 @@ - edit + templatize entry - gosaUserTemplate - images/lists/edit.png - + !gosaUserTemplate + plugins/users/images/wizard.png +