From 68c7e606d6aaf17a6ac53da27afa23920c2febe8 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Sun, 26 Jun 2011 17:00:25 +0200 Subject: [PATCH] bacula-web: Added connection options and fixed typo in php code --- gui/bacula-web/includes/bweb.inc.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index e14ed2eb66..d5918c6fcd 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -44,7 +44,8 @@ class Bweb extends DB $dsn = $this->bwcfg->Get_Dsn( 0 ); // Connect to the database - $this->db_link = $this->connect( $dsn ); + $options = array( 'portability' => DB_PORTABILITY_ALL ); + $this->db_link = $this->connect( $dsn, $options ); if (DB::isError($this->db_link)) { die( 'Unable to connect to catalog
' . $this->db_link->getMessage()); @@ -421,13 +422,10 @@ class Bweb extends DB } } // end function GetJobsStatistics() - public function CountVolumesByPool( $pools ) + public function CountVolumesByPool( $pool_id ) { foreach( $pools as $pool_name => $pool ) { - //var_dump( $pool ); - $query = "SELECT COUNT(*) AS nb_vol FROM Media WHERE PoolId = '$pool'"; - //echo $query . '
'; - //echo 'Pool name ' . $pool_name . '
'; + $query = "SELECT COUNT(*) AS nb_vol FROM Media WHERE PoolId = '$pool_id'"; $result = $this->db_link->query( $query ); if( PEAR::isError( $result ) ) { -- 2.39.5