Skip to content

Commit ac4a37d

Browse files
committed
- Fixes in the installer.
1 parent a768b9f commit ac4a37d

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

install/install.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
}
279279

280280
//** Configure ISPConfig :-)
281-
if(strtolower($inst->simple_query('Install ISPConfig',array('y','n'),'y')) == 'y') {
281+
if(strtolower($inst->simple_query('Install ISPConfig Web-Interface',array('y','n'),'y')) == 'y') {
282282
swriteln('Installing ISPConfig');
283283

284284
//** We want to check if the server is a module or cgi based php enabled server
@@ -296,17 +296,23 @@
296296
*/
297297

298298
//** Customise the port ISPConfig runs on
299-
$inst->conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080');
299+
$conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080');
300300

301-
302-
$inst->install_ispconfig();
303-
304-
//* Configure ISPConfig
305-
swriteln('Installing Crontab');
306-
$inst->install_crontab();
307-
system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
301+
$inst->install_ispconfig_interface = true;
302+
303+
} else {
304+
$inst->install_ispconfig_interface = false;
308305
}
309306

307+
$inst->install_ispconfig();
308+
309+
//* Configure ISPConfig
310+
swriteln('Installing Crontab');
311+
$inst->install_crontab();
312+
system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
313+
314+
315+
310316
} //* << $install_mode / 'Standard' or Genius
311317

312318

install/lib/installer_base.lib.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class installer_base {
3434
var $language = 'en';
3535
var $db;
3636
public $conf;
37+
public install_ispconfig_interface = true;
3738

3839

3940
public function __construct()
@@ -148,9 +149,15 @@ public function add_database_server_record() {
148149
global $conf;
149150
$cf = $conf['mysql']; // make $conf['mysql'] more accessible
150151

152+
if($cf['host'] == 'localhost') {
153+
$from_host = 'localhost';
154+
} else {
155+
$from_host = $inst->conf['hostname'];
156+
}
157+
151158
//* Create the ISPConfig database user
152159
$query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON '.$cf['database'].".* "
153-
."TO '".$cf['ispconfig_user']."'@'".$cf['host']."' "
160+
."TO '".$cf['ispconfig_user']."'@'".$from_host."' "
154161
."IDENTIFIED BY '".$cf['ispconfig_password']."';";
155162
if(!$this->db->query($query)) {
156163
$this->error('Unable to create database user: '.$cf['ispconfig_user']);
@@ -729,8 +736,10 @@ public function install_ispconfig()
729736

730737
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
731738
//* and create the symlink
732-
if(!is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) {
733-
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/ispconfig.vhost");
739+
if($this->install_ispconfig_interface == true) {
740+
if(!is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) {
741+
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/ispconfig.vhost");
742+
}
734743
}
735744

736745
// Make the Clamav log files readable by ISPConfig

0 commit comments

Comments
 (0)