From: Davide Franco Date: Sat, 23 Jul 2011 08:52:45 +0000 (+0200) Subject: bacula-web: New getClientInfos() function in bweb class X-Git-Tag: Release-5.2.1~144 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=54580053651b94401e7fb057f658e2fea73c9ed7;p=bacula%2Fbacula bacula-web: New getClientInfos() function in bweb class --- diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index d2b8063e80..de0580b304 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -381,6 +381,30 @@ class Bweb return $clients; } + public function getClientInfos( $client_id ) + { + $client = array(); + $result = ''; + $query = "SELECT name,uname FROM Client WHERE clientid = '$client_id'"; + + try { + $result = $this->db_link->runQuery($query); + + foreach( $result->fetchAll() as $client ) { + $uname = split( ' ', $client['uname'] ); + $client['version'] = $uname[0]; + + $uname = split( ',', $uname[2] ); + $client['arch'] = $uname[0]; + $client['os'] = $uname[1]; + } + }catch(PDOException $e) { + CDBError::raiseError($e); + } + + return $client; + } + public function countVolumes( $pool_id = 'ALL' ) { $result = null;