From 252cc4c4ac0c3e2f387322b624e80a268d4810c2 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 27 Jul 2015 04:47:34 -0400
Subject: [PATCH] Password: Allow temporarily disabling the plugin functionality with a notice

---
 plugins/password/password.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/plugins/password/password.js b/plugins/password/password.js
index d0fd75a..75448ec 100644
--- a/plugins/password/password.js
+++ b/plugins/password/password.js
@@ -16,6 +16,13 @@
  */
 
 window.rcmail && rcmail.addEventListener('init', function(evt) {
+    if (rcmail.env.password_disabled) {
+        $('#password-form input').prop('disabled', true);
+        // reload page after ca. 3 minutes
+        rcmail.reload(3 * 60 * 1000 - 2000);
+        return;
+    }
+
     // register command handler
     rcmail.register_command('plugin.password-save', function() {
         var input_curpasswd = rcube_find_object('_curpasswd'),

--
Gitblit v1.9.1