Skip to content

Commit db12e25

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1'
2 parents e0d230d + 71aeb3b commit db12e25

40 files changed

+210
-228
lines changed

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ munin_url=
2727
munin_user=
2828
munin_password=
2929
monitor_system_updates=y
30+
migration_mode=n
3031

3132
[mail]
3233
module=postfix_mysql

interface/lib/classes/remote.d/admin.inc.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,34 @@ public function update_record_permissions($tablename, $index_field, $index_value
103103
return $app->db->datalogUpdate( $tablename, $permissions, $index_field, $index_value ) ;
104104
}
105105

106+
/**
107+
Set a value in the system configuration
108+
@param int session id
109+
@param int server id
110+
@param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
111+
@param string key of the option that you want to set
112+
@param string option value that you want to set
113+
*/
114+
115+
116+
public function system_config_set($session_id, $section, $key, $value) {
117+
global $app;
118+
if(!$this->checkPerm($session_id, 'system_config_set')) {
119+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
120+
return false;
121+
}
122+
if ($section != '' && $key != '') {
123+
$app->uses('remoting_lib,getconf,ini_parser');
124+
$system_config_array = $app->getconf->get_global_config();
125+
$system_config_array[$section][$key] = $value;
126+
$system_config_str = $app->ini_parser->get_ini_string($system_config_array);
127+
$app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1);
128+
} else {
129+
throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.');
130+
return false;
131+
}
132+
}
133+
106134

107135
}
108136

interface/lib/classes/remote.d/server.inc.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,34 @@ public function server_get($session_id, $server_id = null, $section ='') {
142142
}
143143
}
144144

145+
/**
146+
Set a value in the server configuration
147+
@param int session id
148+
@param int server id
149+
@param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
150+
@param string key of the option that you want to set
151+
@param string option value that you want to set
152+
*/
153+
154+
155+
public function server_config_set($session_id, $server_id, $section, $key, $value) {
156+
global $app;
157+
if(!$this->checkPerm($session_id, 'server_config_set')) {
158+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
159+
return false;
160+
}
161+
if (!empty($server_id) && $server_id > 0 && $section != '' && $key != '') {
162+
$app->uses('remoting_lib,getconf,ini_parser');
163+
$server_config_array = $app->getconf->get_server_config($server_id);
164+
$server_config_array[$section][$key] = $value;
165+
$server_config_str = $app->ini_parser->get_ini_string($server_config_array);
166+
$app->db->datalogUpdate('server', array("config" => $server_config_str), 'server_id', $server_id);
167+
} else {
168+
throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.');
169+
return false;
170+
}
171+
}
172+
145173
/**
146174
Gets a list of all servers
147175
@param int session_id

interface/web/admin/form/filesync.tform.php

Lines changed: 0 additions & 205 deletions
This file was deleted.

interface/web/admin/form/server_config.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,12 @@
391391
'default' => 'y',
392392
'value' => array(0 => 'n', 1 => 'y')
393393
),
394+
'migration_mode' => array(
395+
'datatype' => 'VARCHAR',
396+
'formtype' => 'CHECKBOX',
397+
'default' => 'n',
398+
'value' => array(0 => 'n', 1 => 'y')
399+
),
394400
//#################################
395401
// ENDE Datatable fields
396402
//#################################

interface/web/admin/lib/lang/ar_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,5 @@ $wb['xmpp_port_pastebin_txt'] = 'Pastebin';
282282
$wb['xmpp_port_bosh_txt'] = 'BOSH';
283283
$wb['backup_time_txt'] = 'Backup time';
284284
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
285+
$wb['migration_mode_txt'] = 'Server Migration Mode';
285286
?>

interface/web/admin/lib/lang/bg_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,5 @@ $wb['xmpp_port_pastebin_txt'] = 'Pastebin';
282282
$wb['xmpp_port_bosh_txt'] = 'BOSH';
283283
$wb['backup_time_txt'] = 'Backup time';
284284
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
285+
$wb['migration_mode_txt'] = 'Server Migration Mode';
285286
?>

interface/web/admin/lib/lang/br_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,5 @@ $wb['xmpp_port_pastebin_txt'] = 'Pastebin';
282282
$wb['xmpp_port_bosh_txt'] = 'BOSH';
283283
$wb['backup_time_txt'] = 'Hora do backup';
284284
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
285+
$wb['migration_mode_txt'] = 'Server Migration Mode';
285286
?>

interface/web/admin/lib/lang/ca_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,5 @@ $wb['disable_bind_log_txt'] = 'Disable bind9 messages for Loglevel WARN';
282282
$wb['apps_vhost_enabled_txt'] = 'Apps-vhost enabled';
283283
$wb['backup_time_txt'] = 'Backup time';
284284
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
285+
$wb['migration_mode_txt'] = 'Server Migration Mode';
285286
?>

interface/web/admin/lib/lang/cz_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,5 @@ $wb['hostname_error_empty'] = 'Název hostitele je prázdný';
282282
$wb['hostname_error_regex'] = 'Neplatný název hostitele.';
283283
$wb['backup_time_txt'] = 'Spustit zálohovaní v';
284284
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
285+
$wb['migration_mode_txt'] = 'Server Migration Mode';
285286
?>

0 commit comments

Comments
 (0)