From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 06 Aug 2015 03:18:44 -0400
Subject: [PATCH] - don't set password via remoting if field is empty

---
 interface/web/js/xmpp_domain_registration.js |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/interface/web/js/xmpp_domain_registration.js b/interface/web/js/xmpp_domain_registration.js
new file mode 100644
index 0000000..1ce239e
--- /dev/null
+++ b/interface/web/js/xmpp_domain_registration.js
@@ -0,0 +1,29 @@
+$('document').ready(function(){
+    // Not needed as long as maildomain hook is not implemented
+    return;
+    $('#management_method').on('select2-selecting', function(e){
+        val = e.choice ? e.choice.id : e.target.selectedIndex;
+        if(val == 0){
+            //normal
+            $('#toggle-management-normal').addClass('in');
+            $('#toggle-registration-closed').addClass('in');
+            $('#public_registration').trigger('change');
+        }else if(val != undefined){
+            //maildomain
+            $('#toggle-management-normal').removeClass('in');
+            $('#toggle-registration-closed').removeClass('in');
+        }else{
+            $('#toggle-management-normal').removeClass('in');
+            $('#toggle-registration-closed').removeClass('in');
+        }
+    });
+    $('#public_registration').on('change', function(e){
+        if($(this).is(':checked')){
+            $('#toggle-registration-closed').removeClass('in');
+        }else{
+            $('#toggle-registration-closed').addClass('in');
+        }
+    });
+    $('#public_registration').trigger('change');
+    $('#management_method').trigger('select2-selecting');
+})
\ No newline at end of file

--
Gitblit v1.9.1