<?vsp 
--  
--  $Id$
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2018 OpenLink Software
--  
--  This project is free software; you can redistribute it and/or modify it
--  under the terms of the GNU General Public License as published by the
--  Free Software Foundation; only version 2 of the License, dated June 1991.
--  
--  This program is distributed in the hope that it will be useful, but
--  WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
--  General Public License for more details.
--  
--  You should have received a copy of the GNU General Public License along
--  with this program; if not, write to the Free Software Foundation, Inc.,
--  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--  
--  


  declare res integer;
  declare op varchar;

  op := atoi ({?'op'});
  res := 0;

  if (op = 1)
    res := Unrestricted::ret_1 ();

  if (op = 2)
    res := Unrestricted::write_file ();

  if (op = 3)
    res := Unrestricted::get_prop ();

?>
<html>
 <HEAD>
 <link rel="stylesheet" type="text/css" href="../demo.css" />
  <STYLE>
  .filelist {
    font-family: Tahoma, sans-serif;
    background-color: #eeeeee;
    color: Black;
    border: 1px #dddddd solid;
  }
  </STYLE>
  </HEAD>
 <body>
  <H4>JAVA HOSTING SECURITY SAMPLE.</H4>
  This samples shows importing classes without restrictions. <BR />
  The created types can access file system and sytem variables. <BR />
  See Unrestricted.java for more details. <BR />
  <form method=post action="<?=http_path()?>">
  <table class="tableentry">
  <tr>
    <td>Choose Method to invoke</td>
    <td>
      <select name="op">
        <option value="1"  <?= case {?'op'} when '1' then 'selected' else '' end ?>>IntegerTest</option>
        <option value="2"  <?= case {?'op'} when '2' then 'selected' else '' end ?>>FileAccessTest</option>
        <option value="3"  <?= case {?'op'} when '3' then 'selected' else '' end ?>>GetEnvTest</option>
      </select>
    </td>
  </tr>
  <tr>
    <td>Start Call</td>
    <td><input type="submit" name="exec" value="Execute"></td>
  </tr>
  </table>
  </form>
<?vsp if (res <> 0)
  	{
?>
  <table>
       <tr>
	 <td>
	<table class="tableresult">
	  <tr>
	  	<td>Result:</td>
		<td><?=res?></td> </tr>
	</table>
	</td>
	</tr>
  </table>
<?vsp
  	}
?>
 </body>
</html>
