appshare.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. // $Id: infocours.php 10902 2007-01-25 14:44:35Z elixir_julian $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2004 Dokeos S.A.
  7. Copyright (c) 2003 Ghent University (UGent)
  8. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9. Copyright (c) Hugues Peeters
  10. Copyright (c) Roan Embrechts (Vrije Universiteit Brussel)
  11. Copyright (c) Olivier Brouckaert
  12. Copyright (c) Bart Mollet, Hogeschool Gent
  13. For a full list of contributors, see "credits.txt".
  14. The full license can be read in "license.txt".
  15. This program is free software; you can redistribute it and/or
  16. modify it under the terms of the GNU General Public License
  17. as published by the Free Software Foundation; either version 2
  18. of the License, or (at your option) any later version.
  19. See the GNU General Public License for more details.
  20. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  21. ==============================================================================
  22. ==============================================================================
  23. INIT SECTION
  24. ==============================================================================
  25. */
  26. // name of the language file that needs to be included
  27. $language_file = array ('create_course', 'course_info');
  28. include ('../inc/global.inc.php');
  29. $this_section = SECTION_COURSES;
  30. $nameTools = get_lang("ModifInfo");
  31. $course_code = $_course["sysCode"];
  32. // WARNING : try to use GARBAGE_PATH ? but no WEB_GARBAGE ? (api_get_path)
  33. $app_share_tmp_dir_base = api_get_path(SYS_CODE_PATH).'garbage/app_share/';
  34. mkdir ($app_share_tmp_dir_base, 0700);
  35. $app_share_tmp_dir = $app_share_tmp_dir_base.$course_code;
  36. $app_base_file = api_get_path(SYS_CODE_PATH).'app_share/DokeosAppShare.exe';
  37. $app_share_app_file = $app_share_tmp_dir.'/DokeosAppShare.exe';
  38. $specialCode='';
  39. if (file_exists($app_share_app_file) == FALSE) {
  40. mkdir ($app_share_tmp_dir, 0700);
  41. if (file_exists($app_base_file) == FALSE) {
  42. echo('FATAL ERROR: file <b>'.$app_base_file.'</b> not found.<br />');
  43. } else {
  44. $source = fopen($app_base_file, "r");
  45. $target = fopen($app_share_app_file, "a" );
  46. $specialCode = rand(100000,999999).time().rand(100000,999999);
  47. $contents = fread ($source, filesize ($app_base_file));
  48. fwrite ($target, $contents, filesize ($app_base_file));
  49. fwrite ($target, $specialCode, filesize ($app_base_file));
  50. fclose($source);
  51. fclose($target);
  52. }
  53. } else {
  54. $source = fopen($app_share_app_file, "r" );
  55. fread ($source, filesize ($app_base_file)); // skip binary content
  56. $serverID = fread ($source, filesize($app_share_app_file)-filesize ($app_base_file));
  57. fclose($source);
  58. }
  59. if ($_GET["client"] == 'true') {
  60. ?>
  61. <HTML>
  62. <HEAD><TITLE> [test viewApplet appShare] </TITLE></HEAD>
  63. <BODY>
  64. <SPAN style='position: absolute; top:0px;left:0px'>
  65. <OBJECT style="width: 100%; height: 100%"
  66. ID='DokeosSharing'
  67. classid = 'clsid:8AD9C840-044E-11D1-B3E9-00805F499D93'
  68. codebase = 'http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0'
  69. WIDTH = 1000 HEIGHT = 700 >
  70. <PARAM NAME = CODE VALUE = VncViewer.class >
  71. <PARAM NAME = ARCHIVE VALUE = VncViewer.jar >
  72. <PARAM NAME = 'type' VALUE = 'application/x-java-applet;version=1.4'>
  73. <PARAM NAME = 'scriptable' VALUE = 'false'>
  74. <PARAM NAME = PORT VALUE=443>
  75. <PARAM NAME = 'HOST' VALUE='dokeos.noctis.be'>
  76. <PARAM NAME = 'SERVERID' VALUE='<?php echo($serverID);?>'>
  77. <PARAM NAME = ENCODING VALUE=Tight>
  78. <PARAM NAME = 'Open New Window' VALUE='Yes'>
  79. <COMMENT>
  80. <EMBED
  81. type = 'application/x-java-applet;version=1.4' \
  82. CODE = VncViewer.class \
  83. ARCHIVE = VncViewer.jar \
  84. WIDTH = 1000 \
  85. HEIGHT = 700 \
  86. PORT = 443 \
  87. SERVERID = '<?php echo($serverID);?>' \
  88. ENCODING =Tight \
  89. scriptable = false \
  90. pluginspage ='http://java.sun.com/products/plugin/index.html#download'>
  91. <NOEMBED>
  92. </NOEMBED>
  93. </EMBED>
  94. </COMMENT>
  95. </OBJECT>
  96. </SPAN>
  97. </BODY>
  98. </HTML>
  99. <?php
  100. } else {
  101. if (api_is_allowed_to_edit()) {
  102. // WARNING : try to use GARBAGE_PATH ? but no WEB_GARBAGE ? (api_get_path)
  103. $linkToFile = api_get_path(WEB_PATH).'main/garbage/app_share/'.$course_code.'/DokeosAppShare.exe';
  104. ?>
  105. <h3>prérequis pour DokeosAppShare :</h3>
  106. <ul>
  107. <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>
  108. <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>
  109. </ul>
  110. <form style="float: left;" id="view_screen" action="<?php echo($linkToFile);?>">
  111. <input style="width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="Partager mon écran" />
  112. </form>
  113. <?php
  114. }?>
  115. <form style="float: left;" id="view_screen" action="">
  116. <input type="hidden" name="client" value="true" />
  117. <input style="margin-left: 20px; width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="Visualiser l'écran partagé" />
  118. </form><?php
  119. }?>