Commit c1d4814e authored by Florian Schaal's avatar Florian Schaal
Browse files

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 { ...@@ -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; global $app;
if(!$this->checkPerm($session_id, 'server_get')) { if(!$this->checkPerm($session_id, 'server_get')) {
...@@ -244,7 +244,13 @@ class remoting_server extends remoting { ...@@ -244,7 +244,13 @@ class remoting_server extends remoting {
return false; return false;
} }
if (!empty($session_id)) { 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; return $ispc_app_version;
} else { } else {
return false; 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