Skip to content
Snippets Groups Projects
Commit 934c7d17 authored by tbrehm's avatar tbrehm
Browse files

Implemented: FS#1260 - Do not ask for port number during updates

- The updater still asks for the port number, but with this update the default number that is shown is read from the vhost file as xaver suggested.
parent 7ed7413f
No related branches found
No related tags found
No related merge requests found
......@@ -271,7 +271,7 @@ swriteln('Updating ISPConfig');
//** Customise the port ISPConfig runs on
$conf['apache']['vhost_port'] = '8080';
$conf['apache']['vhost_port'] = get_ispconfig_port_number();;
$inst->install_ispconfig();
......
......@@ -677,6 +677,26 @@ function compare_ispconfig_version($current,$new) {
}
/*
* Get the port number of the ISPConfig controlpanel vhost
*/
function get_ispconfig_port_number() {
global $conf;
$ispconfig_vhost_file = $conf['apache']['vhost_conf_dir'].'/ispconfig.vhost';
if(is_file($ispconfig_vhost_file)) {
$tmp = file_get_contents($ispconfig_vhost_file);
preg_match('/\<VirtualHost.*\:(\d{1,})\>/',$tmp,$matches);
$port_number = intval($matches[1]);
if($port_number > 0) {
return $port_number;
} else {
return '8080';
}
}
}
?>
......@@ -305,7 +305,8 @@ swriteln('Updating ISPConfig');
//** Customise the port ISPConfig runs on
$conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080');
$ispconfig_port_number = get_ispconfig_port_number();
$conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', $ispconfig_port_number);
$inst->install_ispconfig();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment