From dd0130670fe3cab4c7e2c1ab4f3bf0d2b2d512b0 Mon Sep 17 00:00:00 2001 From: Denny Bortfeldt <denny@bortfeldt.net> Date: Mon, 27 Jun 2016 18:02:16 -0400 Subject: [PATCH] When uploading a logo which is smaller than the current ispconfig one, then the logo will be on the left side of the header. In my opinion it will look better when it's centered. You could vote about it ;) --- server/lib/classes/db_mysql.inc.php | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php index e3d0c69..7c46820 100644 --- a/server/lib/classes/db_mysql.inc.php +++ b/server/lib/classes/db_mysql.inc.php @@ -554,21 +554,24 @@ public function getDatabaseSize($database_name) { global $app; + include 'lib/mysql_clientdb.conf'; + /* Connect to the database */ $link = mysqli_connect($clientdb_host, $clientdb_user, $clientdb_password); if (!$link) { - $app->log('Unable to connect to the database'.mysqli_error($link), LOGLEVEL_DEBUG); + $app->log('Unable to connect to the database'.mysqli_connect_error(), LOGLEVEL_DEBUG); return; } + /* Get database-size from information_schema */ - $result=mysqli_query("SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='".mysqli_real_escape_string($database_name)."';", $link); - $this->close; - if (!$result) { - $app->log('Unable to get the database-size'.mysqli_error($link), LOGLEVEL_DEBUG); + $result = mysqli_query($link, "SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='".mysqli_real_escape_string($link, $database_name)."'"); + if(!$result) { + $app->log('Unable to get the database-size for ' . $database_name . ': '.mysqli_error($link), LOGLEVEL_DEBUG); return; } $database_size = mysqli_fetch_row($result); + mysqli_close($link); return $database_size[0]; } -- Gitblit v1.9.1