| | |
| | | |
| | | //* Update $conf array with values from the server.ini that shall be preserved |
| | | $tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | |
| | | $conf['services']['mail'] = ($tmp['mail_server'] == 1)?true:false; |
| | | $conf['services']['web'] = ($tmp['web_server'] == 1)?true:false; |
| | |
| | | $conf['services']['file'] = ($tmp['file_server'] == 1)?true:false; |
| | | $conf['services']['db'] = ($tmp['db_server'] == 1)?true:false; |
| | | $conf['services']['vserver'] = ($tmp['vserver_server'] == 1)?true:false; |
| | | $conf['postfix']['vmail_mailbox_base'] = $ini_array['mail']['homedir_path']; |
| | | |
| | | //** Delete the old database |
| | | if( !$inst->db->query('DROP DATABASE IF EXISTS '.$conf['mysql']['database']) ) { |
| | |
| | | unset($new_ini); |
| | | |
| | | |
| | | //** Update system ini |
| | | $tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM sys_ini WHERE sysini_id = 1"); |
| | | $old_ini_array = ini_to_array(stripslashes($tmp_server_rec['config'])); |
| | | unset($tmp_server_rec); |
| | | $tpl_ini_array = ini_to_array(rf('tpl/system.ini.master')); |
| | | |
| | | // update the new template with the old values |
| | | if(is_array($old_ini_array)) { |
| | | foreach($old_ini_array as $tmp_section_name => $tmp_section_content) { |
| | | foreach($tmp_section_content as $tmp_var_name => $tmp_var_content) { |
| | | $tpl_ini_array[$tmp_section_name][$tmp_var_name] = $tmp_var_content; |
| | | } |
| | | } |
| | | } |
| | | |
| | | $new_ini = array_to_ini($tpl_ini_array); |
| | | $inst->db->query("UPDATE sys_ini SET config = '".mysql_real_escape_string($new_ini)."' WHERE sysini_id = 1"); |
| | | unset($old_ini_array); |
| | | unset($tpl_ini_array); |
| | | unset($new_ini); |
| | | |
| | | |
| | | //** Shall the services be reconfigured during update |
| | | $reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes','no'),'yes'); |
| | | |