- added form to add new froxlor-clients (no deploy etc.)
- implemented function to return all active client-id's for inserttask-function (task for all clients+master)
This commit is contained in:
@@ -102,6 +102,25 @@ class froxlorclient
|
||||
return self::$clients[$_cid];
|
||||
}
|
||||
|
||||
/**
|
||||
* return an array of enabled froxlor-client ids
|
||||
*
|
||||
* @param resource mysql-object
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static public function getFroxlorClients($_db = null)
|
||||
{
|
||||
$sql = "SELECT `id` FROM `".TABLE_FROXLOR_CLIENTS."` WHERE `enabled` = '1';";
|
||||
$res = $_db->query($sql);
|
||||
$result = array();
|
||||
while($_r = mysql_fetch_array($res))
|
||||
{
|
||||
$result[] = $_r['id'];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This functions deploys the needed files
|
||||
* to the client destination server
|
||||
@@ -151,6 +170,22 @@ class froxlorclient
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert new client to database
|
||||
*/
|
||||
public function Insert()
|
||||
{
|
||||
$this->db->query("INSERT INTO
|
||||
`" . TABLE_FROXLOR_CLIENTS . "`
|
||||
SET
|
||||
`name` = '" . $this->db->escape($this->Get('name')) . "',
|
||||
`desc` = '" . $this->db->escape($this->Get('desc')) . "',
|
||||
`enabled` = '" . (int)$this->Get('enabled') . "';
|
||||
");
|
||||
$this->cid = $this->db->insert_id();
|
||||
return $this->cid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update data in database
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user