index.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. /*
  41. ==============================================================================
  42. HEADER
  43. ==============================================================================
  44. */
  45. Display :: display_header("appShare");
  46. if ($_GET["client"] == 'true') {
  47. ?>
  48. <HTML>
  49. <HEAD><TITLE> [test viewApplet appShare] </TITLE></HEAD>
  50. <BODY>
  51. <SPAN style='position: absolute; top:0px;left:0px'>
  52. <OBJECT style="width: 100%; height: 100%"
  53. ID='DokeosSharing'
  54. classid = 'clsid:8AD9C840-044E-11D1-B3E9-00805F499D93'
  55. codebase = 'http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0'
  56. WIDTH = 1000 HEIGHT = 700 >
  57. <PARAM NAME = CODE VALUE = VncViewer.class >
  58. <PARAM NAME = ARCHIVE VALUE = VncViewer.jar >
  59. <PARAM NAME = 'type' VALUE = 'application/x-java-applet;version=1.4'>
  60. <PARAM NAME = 'scriptable' VALUE = 'false'>
  61. <PARAM NAME = PORT VALUE=443>
  62. <PARAM NAME = 'HOST' VALUE='dokeos.noctis.be'>
  63. <PARAM NAME = 'SERVERID' VALUE='<?php echo($serverID);?>'>
  64. <PARAM NAME = ENCODING VALUE=Tight>
  65. <PARAM NAME = 'Open New Window' VALUE='Yes'>
  66. <COMMENT>
  67. <EMBED
  68. type = 'application/x-java-applet;version=1.4' \
  69. CODE = VncViewer.class \
  70. ARCHIVE = VncViewer.jar \
  71. WIDTH = 1000 \
  72. HEIGHT = 700 \
  73. PORT = 443 \
  74. SERVERID = '<?php echo($serverID);?>' \
  75. ENCODING =Tight \
  76. scriptable = false \
  77. pluginspage ='http://java.sun.com/products/plugin/index.html#download'>
  78. <NOEMBED>
  79. </NOEMBED>
  80. </EMBED>
  81. </COMMENT>
  82. </OBJECT>
  83. </SPAN>
  84. </BODY>
  85. </HTML>
  86. <?php
  87. } else {
  88. if (api_is_allowed_to_edit()) {
  89. $linkToFile = api_get_path(WEB_ARCHIVE_PATH).'app_share/'.$course_code.'/DokeosAppShare.exe';
  90. ?>
  91. <h3><?php echo get_lang('PrerequisitesForAppShare'); ?></h3>
  92. <ul>
  93. <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>
  94. <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>
  95. </ul>
  96. <form style="float: left;" id="view_screen" action="<?php echo($linkToFile);?>">
  97. <input style="width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="<?php echo get_lang('ShareMyScreen'); ?>" />
  98. </form>
  99. <?php
  100. }?>
  101. <form style="float: left;" id="view_screen" action="">
  102. <input type="hidden" name="client" value="true" />
  103. <input style="margin-left: 20px; width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="<?php echo get_lang('SeeTheSharedScreen'); ?>" />
  104. </form><?php
  105. }
  106. /*
  107. ==============================================================================
  108. FOOTER
  109. ==============================================================================
  110. */
  111. Display::display_footer();