few minor changes for multiserver-support

This commit is contained in:
Michael Kaufmann (d00p)
2010-10-18 11:34:19 +00:00
parent 8d27f71cee
commit f42fa0ee7b
6 changed files with 72 additions and 12 deletions

View File

@@ -52,6 +52,12 @@ class froxlorclient
*/
private $c_data = array();
/**
* Client Settings_Data Array
* @var s_data
*/
private $s_data = array();
/**
* Client-Object-Array
* @var clients
@@ -154,7 +160,7 @@ class froxlorclient
`" . TABLE_FROXLOR_CLIENTS . "`
SET
`name` = '" . $this->db->escape($this->Get('name')) . "',
`ip` = '" . $this->db->escape($this->Get('ip')) . "',
`desc` = '" . $this->db->escape($this->Get('desc')) . "',
`enabled` = '" . (int)$this->Get('enabled') . "'
WHERE
`id` = '" . (int)$this->cid . "';
@@ -194,6 +200,24 @@ class froxlorclient
return true;
}
/**
* return the complete client-settings array
* for the settings page
*/
public function getSettingsArray()
{
return $this->Get('settings');
}
/**
* return the complete client-settings-data array
* for the settings page
*/
public function getSettingsData()
{
return $this->s_data;
}
/**
* get a value from the internal data array
*
@@ -338,11 +362,11 @@ class froxlorclient
&& $this->cid != - 1
) {
$spath = makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__)))));
$settings_data = loadConfigArrayDir(
$this->s_data = loadConfigArrayDir(
makeCorrectDir($spath.'/actions/admin/settings/'),
makeCorrectDir($spath.'/actions/multiserver/clientsettings/')
);
$settings = loadSettings($settings_data, $db, $this->cid);
$settings = loadSettings($this->s_data, $db, $this->cid);
foreach($settings as $group => $fv)
{

View File

@@ -20,9 +20,6 @@
function saveSetting($settinggroup, $varname, $newvalue)
{
global $db;
// multi-server-support, get the destination server id (master = 0)
$server_id = getServerId();
$query = 'UPDATE
`' . TABLE_PANEL_SETTINGS . '`
@@ -31,8 +28,13 @@ function saveSetting($settinggroup, $varname, $newvalue)
WHERE
`settinggroup` = \'' . $db->escape($settinggroup) . '\'
AND
`varname`=\'' . $db->escape($varname) . '\'
`varname`=\'' . $db->escape($varname) . '\' ';
/*
*
* @TODO for multiserver
*
AND
`sid`=\''. (int)$server_id . '\' ';
*/
return $db->query($query);
}

View File

@@ -72,7 +72,7 @@ define('PACKAGE_ENABLED', 2);
// VERSION INFO
$version = '0.9.14-svn8';
$version = '0.9.14-svn9';
$dbversion = '2';
$branding = '';