From 06183776d0397bc3126a85d0b9380600dadf7972 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 12 Jul 2017 18:37:39 +0200 Subject: [baseconfig_partitions_cdn] Fix warning --- .../baseconfig/getconfig.inc.php | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/modules-available/baseconfig_partitions_cdn/baseconfig/getconfig.inc.php b/modules-available/baseconfig_partitions_cdn/baseconfig/getconfig.inc.php index 6348fe71..20efdcb1 100644 --- a/modules-available/baseconfig_partitions_cdn/baseconfig/getconfig.inc.php +++ b/modules-available/baseconfig_partitions_cdn/baseconfig/getconfig.inc.php @@ -1,17 +1,19 @@ $_GET['user'])); -while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $config .= "\n" . $row['partition_id'] . "," . $row['size']; - if(strlen($row['mount_point']) > 0) - $config .= "," . $row['mount_point']; - if(strlen($row['options']) > 0) - $config .= "," . $row['options']; -} -$config .= "\n"; +if (isset($_GET['user'])) { + $config = ''; + $res = Database::simpleQuery('SELECT partition_id, size, mount_point, options FROM setting_partition WHERE user = :user', + array('user' => $_GET['user'])); + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $config .= "\n" . $row['partition_id'] . "," . $row['size']; + if (strlen($row['mount_point']) > 0) + $config .= "," . $row['mount_point']; + if (strlen($row['options']) > 0) + $config .= "," . $row['options']; + } + $config .= "\n"; // vm list url. doesn't really fit anywhere, seems to be a tie between here and dozmod -$configVars["SLX_PARTITION_TABLE"] = $config; -unset($config); \ No newline at end of file + $configVars["SLX_PARTITION_TABLE"] = $config; + unset($config); +} -- cgit v1.2.3-55-g7522