]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: New getClientInfos() function in bweb class
authorDavide Franco <bacula-dev@dflc.ch>
Sat, 23 Jul 2011 08:52:45 +0000 (10:52 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:26 +0000 (14:49 +0200)
gui/bacula-web/includes/bweb.inc.php

index d2b8063e808fb5da18bfc6b97e706e4aa68c6c1a..de0580b30461cd0e8b51dfe1da4602aefb42d578 100644 (file)
@@ -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;