From cf2eea43c91a8d8306e17ab46a37e1c7f28203d3 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Wed, 20 Nov 2013 14:14:33 +0100 Subject: [PATCH] fix wrong usage of rowCount() Signed-off-by: Michael Kaufmann (d00p) --- admin_domains.php | 2 +- lib/functions/froxlor/function.openRootDB.php | 73 ------------------- 2 files changed, 1 insertion(+), 74 deletions(-) delete mode 100644 lib/functions/froxlor/function.openRootDB.php diff --git a/admin_domains.php b/admin_domains.php index 871ecf12..e8951e42 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -222,7 +222,7 @@ if ($page == 'domains' WHERE `id` = :id OR `parentdomainid` = :id ".$rsd_sql ); Database::pexecute($del_stmt, array('id' => $id)); - $deleted_domains = Database::rowCount(); + $deleted_domains = $del_stmt->rowCount(); $upd_stmt = Database::prepare(" UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET diff --git a/lib/functions/froxlor/function.openRootDB.php b/lib/functions/froxlor/function.openRootDB.php deleted file mode 100644 index 7e14efe7..00000000 --- a/lib/functions/froxlor/function.openRootDB.php +++ /dev/null @@ -1,73 +0,0 @@ - (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Functions - * - */ - -/* - * Function openRootDB - * - * creates a mysql-connection as root-user - * and stores it in the global variable $db_root - * - * @param int debugHandler (file-object) - * @param int lockfile (file-object) - * - * @return null - */ -function openRootDB($debugHandler = false, $lockfile = false) -{ - global $db_root, $theme; - - require dirname(dirname(dirname(__FILE__))).'/userdata.inc.php'; - - // Legacy sql-root-information - if(isset($sql['root_user']) && isset($sql['root_password']) && (!isset($sql_root) || !is_array($sql_root))) - { - $sql_root = array(0 => array('caption' => 'Default', 'host' => $sql['host'], 'user' => $sql['root_user'], 'password' => $sql['root_password'])); - unset($sql['root_user']); - unset($sql['root_password']); - } - - $db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], ''); - - if($db_root->link_id == 0) - { - /** - * Do not proceed further if no database connection could be established - */ - if(isset($debugHandler) && $debugHandler !== false) - { - fclose($debugHandler); - } - if(isset($lockfile) && $lockfile !== false) - { - unlink($lockfile); - } - die('root can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...'); - } - - if(isset($debugHandler) && $debugHandler !== false) - { - fwrite($debugHandler, 'Database-rootconnection established' . "\n"); - } - - unset($sql); -} - -function closeRootDB() -{ - global $db_root, $theme; - if(isset($db_root)) unset($db_root); -}