Skip to content

Commit 88d899d

Browse files
committed
Better debugging and exit conditions in mysql databse plugin.
1 parent a57e068 commit 88d899d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

install/lib/installer_base.lib.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,10 @@ public function install_ispconfig()
657657
$install_dir = $this->conf['ispconfig_install_dir'];
658658

659659
//* Create the ISPConfig installation directory
660-
$command = "mkdir $install_dir";
661-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
660+
if(!@is_dir($install_dir)) {
661+
$command = "mkdir $install_dir";
662+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
663+
}
662664

663665
//* Create a ISPConfig user and group
664666
$command = 'groupadd ispconfig';
@@ -795,7 +797,7 @@ public function install_ispconfig()
795797
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
796798
//* and create the symlink
797799
if($this->install_ispconfig_interface == true) {
798-
if(!is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) {
800+
if(!@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) {
799801
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/ispconfig.vhost");
800802
}
801803
}

server/plugins-available/mysql_clientdb_plugin.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function db_update($event_name,$data) {
105105
$link = mysql_connect($clientdb_host, $clientdb_user, $clientdb_password);
106106
if (!$link) {
107107
$app->log('Unable to connect to the database'.mysql_error($link),LOGLEVEL_ERROR);
108+
return;
108109
}
109110

110111
//* Rename User
@@ -164,6 +165,7 @@ function db_delete($event_name,$data) {
164165
$link = mysql_connect($clientdb_host, $clientdb_user, $clientdb_password);
165166
if (!$link) {
166167
$app->log('Unable to connect to the database'.mysql_error($link),LOGLEVEL_ERROR);
168+
return;
167169
}
168170

169171
//* Get the db host setting for the access priveliges

0 commit comments

Comments
 (0)