|
307 | 307 | //** Check for current service config state and compare to our results |
308 | 308 | if ($conf['mysql']['master_slave_setup'] == 'y') $current_svc_config = $inst->dbmaster->queryOneRecord("SELECT mail_server,web_server,dns_server,xmpp_server,firewall_server,vserver_server,db_server FROM ?? WHERE server_id=?", $conf['mysql']['master_database'] . '.server', $conf['server_id']); |
309 | 309 | else $current_svc_config = $inst->db->queryOneRecord("SELECT mail_server,web_server,dns_server,xmpp_server,firewall_server,vserver_server,db_server FROM ?? WHERE server_id=?", $conf["mysql"]["database"] . '.server', $conf['server_id']); |
310 | | -$conf['postfix']['installed'] = check_service_config_state('mail_server', $conf['postfix']['installed']); |
| 310 | +$conf['services']['mail'] = check_service_config_state('mail_server', $conf['postfix']['installed']); |
311 | 311 | $conf['services']['dns'] = check_service_config_state('dns_server', ($conf['powerdns']['installed'] || $conf['bind']['installed'] || $conf['mydns']['installed'])); |
312 | 312 | $conf['services']['web'] = check_service_config_state('web_server', ($conf['apache']['installed'] || $conf['nginx']['installed'])); |
313 | 313 | $conf['services']['xmpp'] = check_service_config_state('xmpp_server', $conf['xmpp']['installed']); |
|
316 | 316 | $conf['services']['db'] = check_service_config_state('db_server', true); /* Will always offer as MySQL is of course installed on this host as it's a requirement for ISPC to work... */ |
317 | 317 | unset($current_svc_config); |
318 | 318 |
|
| 319 | +//** Write new decisions into DB |
| 320 | +$sql = "UPDATE ?? SET mail_server = '{$conf['services']['mail']}', web_server = '{$conf['services']['web']}', dns_server = '{$conf['services']['dns']}', file_server = '{$conf['services']['file']}', db_server = '{$conf['services']['db']}', vserver_server = '{$conf['services']['vserver']}', proxy_server = '{$conf['services']['proxy']}', firewall_server = '$firewall_server_enabled', xmpp_server = '$xmpp_server_enabled' WHERE server_id = ?"; |
| 321 | +$inst->db->query($sql, $conf['mysql']['database'].'.server', $conf['server_id']); |
| 322 | +if($conf['mysql']['master_slave_setup'] == 'y') { |
| 323 | + $inst->dbmaster->query($sql, $conf['mysql']['master_database'].'.server', $conf['server_id']); |
| 324 | +} |
| 325 | + |
| 326 | +//** Is the ISPConfg Panel installed on this host? This might partially override user's preferences later. |
| 327 | +if($conf['apache']['installed'] == true){ |
| 328 | + if(!is_file($conf['apache']['vhost_conf_dir'].'/ispconfig.vhost')) $inst->install_ispconfig_interface = false; |
| 329 | +} |
| 330 | +if($conf['nginx']['installed'] == true){ |
| 331 | + if(!is_file($conf['nginx']['vhost_conf_dir'].'/ispconfig.vhost')) $inst->install_ispconfig_interface = false; |
| 332 | +} |
319 | 333 |
|
320 | 334 | //** Shall the services be reconfigured during update |
321 | 335 | $reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes', 'no', 'selected'), 'yes','reconfigure_services'); |
|
391 | 405 | } |
392 | 406 | } |
393 | 407 |
|
394 | | - if($conf['services']['web']) { |
| 408 | + if($conf['services']['web'] || $inst->install_ispconfig_interface) { |
395 | 409 |
|
396 | 410 | if($conf['pureftpd']['installed'] == true && $inst->reconfigure_app('Pureftpd', $reconfigure_services_answer)) { |
397 | 411 | //** Configure Pureftpd |
|
462 | 476 |
|
463 | 477 | //** Configure ISPConfig |
464 | 478 | swriteln('Updating ISPConfig'); |
465 | | -if($conf['apache']['installed'] == true){ |
466 | | - if(!is_file($conf['apache']['vhost_conf_dir'].'/ispconfig.vhost')) $inst->install_ispconfig_interface = false; |
467 | | -} |
468 | | -if($conf['nginx']['installed'] == true){ |
469 | | - if(!is_file($conf['nginx']['vhost_conf_dir'].'/ispconfig.vhost')) $inst->install_ispconfig_interface = false; |
470 | | -} |
471 | 479 |
|
472 | | -if ($conf['services']['web'] && $inst->install_ispconfig_interface) { |
| 480 | +if ($inst->install_ispconfig_interface) { |
473 | 481 | //** Customise the port ISPConfig runs on |
474 | 482 | $ispconfig_port_number = get_ispconfig_port_number(); |
475 | 483 | if($autoupdate['ispconfig_port'] == 'default') $autoupdate['ispconfig_port'] = $ispconfig_port_number; |
|
517 | 525 | if($conf['dovecot']['installed'] == true && $conf['dovecot']['init_script'] != '') system($inst->getinitcommand($conf['dovecot']['init_script'], 'restart')); |
518 | 526 | if($conf['mailman']['installed'] == true && $conf['mailman']['init_script'] != '') system('nohup '.$inst->getinitcommand($conf['mailman']['init_script'], 'restart').' >/dev/null 2>&1 &'); |
519 | 527 | } |
520 | | - if($conf['services']['web']) { |
| 528 | + if($conf['services']['web'] || $inst->install_ispconfig_interface) { |
521 | 529 | if($conf['webserver']['server_type'] == 'apache' && $conf['apache']['init_script'] != '') system($inst->getinitcommand($conf['apache']['init_script'], 'restart')); |
522 | 530 | //* Reload is enough for nginx |
523 | 531 | if($conf['webserver']['server_type'] == 'nginx'){ |
|
0 commit comments