appshare.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php // $Id: infocours.php 10902 2007-01-25 14:44:35Z elixir_julian $
  2. /* For licensing terms, see /dokeos_license.txt */
  3. /*
  4. ==============================================================================
  5. INIT SECTION
  6. ==============================================================================
  7. */
  8. // name of the language file that needs to be included
  9. $language_file = array('create_course', 'course_info');
  10. require '../inc/global.inc.php';
  11. $this_section = SECTION_COURSES;
  12. $nameTools = get_lang("ModifInfo");
  13. $course_code = $_course["sysCode"];
  14. $app_share_tmp_dir_base = api_get_path(SYS_ARCHIVE_PATH).'app_share/';
  15. mkdir ($app_share_tmp_dir_base, 0700);
  16. $app_share_tmp_dir = $app_share_tmp_dir_base.$course_code;
  17. $app_base_file = api_get_path(SYS_CODE_PATH).'app_share/DokeosAppShare.exe';
  18. $app_share_app_file = $app_share_tmp_dir.'/DokeosAppShare.exe';
  19. $specialCode='';
  20. if (file_exists($app_share_app_file) == FALSE) {
  21. mkdir ($app_share_tmp_dir, 0700);
  22. if (file_exists($app_base_file) == FALSE) {
  23. echo('FATAL ERROR: file <b>'.$app_base_file.'</b> not found.<br />');
  24. } else {
  25. $source = fopen($app_base_file, "r");
  26. $target = fopen($app_share_app_file, "a" );
  27. $specialCode = rand(100000,999999).time().rand(100000,999999);
  28. $contents = fread ($source, filesize ($app_base_file));
  29. fwrite ($target, $contents, filesize ($app_base_file));
  30. fwrite ($target, $specialCode, filesize ($app_base_file));
  31. fclose($source);
  32. fclose($target);
  33. }
  34. } else {
  35. $source = fopen($app_share_app_file, "r" );
  36. fread ($source, filesize ($app_base_file)); // skip binary content
  37. $serverID = fread ($source, filesize($app_share_app_file)-filesize ($app_base_file));
  38. fclose($source);
  39. }
  40. if ($_GET["client"] == 'true') {
  41. ?>
  42. <HTML>
  43. <HEAD><TITLE> [test viewApplet appShare] </TITLE></HEAD>
  44. <BODY>
  45. <SPAN style='position: absolute; top:0px;left:0px'>
  46. <OBJECT style="width: 100%; height: 100%"
  47. ID='DokeosSharing'
  48. classid = 'clsid:8AD9C840-044E-11D1-B3E9-00805F499D93'
  49. codebase = 'http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0'
  50. WIDTH = 1000 HEIGHT = 700 >
  51. <PARAM NAME = CODE VALUE = VncViewer.class >
  52. <PARAM NAME = ARCHIVE VALUE = VncViewer.jar >
  53. <PARAM NAME = 'type' VALUE = 'application/x-java-applet;version=1.4'>
  54. <PARAM NAME = 'scriptable' VALUE = 'false'>
  55. <PARAM NAME = PORT VALUE=443>
  56. <PARAM NAME = 'HOST' VALUE='dokeos.noctis.be'>
  57. <PARAM NAME = 'SERVERID' VALUE='<?php echo($serverID);?>'>
  58. <PARAM NAME = ENCODING VALUE=Tight>
  59. <PARAM NAME = 'Open New Window' VALUE='Yes'>
  60. <COMMENT>
  61. <EMBED
  62. type = 'application/x-java-applet;version=1.4' \
  63. CODE = VncViewer.class \
  64. ARCHIVE = VncViewer.jar \
  65. WIDTH = 1000 \
  66. HEIGHT = 700 \
  67. PORT = 443 \
  68. SERVERID = '<?php echo($serverID);?>' \
  69. ENCODING =Tight \
  70. scriptable = false \
  71. pluginspage ='http://java.sun.com/products/plugin/index.html#download'>
  72. <NOEMBED>
  73. </NOEMBED>
  74. </EMBED>
  75. </COMMENT>
  76. </OBJECT>
  77. </SPAN>
  78. </BODY>
  79. </HTML>
  80. <?php
  81. } else {
  82. if (api_is_allowed_to_edit()) {
  83. $linkToFile = api_get_path(WEB_ARCHIVE_PATH).'app_share/'.$course_code.'/DokeosAppShare.exe';
  84. ?>
  85. <h3><?php echo get_lang('PrerequisitesForAppShare'); ?></h3>
  86. <ul>
  87. <li>Microsoft .NET : <a target="top" href="http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en">install</a></li>
  88. <li style="margin-top: 5px;">Visual J# Redistributable Packages : <a target="top" href="http://msdn2.microsoft.com/en-us/vjsharp/bb188598.aspx">install</a></li>
  89. </ul>
  90. <form style="float: left;" id="view_screen" action="<?php echo($linkToFile);?>">
  91. <input style="width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="Partager mon �cran" />
  92. </form>
  93. <?php
  94. }?>
  95. <form style="float: left;" id="view_screen" action="">
  96. <input type="hidden" name="client" value="true" />
  97. <input style="margin-left: 20px; width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="Visualiser l'�cran partag�" />
  98. </form><?php
  99. }?>