plugin_applet.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once '../../main/inc/global.inc.php';
  4. $plugin = new AppPlugin();
  5. $pluginList = $plugin->get_installed_plugins();
  6. $capturePluginInstalled = in_array('jcapture', $pluginList);
  7. if (!$capturePluginInstalled) {
  8. exit;
  9. }
  10. $capturePath = api_get_path(WEB_PLUGIN_PATH).'jcapture/';
  11. $hostName = api_get_path(WEB_PATH);
  12. define('DOKU_BASE', '/tmp');
  13. function getSecurityToken() {};
  14. //close sesseion
  15. session_write_close();
  16. header('Content-Type: text/html; charset=utf-8');
  17. $imageFormat = "PNG";
  18. $cookies = null;
  19. foreach (array_keys($_COOKIE) as $cookieName) {
  20. $cookies.=bin2hex($cookieName)."=".bin2hex($_COOKIE[$cookieName]).";";
  21. }
  22. $pageName = 'file';
  23. $edid = '1';
  24. ?>
  25. <script>
  26. function insertAtCarret() {
  27. location.reload();
  28. }
  29. </script>
  30. <object type="application/x-java-applet">
  31. <param name="ID" value="jCaptureApplet" />
  32. <param name="scriptable" value="true" />
  33. <param name="mayscript" value="true" />
  34. <param name="JAVA_CODEBASE" value="/somenonexistingcodebase" />
  35. <param name="WIDTH" value="1" />
  36. <param name="HEIGHT" value="1" />
  37. <param name="CODE" value="com.hammurapi.jcapture.JCaptureApplet.class" />
  38. <param name="ARCHIVE" value="<?php echo $capturePath; ?>lib/jcapture.jar" />
  39. <param name="NAME" value="jCapture" />
  40. <param name="dokuBase" value="<?php echo bin2hex(DOKU_BASE); ?>" />
  41. <param name="sectok" value="<?php echo getSecurityToken(); ?>" />
  42. <param name="cookies" value="<?php echo $cookies; ?>" />
  43. <param name="pageName" value="<?php echo $pageName; ?>" />
  44. <param name="edid" value="<?php echo $edid; ?>" />
  45. <param name="host" value="<?php echo $hostName; ?>" />
  46. <param name="uploadUrl" value="<?php echo $capturePath.'upload.php'; ?>" />
  47. <param name="scriptable" value="false" />
  48. <param name="pluginspage" value="http://java.sun.com/products/plugin/index.html#download" />
  49. <embed type="application/x-java-applet;jpi-version=1.7.0"
  50. ID = "jCaptureApplet"
  51. scriptable = "true"
  52. mayscript = "true"
  53. JAVA_CODEBASE = "/somenonexistingcodebase"
  54. WIDTH = "1"
  55. HEIGHT = "1"
  56. CODE = "com.hammurapi.jcapture.JCaptureApplet.class"
  57. ARCHIVE = "<?php echo $capturePath; ?>lib/jcapture.jar"
  58. NAME = "jCapture"
  59. dokuBase ="<?php echo bin2hex(DOKU_BASE); ?>"
  60. sectok ="<?php echo getSecurityToken(); ?>"
  61. cookies ="<?php echo $cookies; ?>"
  62. pageName = "<?php echo $pageName; ?>"
  63. edid = "<?php echo $edid; ?>"
  64. host ="<?php echo $hostName; ?>"
  65. uploadUrl = "<?php echo $capturePath.'upload.php'; ?>"
  66. scriptable = "false"
  67. pluginspage="http://java.sun.com/products/plugin/index.html#download">
  68. </embed>
  69. <?php echo get_lang('NoJava'); ?>
  70. </object>