index.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. mkdir ($app_share_tmp_dir_base, api_get_permissions_for_new_directories());
  17. $app_share_tmp_dir = $app_share_tmp_dir_base.$course_code;
  18. $app_base_file = api_get_path(SYS_CODE_PATH).'app_share/DokeosAppShare.exe';
  19. $app_share_app_file = $app_share_tmp_dir.'/DokeosAppShare.exe';
  20. $specialCode='';
  21. if (file_exists($app_share_app_file) == FALSE) {
  22. //mkdir ($app_share_tmp_dir, 0700);
  23. mkdir ($app_share_tmp_dir, api_get_permissions_for_new_directories());
  24. if (file_exists($app_base_file) == FALSE) {
  25. echo('FATAL ERROR: file <strong>'.$app_base_file.'</strong> not found.<br />');
  26. } else {
  27. $source = fopen($app_base_file, "r");
  28. $target = fopen($app_share_app_file, "a" );
  29. $specialCode = rand(100000,999999).time().rand(100000,999999);
  30. $contents = fread ($source, filesize ($app_base_file));
  31. fwrite ($target, $contents, filesize ($app_base_file));
  32. fwrite ($target, $specialCode, filesize ($app_base_file));
  33. fclose($source);
  34. fclose($target);
  35. }
  36. } else {
  37. $source = fopen($app_share_app_file, "r" );
  38. fread ($source, filesize ($app_base_file)); // skip binary content
  39. $serverID = fread ($source, filesize($app_share_app_file)-filesize ($app_base_file));
  40. fclose($source);
  41. }
  42. /*
  43. ==============================================================================
  44. HEADER
  45. ==============================================================================
  46. */
  47. Display :: display_header("appShare");
  48. if ($_GET["client"] == 'true') {
  49. ?>
  50. <HTML>
  51. <HEAD><TITLE> [test viewApplet appShare] </TITLE></HEAD>
  52. <BODY>
  53. <SPAN style='position: absolute; top:0px;left:0px'>
  54. <OBJECT style="width: 100%; height: 100%"
  55. ID='DokeosSharing'
  56. classid = 'clsid:8AD9C840-044E-11D1-B3E9-00805F499D93'
  57. codebase = 'http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0'
  58. WIDTH = 1000 HEIGHT = 700 >
  59. <PARAM NAME = CODE VALUE = VncViewer.class >
  60. <PARAM NAME = ARCHIVE VALUE = VncViewer.jar >
  61. <PARAM NAME = 'type' VALUE = 'application/x-java-applet;version=1.4'>
  62. <PARAM NAME = 'scriptable' VALUE = 'false'>
  63. <PARAM NAME = PORT VALUE=443>
  64. <PARAM NAME = 'HOST' VALUE='dokeos.noctis.be'>
  65. <PARAM NAME = 'SERVERID' VALUE='<?php echo($serverID);?>'>
  66. <PARAM NAME = ENCODING VALUE=Tight>
  67. <PARAM NAME = 'Open New Window' VALUE='Yes'>
  68. <COMMENT>
  69. <EMBED
  70. type = 'application/x-java-applet;version=1.4' \
  71. CODE = VncViewer.class \
  72. ARCHIVE = VncViewer.jar \
  73. WIDTH = 1000 \
  74. HEIGHT = 700 \
  75. PORT = 443 \
  76. SERVERID = '<?php echo($serverID);?>' \
  77. ENCODING =Tight \
  78. scriptable = false \
  79. pluginspage ='http://java.sun.com/products/plugin/index.html#download'>
  80. <NOEMBED>
  81. </NOEMBED>
  82. </EMBED>
  83. </COMMENT>
  84. </OBJECT>
  85. </SPAN>
  86. </BODY>
  87. </HTML>
  88. <?php
  89. } else {
  90. if (api_is_allowed_to_edit()) {
  91. $linkToFile = api_get_path(WEB_ARCHIVE_PATH).'app_share/'.$course_code.'/DokeosAppShare.exe';
  92. ?>
  93. <h3><?php echo get_lang('PrerequisitesForAppShare'); ?></h3>
  94. <ul>
  95. <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>
  96. <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>
  97. </ul>
  98. <form style="float: left;" id="view_screen" action="<?php echo($linkToFile);?>">
  99. <input style="width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="<?php echo get_lang('ShareMyScreen'); ?>" />
  100. </form>
  101. <?php
  102. }?>
  103. <form style="float: left;" id="view_screen" action="">
  104. <input type="hidden" name="client" value="true" />
  105. <input style="margin-left: 20px; width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="<?php echo get_lang('SeeTheSharedScreen'); ?>" />
  106. </form><?php
  107. }
  108. /*
  109. ==============================================================================
  110. FOOTER
  111. ==============================================================================
  112. */
  113. Display::display_footer();