diff --git a/main/webrooms/api.php b/main/webrooms/api.php new file mode 100644 index 0000000000..d78a714040 --- /dev/null +++ b/main/webrooms/api.php @@ -0,0 +1,316 @@ +0) +{ + // dump the request + $v = array_keys(get_defined_vars()); + error_log(var_export($v, true),3, '/tmp/log'); + + foreach (array_keys(get_defined_vars()) as $k) { + if ($k == 'GLOBALS') + continue; + error_log($k, 3, '/tmp/log'); + error_log(var_export($$k, true), 3, '/tmp/log'); + } + +} + +/* +============================================================================== + INCLUDE +============================================================================== +*/ +require_once ('../inc/global.inc.php'); +api_block_anonymous_users(); +require_once (api_get_path(LIBRARY_PATH)."course.lib.php"); +require_once (api_get_path(LIBRARY_PATH)."document.lib.php"); +require_once (api_get_path(LIBRARY_PATH)."fileUpload.lib.php"); + +/* +============================================================================== + SETTING UP SOME VARIABLES +============================================================================== +*/ +$debug=0; +$action = $_REQUEST["action"]; +$cidReq = $_REQUEST["cidReq"]; + +$user_id = api_get_user_id(); +$coursePath = api_get_path(SYS_COURSE_PATH).$cidReq.'/document'; +$_course = CourseManager::get_course_information($cidReq); + +// FIXME: this sound very strange !!! but add_document need this to works +$_course['dbName'] = $_course['db_name']; + +// FIXME: check if CourseManager::get_user_in_course_status return != +// COURSEMANAGER when the code is not valid +// FIXME: There is no valid course code which contains things like ../ +if ($debug>0) error_log($coursePath, 0); + + + +if ($action == "upload") +{ +/* +============================================================================== + PERMISSION +============================================================================== +*/ + $permissions = CourseManager::get_user_in_course_status($user_id, $cidReq); + if ($permissions != COURSEMANAGER) + { + error_log("Upload from videoconf not allowed !!!",0); + die(); // this user is not allowed to add upload documents + } +/* +============================================================================== + UPLOAD +============================================================================== +*/ + + $destPath = $coursePath.VIDEOCONF_UPLOAD_PATH; + if (!is_dir($destPath)){ + $result = create_unexisting_directory($_course,$user_id,0,NULL,$coursePath,VIDEOCONF_UPLOAD_PATH); + if (!$result) + error_log("Can't create ".$destPath." folder",0); + } + + $newPath = handle_uploaded_document($_course,$_FILES['Filedata'],$coursePath,VIDEOCONF_UPLOAD_PATH,$user_id,0,NULL,'',0,'rename',false); + // based on ../newscorm/presentation.class.php + $file_name = (strrpos($newPath,'.')>0 ? substr($newPath, 0, strrpos($newPath,'.')) : $newPath); + $file_extension = (strrpos($newPath,'.')>0 ? substr($newPath, strrpos($newPath,'.'),10) : ''); +/* error_log($newPath,0); + error_log($file_name,0); + error_log($file_extension,0); +*/ + if (in_array($file_extension, $PRESENTATION_EXTENSION)) + { +// error_log("converting $coursePath$newPath", 0); + /* creating output folder */ + $created_dir = create_unexisting_directory($_course,$user_id,0,NULL,$coursePath,$file_name); +// error_log($created_dir,0); + + /* alow user of openoffice to write into the folder */ + // FIXME + chmod($coursePath.$created_dir, 0777); + + /* + * exec java application + * the parameters of the program are : + * - javacommand on this server ; + * - host where openoffice is running; + * - port with which openoffice is listening + * - file to convert + * - folder where put the slides + * - ftppassword if required + * The program fills $files with the list of slides created + */ + /* building command line */ + $classpath = '-cp .:ridl.jar:js.jar:juh.jar:jurt.jar:jut.jar:java_uno.jar:java_uno_accessbridge.jar:edtftpj-1.5.2.jar:unoil.jar'; + if(strpos($_ENV['OS'],'Windows') !== false) + { + $classpath = str_replace(':',';',$classpath); + } + list($slide_width, $slide_height) = explode('x',api_get_setting('service_ppt2lp','size')); + + if(strpos($_ENV['OS'],'Windows') !== false) + { + $cmd = 'cd '.str_replace('/','\\',api_get_path(SYS_PATH)).'main/inc/lib/ppt2png && java '.$classpath.' DocumentConverter '.api_get_setting('service_ppt2lp','host').' 2002'.' "'.$coursePath.$newPath.'" "'.$coursePath.$created_dir.'"'.' '.$slide_width.' '.$slide_height.' '.api_get_setting('service_ppt2lp','user').' '.api_get_setting('service_ppt2lp','ftp_password'); + } + else + { + $cmd = 'cd '.api_get_path(SYS_PATH).'main/inc/lib/ppt2png && java '.$classpath.' DocumentConverter '.api_get_setting('service_ppt2lp','host').' 2002'.' "'.$coursePath.$newPath.'" "'.$coursePath.$created_dir.'"'.' '.$slide_width.' '.$slide_height.' '.api_get_setting('service_ppt2lp','user').' '.api_get_setting('service_ppt2lp','ftp_password'); + } + error_log($cmd,0); + + /* Exec */ + $shell = exec($cmd, $files, $return); // files: list of created files, return: shell return code + + /* Add Files */ + foreach($files as $f) + { + $did = add_document($_course, $created_dir.'/'.$f, 'file', filesize($coursePath.$created_dir.'/'.$f), $f); +// error_log($created_dir.'/'.$f); + if ($did) + api_item_property_update($_course, TOOL_DOCUMENT, $did, 'DocumentAdded', $user_id, 0, NULL); + } + } +} else if ($action == "service") +{/* +============================================================================== + LIST FILES +============================================================================== +*/ + error_log("sending file list",0); + $subaction = $_REQUEST["subaction"]; + $canDelete = (CourseManager::get_user_in_course_status($user_id, $cidReq) == COURSEMANAGER); + if ($subaction == "list") { + // FIXME: check security around $_REQUEST["cwd"] + $cwd = $_REQUEST["cwd"]; + + // treat /.. + $nParent = 0; // the number of /.. into the url + while (substr($cwd, -3, 3) == "/..") + { + // go to parent directory + $cwd= substr($cwd, 0, -3); + if (strlen($cwd) == 0) $cwd="/"; + $nParent++; + } + for (;$nParent >0; $nParent--){ + $cwd = (strrpos($cwd,'/')>-1 ? substr($cwd, 0, strrpos($cwd,'/')) : $cwd); + } + + if (strlen($cwd) == 0) $cwd="/"; + + // check if user can delete files. He must be manager and be inside /videoconf + $isBellowVideoConfUploadPath = (substr($cwd,0,strlen(VIDEOCONF_UPLOAD_PATH)) == VIDEOCONF_UPLOAD_PATH); + $canDelete = ($canDelete && $isBellowVideoConfUploadPath); + + // get files list + $files = DocumentManager::get_all_document_data($_course, $cwd, 0, NULL, false); + printf(""); + printf(""); + foreach($files as $i) + if ($i["filetype"] != "folder") + continue; + else + { + printf('%s%s%s', $i['path'],$i['title'],($canDelete?"true":"false")); + } + printf(""); + foreach($files as $i) { + $extension = (strrpos($i['path'],'.')>0 ? substr($i['path'], strrpos($i['path'],'.'),10) : ''); + if ($i["filetype"] != "file" || !in_array($extension, $IMAGE_EXTENSION)) + continue; + else + { + printf('%s%s%s', $i['path'], $i['title'],($canDelete?"true":"false")); + } + } + printf(""); + foreach($files as $i) { + // FIXME: Please optimise me !!! + $extension = (strrpos($i['path'],'.')>0 ? substr($i['path'], strrpos($i['path'],'.'),10) : ''); + if ($i["filetype"] != "file" || !in_array($extension, $PRESENTATION_EXTENSION)) + continue; + else + { + printf('%s%s%s', $i['path'], $i['title'],($canDelete?"true":"false")); + } + } +// printf("fr1fn1"); + + printf(""); + printf(""); + } else if ($subaction == "delete") {/* +============================================================================== + PERMISSION +============================================================================== +*/ + $permissions = CourseManager::get_user_in_course_status($user_id, $cidReq); + if ($permissions != COURSEMANAGER) + { + error_log("Upload from videoconf not allowed !!!",0); + die(); // this user is not allowed to add upload documents + } + +/* +============================================================================== + DELETE +============================================================================== +*/ + $path = $_REQUEST["path"]; + if ((substr($path,0,strlen(VIDEOCONF_UPLOAD_PATH)) != VIDEOCONF_UPLOAD_PATH)) + { + error_log("Delete from videoconf for "+$path+" NOT ALLOWED",0); + die(); + } + + DocumentManager::delete_document($_course, $path, $coursePath); + echo "OK"; // We have to returns something to OpenLaszlo + } +} else if ($action == "download") +{ +/* +============================================================================== + DOWNLOAD +============================================================================== +*/ + //check if the document is in the database + if(!DocumentManager::get_document_id($_course,$_REQUEST['file'])) + { + //file not found! + error_log("404 ".$_REQUEST["file"]); + header("HTTP/1.0 404 Not Found"); + $error404 = ''; + $error404 .= ''; + $error404 .= '404 Not Found'; + $error404 .= ''; + $error404 .= '

Not Found

'; + $error404 .= '

The requested URL was not found on this server.

'; + $error404 .= '
'; + $error404 .= ''; + echo($error404); + exit; + } + $doc_url=$_REQUEST['file']; + error_log($doc_url); + $full_file_name = $coursePath.$doc_url; + DocumentManager::file_send_for_download($full_file_name,false); + exit; +} + +?> diff --git a/main/webrooms/checksession.php b/main/webrooms/checksession.php index 62c35600c2..f181e290f3 100644 --- a/main/webrooms/checksession.php +++ b/main/webrooms/checksession.php @@ -4,9 +4,24 @@ * This script gives information to the videoconference scripts (in OpenLaszlo) * to use the right URL and ports for the videoconference. */ +require_once('../newscorm/learnpath.class.php'); +if($debug>0) error_log('New LP - Included learnpath',0); +require_once('../newscorm/learnpathItem.class.php'); +if($debug>0) error_log('New LP - Included learnpathItem',0); +require_once('../newscorm/scorm.class.php'); +if($debug>0) error_log('New LP - Included scorm',0); +require_once('../newscorm/scormItem.class.php'); +if($debug>0) error_log('New LP - Included scormItem',0); +require_once('../newscorm/aicc.class.php'); +if($debug>0) error_log('New LP - Included aicc',0); +require_once('../newscorm/aiccItem.class.php'); +if($debug>0) error_log('New LP - Included aiccItem',0); + + include("../../main/inc/global.inc.php"); api_block_anonymous_users(); +require_once (api_get_path(LIBRARY_PATH)."course.lib.php"); printf (''); printf(''); @@ -17,14 +32,37 @@ printf(''); printf(''); foreach ($_SESSION['_user'] as $key => $val) printf('<%s>%s',$key,utf8_encode($val),$key); +printf('%s', session_id()); +printf('%s', (CourseManager::get_user_in_course_status($_SESSION['_user']['user_id'], $_SESSION['_course']['sysCode']) == COURSEMANAGER) ? "true" : "false"); printf(''); -printf(''); -printf(''); -printf(''); -printf(''); -printf(''); -printf(''); +printf(''); +printf(''.api_get_setting('service_visio','visio_rtmp_host_local').''); +printf(''.api_get_setting('service_visio','visio_is_web_rtmp').''); +printf(''.api_get_setting('service_visio','visio_rtmp_port').''); +printf(''.api_get_setting('service_visio','visio_rtmp_tunnel_port').''); +printf(''); + + +printf(''); + +if(isset($_SESSION['oLP'])) +{ + switch ($_SESSION['whereami']) + { + case 'lp/build' : + $student_view = 'false'; + break; + default : + $student_view = 'true'; + break; + } + $document_id = $_SESSION['oLP']->current; +} + +printf('%s',$student_view); +printf('%s',$document_id); +printf(''); printf(''); ?> diff --git a/main/webrooms/english.xml b/main/webrooms/english.xml new file mode 100644 index 0000000000..1a628ab708 --- /dev/null +++ b/main/webrooms/english.xml @@ -0,0 +1,419 @@ + + + + 1 + Camera + + + 2 + Microphone + + + 3 + Name + + + 4 + Delete Stream + + + 5 + Progress + + + 6 + Play + + + 7 + Stop + + + 8 + Record + + + 9 + No File availible + + + 10 + Recording only for teachers + + + 11 + Users at the moment: + + + 12 + Start conference + + + 13 + My name + + + 14 + Dokeos VideoConference + + + 15 + Import presentation + + + 16 + Refresh list + + + 17 + Go to Top + + + 18 + new Poll + + + 19 + Create a new Poll for this room. + + + 20 + Question: + + + 21 + Polltype: + + + 22 + create + + + 23 + Info: Every connected User in this room will get a notification of this new Poll. + + + 24 + create Poll + + + 25 + cancel + + + 26 + Yes/No + + + 27 + Numeric 1-10 + + + 28 + Poll + + + 29 + You have to become Moderator of this Room to make polls. + + + 30 + Your vote has been send. + + + 31 + Your already voted for this poll. + + + 32 + vote! + + + 33 + Your answer: + + + 34 + Yes + + + 35 + No + + + 36 + wants to know: + + + 37 + Poll results + + + 38 + Question: + + + 39 + Votes: + + + 40 + Result: + + + 41 + There is no Poll. + + + 42 + Vote! + + + 43 + Meeting (max 4 seats) + + + 44 + Conference (max 50 seats) + + + 45 + Mode + + + 46 + Remaining seats + + + 47 + Already in + + + 48 + Check in + + + 49 + The Moderator of this Conference has left the room. + + + 50 + System message + + + 51 + Choose devices + + + 52 + Choose Cam: + + + 53 + Choose Mic: + + + 54 + ok + + + 55 + cancel + + + 56 + You have to reconnect sothat the changes take effect. + + + 57 + Change settings + + + 58 + Course: + + + 59 + Course Language: + + + 60 + ok + + + 61 + cancel + + + 62 + Confirm Clear Whiteboard + + + 63 + Should the whiteboard be cleared before I add a new Image? + + + 64 + Don't ask me again + + + 65 + no + + + 66 + Edit Settings + + + 67 + Show Confirmation before clearing whiteboard + + + 68 + User Info + + + 69 + Clear DrawArea + + + 70 + Undo + + + 71 + Redo + + + 72 + Select an Object + + + 73 + Text + + + 74 + Paint + + + 75 + Draw line + + + 76 + Draw underline + + + 77 + Rectangle + + + 78 + Ellipse + + + 79 + Arrow + + + 80 + delete chosen Item + + + 81 + Apply for moderation + + + 82 + apply + + + 83 + cancel + + + 84 + Become moderator + + + 85 + close + + + 86 + italic + + + 87 + bold + + + 88 + WAITING + + + 89 + A User wants to apply for moderation: + + + 90 + accept + + + 91 + reject + + + 92 + cancel + + + 93 + Sending request to following Users + + + 94 + Accepted + + + 95 + Rejected + + + 96 + Change Moderator + + + 97 + You are not moderating this course! + + + 98 + Moderator: + + + 99 + This Room is full. Sorry please try again later. + + + 100 + + + + 101 + close + + + 102 + loading + + + 103 + Please wait while loading image + + + 104 + Synchronizing Conference Members + + diff --git a/main/webrooms/french.xml b/main/webrooms/french.xml new file mode 100644 index 0000000000..14957d97d6 --- /dev/null +++ b/main/webrooms/french.xml @@ -0,0 +1,419 @@ + + + + 1 + Caméra + + + 2 + Micro + + + 3 + Nom + + + 4 + Effacer le commentaire + + + 5 + Progrès + + + 6 + Jouer + + + 7 + Stop + + + 8 + Record + + + 9 + Pas de fichier + + + 10 + L'enregistrement est réservé aux profs + + + 11 + Utilisateurs actuellement: + + + 12 + Démarrer la conférence + + + 13 + Mon nom + + + 14 + Dokeos VidéoConférence + + + 15 + Importer une présentation + + + 16 + Rafraîchir la liste + + + 17 + Remonter dans l'arborescence + + + 18 + Nouveau sondagel + + + 19 + Créer un sondage. + + + 20 + Question: + + + 21 + Type de question: + + + 22 + créer + + + 23 + Info: tout utilisateur connecté dans cette chambre recevra le sondage. + + + 24 + Créer un sondage + + + 25 + Annuler + + + 26 + Oui/Non + + + 27 + Numérique de 1 à 10 + + + 28 + Sondage + + + 29 + Vous devez être modérateur pour créer des sondages. + + + 30 + Votre vote a été enregistré. + + + 31 + Vous avez déjà voté! + + + 32 + votez! + + + 33 + Votre réponse: + + + 34 + Oui + + + 35 + Non + + + 36 + voudrait savoir: + + + 37 + Résultats du sondage + + + 38 + Question: + + + 39 + Votes: + + + 40 + Résultat: + + + 41 + Il n'y a pas de sondage. + + + 42 + Votez! + + + 43 + Réunion (max 4 places) + + + 44 + Conférence (max 500 places) + + + 45 + Mode + + + 46 + Places restantes + + + 47 + Déjà connectés + + + 48 + Déjà connectés + + + 49 + Le modérateur a quitté la conférence. + + + 50 + Message système + + + 51 + Sélectionnez les périphériques + + + 52 + Sélection de la caméra: + + + 53 + Sélection du micro: + + + 54 + Ok + + + 55 + Annuler + + + 56 + Vous devez vous reconnecter pour activer les modifications. + + + 57 + Modifier les valeurs + + + 58 + Cours: + + + 59 + Langue: + + + 60 + Ok + + + 61 + Annuler + + + 62 + Confirmez l'effacement du tableau + + + 63 + Le tableau doit-il être effacé avant ajout d'une dia? + + + 64 + Ne plus me demander + + + 65 + Non + + + 66 + Editer les valeurs + + + 67 + Demander confirmation avant d'effacer le tableau + + + 68 + Info utilisateur + + + 69 + Effacer le tableau + + + 70 + Défaire + + + 71 + Refair + + + 72 + Sélectionner un objet + + + 73 + Texte + + + 74 + Peindre + + + 75 + Dessiner une ligne + + + 76 + Draw underline + + + 77 + Rectangle + + + 78 + Ellipse + + + 79 + Flèche + + + 80 + Supprimer l'élément sélectionné + + + 81 + Demander à être modérateur + + + 82 + Appliquer + + + 83 + Annuler + + + 84 + Demander à être modérateur + + + 85 + Fermer + + + 86 + Italiques + + + 87 + Grasses + + + 88 + EN ATTENTE + + + 89 + Un utilisateur demande à être modérateur: + + + 90 + Accepter + + + 91 + rejeter + + + 92 + Annuler + + + 93 + Requête envoyée aux utilisateurs suivants + + + 94 + Accepté + + + 95 + Rejeté + + + 96 + Changer de modérateur + + + 97 + Vous n'êtes pas modérateur! + + + 98 + Modérateur: + + + 99 + Cette salle de conférence est pleine. Veuillez réessayer plus tard. + + + 100 + + + + 101 + Fermer + + + 102 + loading + + + 103 + Please wait while loading + + + 104 + Synchronizing Conference Members + + diff --git a/main/webrooms/german.xml b/main/webrooms/german.xml new file mode 100644 index 0000000000..907a3de48a --- /dev/null +++ b/main/webrooms/german.xml @@ -0,0 +1,419 @@ + + + + 1 + Kamera + + + 2 + Mikrophon + + + 3 + Name + + + 4 + Stream löschen + + + 5 + Fortschritt + + + 6 + Play + + + 7 + Stop + + + 8 + Record + + + 9 + Keine Datei vorhanden + + + 10 + Aufnahme nur für Lehrer verfügbar + + + 11 + verbunden Benutzer: + + + 12 + Konferenz starten + + + 13 + Mein Name + + + 14 + Dokeos VideoConference + + + 15 + Präsentation importieren + + + 16 + Liste neu laden + + + 17 + Zum Hauptverzeichnis + + + 18 + neue Umfrage + + + 19 + Eine neue Umfrage für die Konferenz. + + + 20 + Frage: + + + 21 + Umfragenart: + + + 22 + anlegen + + + 23 + Info: Jeder verbundene Benutzer erhält eine Nachricht mit der neuen Umfrage. + + + 24 + Umfrage anlegen + + + 25 + abbrechen + + + 26 + Ja/Nein + + + 27 + Numerisch 1-10 + + + 28 + Umfrage + + + 29 + Sie müssen Moderator/Lehrer in diesem Raum sein um eine Umfrage anzulegen. + + + 30 + Ihr Stimme wurde abgegeben. + + + 31 + Sie haben für diese Umfrage bereits ihr Votum abgegeben. + + + 32 + abstimmen! + + + 33 + Ihre Antwort: + + + 34 + Ja + + + 35 + Nein + + + 36 + will wissen: + + + 37 + Umfrageergebnisse + + + 38 + Frage: + + + 39 + Antworten: + + + 40 + Ergebnis: + + + 41 + Es gibt zur Zeit keine Umfage. + + + 42 + abstimmen! + + + 43 + Meeting (max 4 Plätze) + + + 44 + Conference (max 50 Plätze) + + + 45 + Modus + + + 46 + verbleibende Plätze + + + 47 + Bereits vergeben + + + 48 + Eintreten + + + 49 + Der Moderator/Lehrer dieses Raums hat den Raum verlassen. + + + 50 + Systemnachricht + + + 51 + Geräteauswahl + + + 52 + Kamera wählen: + + + 53 + Mikrophon wählen: + + + 54 + ok + + + 55 + abbrechen + + + 56 + Sie müssen sich erneut verbinden damit die Änderungen wirksam werden. + + + 57 + Einstellungen ändern. + + + 58 + Kurs: + + + 59 + Kurssprache: + + + 60 + ok + + + 61 + abbrechen + + + 62 + Zeichenbrett leeren + + + 63 + Soll dass Zeichenbrett geleert werden bevor ein neues Bild hinzugefügt wird? + + + 64 + Nicht nochmal fragen + + + 65 + nein + + + 66 + Einstellungen bearbeiten + + + 67 + Bestätigung anfordern bevor das Zeichenbrett geleert wird. + + + 68 + User Info + + + 69 + Clear DrawArea + + + 70 + Undo + + + 71 + Redo + + + 72 + Select an Object + + + 73 + Text + + + 74 + Paint + + + 75 + Draw line + + + 76 + Draw underline + + + 77 + Rectangle + + + 78 + Ellipse + + + 79 + Arrow + + + 80 + delete chosen Item + + + 81 + Apply for moderation + + + 82 + apply + + + 83 + cancel + + + 84 + Become moderator + + + 85 + close + + + 86 + italic + + + 87 + bold + + + 88 + WAITING + + + 89 + A User wants to apply for moderation: + + + 90 + accept + + + 91 + reject + + + 92 + cancel + + + 93 + Sending request to following Users + + + 94 + Accepted + + + 95 + Rejected + + + 96 + Change Moderator + + + 97 + You are not moderating this course! + + + 98 + Moderator: + + + 99 + This Room is full. Sorry please try again later. + + + 100 + + + + 101 + close + + + 102 + loading + + + 103 + Please wait while loading + + + 104 + Synchronizing Conference Members + + diff --git a/main/webrooms/recorder.swf b/main/webrooms/recorder.swf new file mode 100644 index 0000000000..596513e3d9 Binary files /dev/null and b/main/webrooms/recorder.swf differ diff --git a/main/webrooms/videoconference.html b/main/webrooms/videoconference.html new file mode 100644 index 0000000000..82963f22b3 --- /dev/null +++ b/main/webrooms/videoconference.html @@ -0,0 +1,18 @@ + + + + + +Dokeos Videoconference + + + + + + + + diff --git a/main/webrooms/videoconference.swf b/main/webrooms/videoconference.swf new file mode 100644 index 0000000000..eb7dce8d3e Binary files /dev/null and b/main/webrooms/videoconference.swf differ diff --git a/main/webrooms/videoconference2.html b/main/webrooms/videoconference2.html new file mode 100644 index 0000000000..bc1127e0b6 --- /dev/null +++ b/main/webrooms/videoconference2.html @@ -0,0 +1,18 @@ + + + + + +Dokeos Videoconference + + + + + + + + diff --git a/main/webrooms/videoconference2.swf b/main/webrooms/videoconference2.swf new file mode 100644 index 0000000000..7eb61dadee Binary files /dev/null and b/main/webrooms/videoconference2.swf differ