File tree Expand file tree Collapse file tree 4 files changed +20
-12
lines changed
Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 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} )
Original file line number Diff line number Diff 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?>
Original file line number Diff line number Diff 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 ">
Original file line number Diff line number Diff 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 ' ])) {
You can’t perform that action at this time.
0 commit comments