applet.php 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. //fix for Opera XMLHttpRequests
  3. if (!count($_POST) && $HTTP_RAW_POST_DATA) {
  4. parse_str($HTTP_RAW_POST_DATA, $_POST);
  5. }
  6. if (!defined('DOKU_INC')) {
  7. define('DOKU_INC', __DIR__.'/../../../');
  8. }
  9. require_once DOKU_INC.'inc/init.php';
  10. require_once DOKU_INC.'inc/common.php';
  11. require_once DOKU_INC.'inc/pageutils.php';
  12. require_once DOKU_INC.'inc/auth.php';
  13. //close sesseion
  14. session_write_close();
  15. header('Content-Type: text/html; charset=utf-8');
  16. $hostName = "http".($_SERVER['HTTPS'] ? 's' : null).'://'.$_SERVER['HTTP_HOST'];
  17. $imageFormat = "PNG";
  18. $cookies;
  19. foreach (array_keys($_COOKIE) as $cookieName) {
  20. $cookies .= bin2hex($cookieName)."=".bin2hex($_COOKIE[$cookieName]).";";
  21. }
  22. $pageName = $_GET["pageName"];
  23. $edid = $_GET["edid"];
  24. ?>
  25. <script language="JavaScript" type="text/javascript">
  26. var _info = navigator.userAgent;
  27. var _ns = false;
  28. var _ns6 = false;
  29. var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
  30. </script>
  31. <comment>
  32. <script language="JavaScript" type="text/javascript">
  33. var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
  34. var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
  35. </script>
  36. </comment>
  37. <script language="JavaScript" type="text/javascript"><!--
  38. if (_ie == true) document.writeln('<object classid="clsid:CAFEEFAC-0017-0000-0020-ABCDEFFEDCBA" NAME = "jCapture" WIDTH = "1" HEIGHT = "1" codebase="http://java.sun.com/update/1.7.0/jinstall-1_7_0-windows-i586.cab#Version=7,0,0,0"><xmp>');
  39. else if (_ns == true && _ns6 == false) document.writeln('<embed ' +
  40. 'type="application/x-java-applet;jpi-version=1.7.0" \
  41. ID = "jCaptureApplet" \
  42. scriptable = "true" \
  43. mayscript = "true" \
  44. WIDTH = "1"
  45. JAVA_CODEBASE = "/somenonexistingcodebase" \
  46. HEIGHT = "1"
  47. CODE = "com.hammurapi.jcapture.JCaptureApplet.class" \
  48. ARCHIVE = "<?php echo DOKU_BASE; ?>lib/plugins/jcapture/lib/jcapture.jar" \
  49. NAME = "jCapture" \
  50. dokuBase ="<?php echo bin2hex(DOKU_BASE); ?>" \
  51. sectok ="<?php echo getSecurityToken(); ?>" \
  52. cookies ="<?php echo $cookies; ?>" \
  53. authtok = "<?php echo auth_createToken(); ?>" \
  54. pageName = "<?php echo $pageName; ?>" \
  55. edid = "<?php echo $edid; ?>" \
  56. host ="<?php echo $hostName; ?>" ' +
  57. 'scriptable=true ' +
  58. 'pluginspage="http://java.sun.com/products/plugin/index.html#download"><xmp>');
  59. //--></script>
  60. <applet id="jCaptureApplet" CODE = "com.hammurapi.jcapture.JCaptureApplet.class" WIDTH="1" HEIGHT="1" ARCHIVE = "<?php echo DOKU_BASE; ?>/lib/plugins/jcapture/lib/jcapture.jar" NAME = "jCapture"></xmp>
  61. <PARAM NAME = CODE VALUE = "com.hammurapi.jcapture.JCaptureApplet.class" >
  62. <PARAM NAME = ARCHIVE VALUE = "<?php echo DOKU_BASE; ?>lib/plugins/jcapture/lib/jcapture.jar" >
  63. <PARAM NAME = NAME VALUE = "jCapture" >
  64. <PARAM NAME="type" value="application/x-java-applet;jpi-version=1.7.0">
  65. <PARAM NAME="scriptable" value="true">
  66. <PARAM NAME="mayscript" value="true">
  67. <PARAM NAME = "dokuBase" VALUE="<?php echo bin2hex(DOKU_BASE); ?>">
  68. <PARAM NAME = "sectok" VALUE="<?php echo getSecurityToken(); ?>">
  69. <PARAM NAME = "cookies" VALUE="<?php echo $cookies; ?>">
  70. <PARAM NAME = "host" VALUE="<?php echo $hostName; ?>">
  71. <PARAM NAME = "pageName" VALUE="<?php echo $pageName; ?>">
  72. <PARAM NAME = "edid" VALUE="<?php echo $edid; ?>">
  73. <PARAM NAME = CODEBASE VALUE = "/somenonexistingcodebase" >
  74. <PARAM NAME = "authtok" VALUE="<?php echo auth_createToken(); ?>">
  75. Java 2 Standard Edition v 1.7 or above is required for this applet.<br/>
  76. Download it from <a href="http://java.sun.com">http://java.sun.com</a>.
  77. </applet>
  78. </embed>
  79. </object>
  80. <!--
  81. <APPLET CODE = "com.hammurapi.jcapture.JCaptureApplet.class" ARCHIVE = "<?php echo DOKU_BASE; ?>/lib/plugins/jcapture/lib/jcapture.jar" NAME = "jCapture">
  82. <PARAM NAME = "dokuBase" VALUE="<?php echo bin2hex(DOKU_BASE); ?>">
  83. <PARAM NAME = "sectok" VALUE="<?php echo getSecurityToken(); ?>">
  84. <PARAM NAME = "cookies" VALUE="<?php echo $cookies; ?>">
  85. <PARAM NAME = "host" VALUE="<?php echo $hostName; ?>">
  86. Java 2 Standard Edition v 1.7 or above is required for this applet.<br/>
  87. Download it from <a href="http://java.sun.com">http://java.sun.com</a>.
  88. </APPLET>
  89. -->