From 029167ad5dd7cc28a94c703a14d5d41ef92629a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20F=C3=BCrmann?= <michael@spicyweb.de>
Date: Thu, 19 Feb 2015 21:23:03 +0100
Subject: [PATCH] Removed management method 'mailaccount' as long as maildomain
 hook is not implemented

---
 interface/web/js/xmpp_domain_registration.js      | 2 ++
 interface/web/mail/templates/xmpp_domain_edit.htm | 7 +++++--
 interface/web/mail/xmpp_domain_edit.php           | 2 ++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/interface/web/js/xmpp_domain_registration.js b/interface/web/js/xmpp_domain_registration.js
index 3794bef9b4..1ce239e8c6 100644
--- a/interface/web/js/xmpp_domain_registration.js
+++ b/interface/web/js/xmpp_domain_registration.js
@@ -1,4 +1,6 @@
 $('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){
diff --git a/interface/web/mail/templates/xmpp_domain_edit.htm b/interface/web/mail/templates/xmpp_domain_edit.htm
index b6fff9b2c3..5c4e8d79a0 100644
--- a/interface/web/mail/templates/xmpp_domain_edit.htm
+++ b/interface/web/mail/templates/xmpp_domain_edit.htm
@@ -73,13 +73,16 @@
 
 
 
-
+<!--
+management by maildomain is currently not supported
 <div class="form-group">
     <label for="management_method" class="col-sm-3 control-label">{tmpl_var name='management_method_txt'}</label>
     <div class="col-sm-9"><select name="management_method" id="management_method" class="form-control">
         {tmpl_var name='management_method'}
     </select></div>
 </div>
+-->
+<input type="hidden" name="management_method" id="management_method" value="0" />
 
 <div id="toggle-management-normal" class="collapse">
     <!--
@@ -92,7 +95,7 @@
     </div-->
 </div>
         <input type="hidden" name="public_registration" id="public_registration" value="n" />
-<div id="toggle-registration-closed" class="collapse">
+<div id="toggle-registration-closed" class="collapse in">
     <div class="form-group">
         <label for="registration_url" class="col-sm-3 control-label">{tmpl_var name='registration_url_txt'}</label>
         <div class="col-sm-9">
diff --git a/interface/web/mail/xmpp_domain_edit.php b/interface/web/mail/xmpp_domain_edit.php
index ff1f8b8929..2844a2776a 100644
--- a/interface/web/mail/xmpp_domain_edit.php
+++ b/interface/web/mail/xmpp_domain_edit.php
@@ -264,6 +264,8 @@ class page_action extends tform_actions {
 
         // Read management method
         if(isset($this->dataRecord["management_method"]))
+            // Set management method to 0 as long as the mailaccount hook is not implemented
+            $this->dataRecord["management_method"] = 0;
             switch($this->dataRecord["management_method"]){
                 case 0:
                     $this->dataRecord["management_method"] = 'normal';
-- 
GitLab