From 04012e5fff40974391d48625249f0454c4bc2df3 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Wed, 6 Nov 2013 11:08:48 +0100 Subject: [PATCH] more fixes for migration to PDO, refs #1287 Signed-off-by: Michael Kaufmann (d00p) --- admin_customers.php | 4 ++-- admin_index.php | 11 +++-------- admin_phpsettings.php | 6 ++---- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/admin_customers.php b/admin_customers.php index 58dbd5b7..5636e2fc 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -394,11 +394,11 @@ if ($page == 'customers' /* * move old tickets to archive */ - $tickets = ticket::customerHasTickets($db, $id); + $tickets = ticket::customerHasTickets($id); if ($tickets !== false && isset($tickets[0])) { foreach ($tickets as $ticket) { $now = time(); - $mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$ticket); + $mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$ticket); $mainticket->Set('lastchange', $now, true, true); $mainticket->Set('lastreplier', '1', true, true); $mainticket->Set('status', '3', true, true); diff --git a/admin_index.php b/admin_index.php index 1ece7ed7..20f1bc9e 100644 --- a/admin_index.php +++ b/admin_index.php @@ -18,10 +18,6 @@ */ define('AREA', 'admin'); - -/** - * Include our init.php, which manages Sessions, Language etc. - */ require ("./lib/init.php"); if ($action == 'logout') { @@ -71,8 +67,7 @@ if ($page == 'overview') { SUM(`traffic_used`) AS `traffic_used`, SUM(`aps_packages_used`) AS `aps_packages_used` FROM `" . TABLE_PANEL_CUSTOMERS . "`" . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid ")); - Database::pexecute($overview_stmt, array('adminid' => $userinfo['adminid'])); - $overview = $overview_stmt->fetch(PDO::FETCH_ASSOC); + $overview = Database::pexecute_first($overview_stmt, array('adminid' => $userinfo['adminid'])); $overview['traffic_used'] = round($overview['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']); $overview['diskspace_used'] = round($overview['diskspace_used'] / 1024, $settings['panel']['decimal_places']); @@ -81,8 +76,8 @@ if ($page == 'overview') { SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :adminid") ); - Database::pexecute($number_domains_stmt, array('adminid' => $userinfo['adminid'])); - $number_domains = $number_domains_stmt->fetch(PDO::FETCH_ASSOC); + $number_domains = Database::pexecute_first($number_domains_stmt, array('adminid' => $userinfo['adminid'])); + $overview['number_domains'] = $number_domains['number_domains']; $phpversion = phpversion(); diff --git a/admin_phpsettings.php b/admin_phpsettings.php index 5aa6527e..a3f1949f 100644 --- a/admin_phpsettings.php +++ b/admin_phpsettings.php @@ -148,8 +148,7 @@ if ($page == 'overview') { $result_stmt = Database::prepare(" SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id" ); - Database::pexecute($result_stmt, array('id' => $id)); - $result = $result_stmt->fetch(PDO::FETCH_ASSOC); + $result = Database::pexecute_first($result_stmt, array('id' => $id)); if ($result['id'] != 0 && $result['id'] == $id @@ -190,8 +189,7 @@ if ($page == 'overview') { $result_stmt = Database::prepare(" SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id" ); - Database::pexecute($result_stmt, array('id' => $id)); - $result = $result_stmt->fetch(PDO::FETCH_ASSOC); + $result = Database::pexecute_first($result_stmt, array('id' => $id)); if ($result['id'] != 0 && $result['id'] == $id