function get_returns($sid, $hash, $pass) { if (!authorize_WS($pass)) { return false; } $session = TestSession::from_property(array("id" => $sid, "hash" => $hash), false); if ($session == null) { return false; } $return = TestSessionReturn::from_property(array("TestSession_id" => $sid)); $result = array(); foreach ($return as $ret) { $result[$ret->name] = $ret->value; } return json_encode($result); }
function get_returns($sid, $hash, $pass, $wid) { if (!authorize_WS($pass)) { return -1; } $workspace = UserWorkspace::from_mysql_id($wid); if ($workspace != null) { mysql_select_db($workspace->db_name); } $session = TestSession::from_property(array("id" => $sid, "hash" => $hash), false); if ($session == null) { return false; } $return = TestSessionReturn::from_property(array("TestSession_id" => $sid)); $result = array(); foreach ($return as $ret) { $result[$ret->name] = $ret->value; } return json_encode($result); }