From: Davide Franco Date: Sun, 26 Jun 2011 15:00:25 +0000 (+0200) Subject: bacula-web: Added connection options and fixed typo in php code X-Git-Tag: Release-5.2.1~273 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=86d41dfeaa17ee2f5bee7ea86da2599185301ccb;p=bacula%2Fbacula bacula-web: Added connection options and fixed typo in php code --- 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 ) ) {