Commit c1d4814e authored by Florian Schaal's avatar Florian Schaal

extend remote-function server_get_app_version to fetch $ispc_app_version from slave-server

parent edbf14ec
......@@ -236,7 +236,7 @@ class remoting_server extends remoting {
}
}
public function server_get_app_version($session_id)
public function server_get_app_version($session_id, $server_id = 0)
{
global $app;
if(!$this->checkPerm($session_id, 'server_get')) {
......@@ -244,7 +244,13 @@ class remoting_server extends remoting {
return false;
}
if (!empty($session_id)) {
$ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION);
if($server_id === 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION);
else {
$rec = $app->db->queryOneRecord("SELECT data FROM monitor_data WHERE type = 'ispc_info' AND server_id = ?", $server_id);
$rec = unserialize($rec['data']);
$ispc_app_version = array('ispc_app_version' => $rec['version']);
unset($rec);
}
return $ispc_app_version;
} else {
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment