Michael Fürmann
2015-02-19 07e1dc630a98df5824cb5c31ed798449e164dfd7
closes #1
4 files modified
32 ■■■■■ changed files
interface/web/js/xmpp_domain_registration.js 20 ●●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/en_xmpp_domain.lng 1 ●●●● patch | view | raw | blame | history
interface/web/mail/templates/xmpp_domain_edit.htm 4 ●●●● patch | view | raw | blame | history
interface/web/mail/xmpp_domain_edit.php 7 ●●●● patch | view | raw | blame | history
interface/web/js/xmpp_domain_registration.js
@@ -1,15 +1,17 @@
$('document').ready(function(){
    $('#auth_method').on('select2-selecting', function(e){
    $('#management_method').on('select2-selecting', function(e){
        val = e.choice ? e.choice.id : e.target.selectedIndex;
        if(val == 2){
            //Mailbox
            $('#toggle-auth-internal').removeClass('in');
            $('#toggle-registration-closed').removeClass('in');
        }else if(val != undefined){
            $('#toggle-auth-internal').addClass('in');
        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-auth-internal').removeClass('in');
            $('#toggle-management-normal').removeClass('in');
            $('#toggle-registration-closed').removeClass('in');
        }
    });
@@ -21,5 +23,5 @@
        }
    });
    $('#public_registration').trigger('change');
    $('#auth_method').trigger('select2-selecting');
    $('#management_method').trigger('select2-selecting');
})
interface/web/mail/lib/lang/en_xmpp_domain.lng
@@ -25,5 +25,6 @@
$wb["http_archive_show_join_txt"] = 'Show join messages in archive';
$wb["http_archive_show_status_txt"] = 'Show status changes in archive';
$wb["use_status_host_txt"] = 'Enable XML Status host';
$wb["cant_change_domainname_txt"] = 'The Domain name of existing XMPP domain cannot be changed.';
$wb["no_corresponding_maildomain_txt"] = 'Corresponding mail domain for user management not found. Please create the mail domain first.';
?>
interface/web/mail/templates/xmpp_domain_edit.htm
@@ -67,7 +67,7 @@
                        {tmpl_var name='domain_option'}
                    </select></div>
                    <tmpl_else>
                        <div class="col-sm-9"><input type="text" name="domain" id="domain" value="{tmpl_var name='domain'}" class="form-control" /></div></tmpl_if>
                        <div class="col-sm-9"><input type="text" name="domain" id="domain" value="{tmpl_var name='domain'}" class="form-control" <tmpl_if name="edit_disabled">readonly="readonly"</tmpl_if>/></div></tmpl_if>
            </div>
@@ -81,7 +81,7 @@
    </select></div>
</div>
<div id="toggle-auth-internal" class="collapse">
<div id="toggle-management-normal" class="collapse">
    <div class="form-group">
        <label class="col-sm-3 control-label">{tmpl_var name='public_registration_txt'}</label>
        <div class="col-sm-9">
interface/web/mail/xmpp_domain_edit.php
@@ -262,7 +262,7 @@
        //* make sure that the xmpp domain is lowercase
        if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
        // Read auth method
        // Read management method
        if(isset($this->dataRecord["management_method"]))
            switch($this->dataRecord["management_method"]){
                case 0:
@@ -328,6 +328,11 @@
        global $app, $conf;
        if($this->_xmpp_type == 'server') {
            // Check if the domain has been changed
            $rec = $app->db->queryOneRecord("SELECT domain from xmpp_domain WHERE domain_id = ".$this->id);
            if($this->dataRecord['domain']!=$rec['domain'])
                $app->error($app->tform->wordbook["cant_change_domainname_txt"]);
            //* Check if the server has been changed
            // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
            if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {