Skip to content

Commit 07e1dc6

Browse files
committed
closes #1
1 parent 3e994a8 commit 07e1dc6

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
$('document').ready(function(){
2-
$('#auth_method').on('select2-selecting', function(e){
2+
$('#management_method').on('select2-selecting', function(e){
33
val = e.choice ? e.choice.id : e.target.selectedIndex;
4-
if(val == 2){
5-
//Mailbox
6-
$('#toggle-auth-internal').removeClass('in');
7-
$('#toggle-registration-closed').removeClass('in');
8-
}else if(val != undefined){
9-
$('#toggle-auth-internal').addClass('in');
4+
if(val == 0){
5+
//normal
6+
$('#toggle-management-normal').addClass('in');
7+
$('#toggle-registration-closed').addClass('in');
108
$('#public_registration').trigger('change');
9+
}else if(val != undefined){
10+
//maildomain
11+
$('#toggle-management-normal').removeClass('in');
12+
$('#toggle-registration-closed').removeClass('in');
1113
}else{
12-
$('#toggle-auth-internal').removeClass('in');
14+
$('#toggle-management-normal').removeClass('in');
1315
$('#toggle-registration-closed').removeClass('in');
1416
}
1517
});
@@ -21,5 +23,5 @@ $('document').ready(function(){
2123
}
2224
});
2325
$('#public_registration').trigger('change');
24-
$('#auth_method').trigger('select2-selecting');
26+
$('#management_method').trigger('select2-selecting');
2527
})

interface/web/mail/lib/lang/en_xmpp_domain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ $wb["use_http_archive_txt"] = 'Enable HTTP chatroom archive';
2525
$wb["http_archive_show_join_txt"] = 'Show join messages in archive';
2626
$wb["http_archive_show_status_txt"] = 'Show status changes in archive';
2727
$wb["use_status_host_txt"] = 'Enable XML Status host';
28+
$wb["cant_change_domainname_txt"] = 'The Domain name of existing XMPP domain cannot be changed.';
2829
$wb["no_corresponding_maildomain_txt"] = 'Corresponding mail domain for user management not found. Please create the mail domain first.';
2930
?>

interface/web/mail/templates/xmpp_domain_edit.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h1><tmpl_var name="list_head_txt"></h1>
6767
{tmpl_var name='domain_option'}
6868
</select></div>
6969
<tmpl_else>
70-
<div class="col-sm-9"><input type="text" name="domain" id="domain" value="{tmpl_var name='domain'}" class="form-control" /></div></tmpl_if>
70+
<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>
7171
</div>
7272

7373

@@ -81,7 +81,7 @@ <h1><tmpl_var name="list_head_txt"></h1>
8181
</select></div>
8282
</div>
8383

84-
<div id="toggle-auth-internal" class="collapse">
84+
<div id="toggle-management-normal" class="collapse">
8585
<div class="form-group">
8686
<label class="col-sm-3 control-label">{tmpl_var name='public_registration_txt'}</label>
8787
<div class="col-sm-9">

interface/web/mail/xmpp_domain_edit.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function onSubmit() {
262262
//* make sure that the xmpp domain is lowercase
263263
if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
264264

265-
// Read auth method
265+
// Read management method
266266
if(isset($this->dataRecord["management_method"]))
267267
switch($this->dataRecord["management_method"]){
268268
case 0:
@@ -328,6 +328,11 @@ function onBeforeUpdate() {
328328
global $app, $conf;
329329

330330
if($this->_xmpp_type == 'server') {
331+
// Check if the domain has been changed
332+
$rec = $app->db->queryOneRecord("SELECT domain from xmpp_domain WHERE domain_id = ".$this->id);
333+
if($this->dataRecord['domain']!=$rec['domain'])
334+
$app->error($app->tform->wordbook["cant_change_domainname_txt"]);
335+
331336
//* Check if the server has been changed
332337
// We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
333338
if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {

0 commit comments

Comments
 (0)