applet.php 4.6 KB

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