plugin_applet.php 2.9 KB

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