Call user-unlock command from Web UI.

It will unlock displayed user on current master.

related to:
https://fedorahosted.org/freeipa/ticket/2792
--
Petr Vobornik
From 1d39ac323d3c5975a6725bac50c81f655606f9b2 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Tue, 24 Jun 2014 12:24:23 +0200
Subject: [PATCH] webui: support unlock user command

Call user-unlock command from Web UI.

It will unlock displayed user on current master.

related to:
https://fedorahosted.org/freeipa/ticket/2792
---
 install/ui/src/freeipa/user.js     | 10 +++++++++-
 install/ui/test/data/ipa_init.json |  4 +++-
 ipalib/plugins/internal.py         |  2 ++
 ipatests/test_webui/test_user.py   |  2 ++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/install/ui/src/freeipa/user.js b/install/ui/src/freeipa/user.js
index 3685b116aad6708f88a437a4abebc68ff9df4474..50eaca17f6536061718bde9ca26e1c76c6e38e56 100644
--- a/install/ui/src/freeipa/user.js
+++ b/install/ui/src/freeipa/user.js
@@ -268,12 +268,20 @@ return {
                 'delete',
                 'reset_password',
                 {
+                    $factory: IPA.object_action,
+                    name: 'unlock',
+                    method: 'unlock',
+                    label: '@i18n:objects.user.unlock',
+                    needs_confirm: true,
+                    confirm_msg: '@i18n:objects.user.unlock_confirm'
+                },
+                {
                     $type: 'automember_rebuild',
                     name: 'automember_rebuild',
                     label: '@i18n:actions.automember_rebuild'
                 }
             ],
-            header_actions: ['reset_password', 'enable', 'disable', 'delete', 'automember_rebuild'],
+            header_actions: ['reset_password', 'enable', 'disable', 'delete', 'unlock', 'automember_rebuild'],
             state: {
                 evaluators: [
                     {
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index c678d0315c3e92a54dc63f2bd4aef1c90ce68185..79aff6ded21bf43f1089ad4ee1f58b051c64d54a 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -499,7 +499,9 @@
                             "mailing": "Mailing Address",
                             "misc": "Misc. Information",
                             "status_confirmation": "Are you sure you want to ${action} the user?<br/>The change will take effect immediately.",
-                            "status_link": "Click to ${action}"
+                            "status_link": "Click to ${action}",
+                            "unlock": "Unlock",
+                            "unlock_confirm": "Are you sure you want to unlock user ${object}?"
                         }
                     },
                     "password": {
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 57782c207a27e9b2c8ba83a54eb3cd4b20719f9e..6c322da51754a9c0f8bb6e4510a81ef7fa328f4c 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -645,6 +645,8 @@ class i18n_messages(Command):
                 "misc": _("Misc. Information"),
                 "status_confirmation": _("Are you sure you want to ${action} the user?<br/>The change will take effect immediately."),
                 "status_link": _("Click to ${action}"),
+                "unlock": _("Unlock"),
+                "unlock_confirm": _("Are you sure you want to unlock user ${object}?"),
             },
         },
         "password": {
diff --git a/ipatests/test_webui/test_user.py b/ipatests/test_webui/test_user.py
index 766fdafb4ee700fc2a4131dbf92d694be8d17188..d6d7ced8d52d5509a837874a0bec50bdc39f0fab 100644
--- a/ipatests/test_webui/test_user.py
+++ b/ipatests/test_webui/test_user.py
@@ -156,6 +156,8 @@ class test_user(UI_driver):
         self.reset_password_action(pwd)
         self.assert_text_field('has_password', '******')
 
+        self.action_list_action('unlock')
+
         # delete
         self.delete_action(user.ENTITY, user.PKEY)
 
-- 
1.9.0

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to