From 682defcbcfce7e3456c1f52d9767f95c0b2bf352 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 13 Dec 2013 08:07:52 +0100 Subject: [PATCH 1/2] fix tiny sql-query error when using APS and correct DbManager-replacers Signed-off-by: Michael Kaufmann (d00p) --- admin_customers.php | 4 ++-- lib/classes/database/manager/class.DbManagerMySQL.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin_customers.php b/admin_customers.php index 9561a4fe..0cfa98e6 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -300,7 +300,7 @@ if ($page == 'customers' DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `type` = '2' AND `data` LIKE :loginname" ); - Database::pexecute($del_stmt, array(':loginname' => "%:{$result['loginname']};%")); + Database::pexecute($del_stmt, array('loginname' => "%:{$result['loginname']};%")); // remove everything APS-related, #216 $apsresult_stmt = Database::prepare("SELECT `ID` FROM `".TABLE_APS_INSTANCES."` WHERE `CustomerID` = :id"); @@ -315,7 +315,7 @@ if ($page == 'customers' Database::pexecute($del_stmt, array('iid' => $apsrow['ID'])); } // now remove all user instances - $stmt = Database::prepare("DELETE FROM `".TABLE_APS_INSTANCES."` WHERE `CustomerID` = :id'"); + $stmt = Database::prepare("DELETE FROM `".TABLE_APS_INSTANCES."` WHERE `CustomerID` = :id"); Database::pexecute($stmt, array('id' => $id)); // eventually some temp-setting-leftovers $stmt = Database::prepare("DELETE FROM `".TABLE_APS_TEMP_SETTINGS."` WHERE `CustomerID` = :id"); diff --git a/lib/classes/database/manager/class.DbManagerMySQL.php b/lib/classes/database/manager/class.DbManagerMySQL.php index 08bf554b..ddf2cb5c 100644 --- a/lib/classes/database/manager/class.DbManagerMySQL.php +++ b/lib/classes/database/manager/class.DbManagerMySQL.php @@ -106,7 +106,7 @@ class DbManagerMySQL { while ($host = $host_res_stmt->fetch(PDO::FETCH_ASSOC)) { // as of MySQL 5.0.2 this also revokes privileges. (requires MySQL 4.1.2+) $drop_stmt = Database::prepare("DROP USER :dbname@:host"); - Database::pexecute($drop_stmt, array(':dbname' => $dbname, ':host' => $host['Host']), false); + Database::pexecute($drop_stmt, array('dbname' => $dbname, 'host' => $host['Host']), false); } $drop_stmt = Database::prepare("DROP DATABASE IF EXISTS `".$dbname."`"); From 83b615bc377870a45353f163d8724c619f95219f Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 13 Dec 2013 08:14:01 +0100 Subject: [PATCH 2/2] why easy if you could do it the hard way? :P Signed-off-by: Michael Kaufmann (d00p) --- admin_index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_index.php b/admin_index.php index 85801d35..3bec79ca 100644 --- a/admin_index.php +++ b/admin_index.php @@ -364,7 +364,7 @@ if ($page == 'overview') { $mail_body .= "-------------------------------------------------------------\n\n"; $mail_body .= "Froxlor-version: ".$version."\n\n"; $mail_body .= "End of report"; - $mail_html = str_replace("\n", "
", $mail_body); + $mail_html = nl2br($mail_body); // send actual report to dev-team if (isset($_POST['send'])