Commit 07e1dc63 authored by Michael Fürmann's avatar Michael Fürmann
Browse files

closes #1

parent 3e994a81
$('document').ready(function(){ $('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; val = e.choice ? e.choice.id : e.target.selectedIndex;
if(val == 2){ if(val == 0){
//Mailbox //normal
$('#toggle-auth-internal').removeClass('in'); $('#toggle-management-normal').addClass('in');
$('#toggle-registration-closed').removeClass('in'); $('#toggle-registration-closed').addClass('in');
}else if(val != undefined){
$('#toggle-auth-internal').addClass('in');
$('#public_registration').trigger('change'); $('#public_registration').trigger('change');
}else if(val != undefined){
//maildomain
$('#toggle-management-normal').removeClass('in');
$('#toggle-registration-closed').removeClass('in');
}else{ }else{
$('#toggle-auth-internal').removeClass('in'); $('#toggle-management-normal').removeClass('in');
$('#toggle-registration-closed').removeClass('in'); $('#toggle-registration-closed').removeClass('in');
} }
}); });
...@@ -21,5 +23,5 @@ $('document').ready(function(){ ...@@ -21,5 +23,5 @@ $('document').ready(function(){
} }
}); });
$('#public_registration').trigger('change'); $('#public_registration').trigger('change');
$('#auth_method').trigger('select2-selecting'); $('#management_method').trigger('select2-selecting');
}) })
\ No newline at end of file
...@@ -25,5 +25,6 @@ $wb["use_http_archive_txt"] = 'Enable HTTP chatroom archive'; ...@@ -25,5 +25,6 @@ $wb["use_http_archive_txt"] = 'Enable HTTP chatroom archive';
$wb["http_archive_show_join_txt"] = 'Show join messages in archive'; $wb["http_archive_show_join_txt"] = 'Show join messages in archive';
$wb["http_archive_show_status_txt"] = 'Show status changes in archive'; $wb["http_archive_show_status_txt"] = 'Show status changes in archive';
$wb["use_status_host_txt"] = 'Enable XML Status host'; $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.'; $wb["no_corresponding_maildomain_txt"] = 'Corresponding mail domain for user management not found. Please create the mail domain first.';
?> ?>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
{tmpl_var name='domain_option'} {tmpl_var name='domain_option'}
</select></div> </select></div>
<tmpl_else> <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> </div>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</select></div> </select></div>
</div> </div>
<div id="toggle-auth-internal" class="collapse"> <div id="toggle-management-normal" class="collapse">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='public_registration_txt'}</label> <label class="col-sm-3 control-label">{tmpl_var name='public_registration_txt'}</label>
<div class="col-sm-9"> <div class="col-sm-9">
......
...@@ -262,7 +262,7 @@ class page_action extends tform_actions { ...@@ -262,7 +262,7 @@ class page_action extends tform_actions {
//* make sure that the xmpp domain is lowercase //* make sure that the xmpp domain is lowercase
if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]); if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
// Read auth method // Read management method
if(isset($this->dataRecord["management_method"])) if(isset($this->dataRecord["management_method"]))
switch($this->dataRecord["management_method"]){ switch($this->dataRecord["management_method"]){
case 0: case 0:
...@@ -328,6 +328,11 @@ class page_action extends tform_actions { ...@@ -328,6 +328,11 @@ class page_action extends tform_actions {
global $app, $conf; global $app, $conf;
if($this->_xmpp_type == 'server') { 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 //* 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 // 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'])) { if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment