From 93bb7546f0b7978b440fe852e3d538200d81a5f2 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 26 Oct 2009 12:02:23 +0000 Subject: [PATCH] Updated user filter to include snapshot fuctionalites git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14637 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/users/class_userManagement.inc | 38 +++++++++++++++ gosa-core/plugins/admin/users/user-filter.xml | 1 + gosa-core/plugins/admin/users/user-list.xml | 48 +++++++++++++------ 3 files changed, 72 insertions(+), 15 deletions(-) diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 318919df7..b2079be03 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -35,14 +35,20 @@ class userManagement extends management function __construct($config,$ui) { + $this->config = $config; + $this->ui = $ui; + // Build filter $filter = new filter(get_template_path("user-filter.xml", true)); $filter->setObjectStorage("ou=people,"); // Build headpage $headpage = new listing(get_template_path("user-list.xml", true)); + $headpage->registerElementFilter("lockLabel", "userManagement::filterLockLabel"); + $headpage->registerElementFilter("lockImage", "userManagement::filterLockImage"); $headpage->setFilter($filter); $this->cpHandler = new CopyPasteHandler($this->config); + $this->snapHandler = new SnapshotHandler($this->config); parent::__construct($config, $ui, "users", $headpage); @@ -66,6 +72,38 @@ class userManagement extends management $this->newEntry(); $this->tabObject->set_template_mode (); } +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; + } + + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-core/plugins/admin/users/user-filter.xml b/gosa-core/plugins/admin/users/user-filter.xml index 1042de9b6..71042d2fc 100644 --- a/gosa-core/plugins/admin/users/user-filter.xml +++ b/gosa-core/plugins/admin/users/user-filter.xml @@ -18,6 +18,7 @@ customerNumber customerState dateOfBirth + userPassword one diff --git a/gosa-core/plugins/admin/users/user-list.xml b/gosa-core/plugins/admin/users/user-list.xml index c7d5423a6..e906af6c6 100644 --- a/gosa-core/plugins/admin/users/user-list.xml +++ b/gosa-core/plugins/admin/users/user-list.xml @@ -30,7 +30,7 @@ - |20px||260px|100px|120px|60px;c|140px;r| + |20px||260px|180px;r| %{filter:objectType(dn,objectClass)} @@ -38,7 +38,7 @@ %{filter:departmentLink(row,dn,description)} - 5 + 3 @@ -106,11 +106,6 @@ separator - - cp - copypaste - - separator @@ -129,12 +124,41 @@ + + cp + !gosaUserTemplate + copypaste + + edit entry gosaAccount images/lists/edit.png - + + + + + lock + entry + !gosaUserTemplate + %{filter:lockImage(userPassword)} + uniBonnAccount/password[w] + + + + + password + entry + !gosaUserTemplate + plugins/users/images/list_password.png + + + + + snapshot + snapshot + !gosaUserTemplate @@ -143,13 +167,7 @@ images/lists/trash.png gosaAccount users/user[d] - - - - - cp - copypaste - users/user[w] + -- 2.30.2