From 097f8c54261d90a44ee2935f1f9de3ff95b55684 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Sat, 23 Jul 2011 10:52:45 +0200 Subject: [PATCH] bacula-web: New getClientInfos() function in bweb class --- gui/bacula-web/includes/bweb.inc.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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; -- 2.39.5