From 7b1972ed4c88d3de2c9ccc35ddc5536aaaae6aea Mon Sep 17 00:00:00 2001
From: Lucas Carvalho <lucas@nexedi.com>
Date: Tue, 22 Mar 2011 19:07:45 +0000
Subject: [PATCH] 2011-03-22 lucas - We must hide the change password action,
 once the password management is done locally.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44517 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../TioLiveDecoupleInstance.py                | 12 ++++++++
 .../Alarm_decoupleInstance.xml                |  3 ++
 .../Alarm_hideChangePasswordAction.xml        | 28 +++++++++++++++++++
 bt5/tiolive_decouple_instance/bt/change_log   |  3 ++
 bt5/tiolive_decouple_instance/bt/revision     |  2 +-
 5 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 bt5/tiolive_decouple_instance/SkinTemplateItem/portal_skins/tiolive_decouple_instance/Alarm_hideChangePasswordAction.xml

diff --git a/bt5/tiolive_decouple_instance/ExtensionTemplateItem/TioLiveDecoupleInstance.py b/bt5/tiolive_decouple_instance/ExtensionTemplateItem/TioLiveDecoupleInstance.py
index 419e85ef09..cadb3bf5ef 100644
--- a/bt5/tiolive_decouple_instance/ExtensionTemplateItem/TioLiveDecoupleInstance.py
+++ b/bt5/tiolive_decouple_instance/ExtensionTemplateItem/TioLiveDecoupleInstance.py
@@ -26,3 +26,15 @@ def Alarm_updatePersonModulePasswordInformation(self, **kw):
 
   return result.keys()
 
+def Alarm_hideChangePasswordAction(self):
+  """
+    The TioLive Instance has an action to change the user password 
+    and it redirects to TioLive Master.
+
+    Once the instance is going to be decoupled, such action must be hidden,
+    because the password management must be done locally instead of
+    Tiolive Master.
+  """
+  for action in self.portal_actions.listActions():
+    if action.id == 'tiolive_change_password':
+      action.visible = 0
diff --git a/bt5/tiolive_decouple_instance/SkinTemplateItem/portal_skins/tiolive_decouple_instance/Alarm_decoupleInstance.xml b/bt5/tiolive_decouple_instance/SkinTemplateItem/portal_skins/tiolive_decouple_instance/Alarm_decoupleInstance.xml
index d50a1d2ebf..d60ab9d8f1 100644
--- a/bt5/tiolive_decouple_instance/SkinTemplateItem/portal_skins/tiolive_decouple_instance/Alarm_decoupleInstance.xml
+++ b/bt5/tiolive_decouple_instance/SkinTemplateItem/portal_skins/tiolive_decouple_instance/Alarm_decoupleInstance.xml
@@ -71,6 +71,9 @@ if not context.Alarm_moveObsoleteSkinObjectList():\n
 context.Alarm_removeAuthenticationPlugin()\n
 context.setEnabled(False)\n
 \n
+# Hide change password action\n
+context.Alarm_hideChangePasswordAction()\n
+\n
 # Notify customer\n
 context.Alarm_notifyDecoupleInstance(person_list=result)\n
 \n
diff --git a/bt5/tiolive_decouple_instance/SkinTemplateItem/portal_skins/tiolive_decouple_instance/Alarm_hideChangePasswordAction.xml b/bt5/tiolive_decouple_instance/SkinTemplateItem/portal_skins/tiolive_decouple_instance/Alarm_hideChangePasswordAction.xml
new file mode 100644
index 0000000000..cbd8e2db52
--- /dev/null
+++ b/bt5/tiolive_decouple_instance/SkinTemplateItem/portal_skins/tiolive_decouple_instance/Alarm_hideChangePasswordAction.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_function</string> </key>
+            <value> <string>Alarm_hideChangePasswordAction</string> </value>
+        </item>
+        <item>
+            <key> <string>_module</string> </key>
+            <value> <string>TioLiveDecoupleInstance</string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Alarm_hideChangePasswordAction</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/tiolive_decouple_instance/bt/change_log b/bt5/tiolive_decouple_instance/bt/change_log
index f0762323a2..b3d43da13f 100644
--- a/bt5/tiolive_decouple_instance/bt/change_log
+++ b/bt5/tiolive_decouple_instance/bt/change_log
@@ -1,2 +1,5 @@
+2011-03-22 lucas
+- We must hide the change password action, once the password management is done locally.
+
 2011-01-18 lucas
 - Initial version
\ No newline at end of file
diff --git a/bt5/tiolive_decouple_instance/bt/revision b/bt5/tiolive_decouple_instance/bt/revision
index da2d3988d7..3f10ffe7a4 100644
--- a/bt5/tiolive_decouple_instance/bt/revision
+++ b/bt5/tiolive_decouple_instance/bt/revision
@@ -1 +1 @@
-14
\ No newline at end of file
+15
\ No newline at end of file
-- 
2.30.9