3 * Bacula® - The Network Backup Solution
4 * Baculum - Bacula web interface
6 * Copyright (C) 2013-2015 Marcin Haba
8 * The main author of Baculum is Marcin Haba.
9 * The main author of Bacula is Kern Sibbald, with contributions from many
10 * others, a complete list can be found in the file AUTHORS.
12 * You may use this file and others of this release according to the
13 * license defined in the LICENSE file, which includes the Affero General
14 * Public License, v3.0 ("AGPLv3") and some additional permissions and
15 * terms pursuant to its AGPLv3 Section 7.
17 * Bacula® is a registered trademark of Kern Sibbald.
27 * "clientid": client ID,
28 * "name": "client name",
29 * "uname": "client name and environment (uname -a)",
30 * "autoprune": 0 for disabled, 1 for enabled,
31 * "fileretention": file retention period in seconds,
32 * "jobretention": job retention period in seconds,
35 * "clientid": client ID,
36 * "name": "client name",
37 * "uname": "client name and environment (uname -a)",
38 * "autoprune": 0 for disabled, 1 for enabled,
39 * "fileretention": file retention period in seconds,
40 * "jobretention": job retention period in seconds,
44 * "error": 0 for no errors, 1 for error
48 class Clients extends BaculumAPI {
50 public function get() {
51 $limit = intval($this->Request['limit']);
52 $clients = $this->getModule('client')->getClients($limit);
53 $allowedClients = $this->getModule('bconsole')->bconsoleCommand($this->director, array('.client'), $this->user)->output;
54 $clientsOutput = array();
55 foreach($clients as $client) {
56 if(in_array($client->name, $allowedClients)) {
57 $clientsOutput[] = $client;
60 $this->output = $clientsOutput;
61 $this->error = ClientError::ERROR_NO_ERRORS;