From 352378ac99203d15ce704f450a9405da56ce6d19 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 20 Oct 2011 09:57:36 -0500 Subject: [PATCH 1/8] Added error_log when e-mail sending fails - this will enable much faster debug on remote servers --- main/inc/lib/mail.lib.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 main/inc/lib/mail.lib.inc.php diff --git a/main/inc/lib/mail.lib.inc.php b/main/inc/lib/mail.lib.inc.php old mode 100755 new mode 100644 index d3baa4a94b..bf8ae96195 --- a/main/inc/lib/mail.lib.inc.php +++ b/main/inc/lib/mail.lib.inc.php @@ -88,7 +88,7 @@ function api_mail($recipient_name, $recipient_email, $subject, $message, $sender // Send the mail message. if (!$mail->Send()) { - //echo 'ERROR: mail not sent to '.$recipient_name.' ('.$recipient_email.') because of '.$mail->ErrorInfo.'
'; + error_log('ERROR: mail not sent to '.$recipient_name.' ('.$recipient_email.') because of '.$mail->ErrorInfo.'
'); return 0; } From aa018e4621f689368716144c7c48282f4e5b79b7 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 20 Oct 2011 14:02:38 -0500 Subject: [PATCH 2/8] Moved 404 page to a better place --- 404/index.php => 404.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 404/index.php => 404.php (100%) diff --git a/404/index.php b/404.php similarity index 100% rename from 404/index.php rename to 404.php From f7a80950a34909d46ca20f32126a288772ebe07b Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 20 Oct 2011 14:12:15 -0500 Subject: [PATCH 3/8] Rename constant (bad English name) --- main/course_home/activity.php | 2 +- main/course_home/course_home.php | 2 +- main/course_home/vertical_activity.php | 2 +- main/inc/lib/course_home.lib.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) mode change 100755 => 100644 main/course_home/activity.php mode change 100755 => 100644 main/course_home/vertical_activity.php diff --git a/main/course_home/activity.php b/main/course_home/activity.php old mode 100755 new mode 100644 index c34cf58677..b274d27711 --- a/main/course_home/activity.php +++ b/main/course_home/activity.php @@ -120,7 +120,7 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) { if ($theme == 'activity_big') { $rows = 4; } - $my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATEFORM); + $my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM); CourseHome::show_tools_category($my_list, $rows); ?> diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php index d1e31cfe9a..13c16a27f1 100644 --- a/main/course_home/course_home.php +++ b/main/course_home/course_home.php @@ -134,7 +134,7 @@ define('TOOL_AUTHORING', 'toolauthoring'); define('TOOL_INTERACTION', 'toolinteraction'); define('TOOL_COURSE_PLUGIN', 'toolcourseplugin'); //all plugins that can be enabled in courses define('TOOL_ADMIN', 'tooladmin'); -define('TOOL_ADMIN_PLATEFORM', 'tooladminplatform'); +define('TOOL_ADMIN_PLATFORM', 'tooladminplatform'); //define('TOOL_ADMIN_PLATFORM_VISIBLE', 'tooladminplatformvisible'); //define('TOOL_ADMIN_PLATFORM_INVISIBLE', 'tooladminplatforminvisible'); diff --git a/main/course_home/vertical_activity.php b/main/course_home/vertical_activity.php old mode 100755 new mode 100644 index 5f0eb66c56..b6e1f9ad4c --- a/main/course_home/vertical_activity.php +++ b/main/course_home/vertical_activity.php @@ -132,7 +132,7 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) {
diff --git a/main/inc/lib/course_home.lib.php b/main/inc/lib/course_home.lib.php index 6e382a724b..7cd03a3db3 100644 --- a/main/inc/lib/course_home.lib.php +++ b/main/inc/lib/course_home.lib.php @@ -461,7 +461,7 @@ class CourseHome { $result = Database::query($sql); $col_link ="##003399"; break; - case TOOL_ADMIN_PLATEFORM: + case TOOL_ADMIN_PLATFORM: $sql = "SELECT * FROM $course_tool_table WHERE category = 'admin' $condition_session ORDER BY id"; $result = Database::query($sql); $col_link ="##003399"; From d1df0bcca1fbdb4b2375b4851f53ffce99fb5959 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 20 Oct 2011 14:16:12 -0500 Subject: [PATCH 4/8] Small fix to code style --- main/course_home/course_home.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php index 13c16a27f1..9a03278600 100644 --- a/main/course_home/course_home.php +++ b/main/course_home/course_home.php @@ -159,11 +159,11 @@ api_session_unregister('toolgroup'); $is_speacialcourse = CourseManager::is_special_course($course_code); -if ($is_speacialcourse){ - $autoreg = Security::remove_XSS($_GET['autoreg']); - if ($autoreg == 1) { - CourseManager::subscribe_user($user_id, $course_code, $status = STUDENT); - } +if ($is_speacialcourse) { + $autoreg = Security::remove_XSS($_GET['autoreg']); + if ($autoreg == 1) { + CourseManager::subscribe_user($user_id, $course_code, $status = STUDENT); + } } /* Is the user allowed here? */ From 6499f7acad6d15e890a975674c7751a20a237739 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 20 Oct 2011 14:16:38 -0500 Subject: [PATCH 5/8] Small fix to code style --- main/course_home/course_home.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php index 9a03278600..863936a778 100644 --- a/main/course_home/course_home.php +++ b/main/course_home/course_home.php @@ -111,7 +111,7 @@ if (!isset($cidReq)) { $classError = 'init'; $error_no[$classError][] = '2'; $error_level[$classError][] = 'info'; - $error_msg[$classError][] = "[".__FILE__."][".__LINE__."] cidReq was Missing $cidReq take $dbname;"; + $error_msg[$classError][] = "[".__FILE__."][".__LINE__."] cidReq was missing $cidReq take $dbname;"; } if (isset($_SESSION['_gid'])) { From 882811e1c0e37394c6917b01bbf3554c317dc00f Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 20 Oct 2011 15:15:14 -0500 Subject: [PATCH 6/8] Minor - Preparing for Postgresql layer: integer fields cannot be surrounded by quotes. --- main/course_home/activity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/course_home/activity.php b/main/course_home/activity.php index b274d27711..10b5bc730f 100644 --- a/main/course_home/activity.php +++ b/main/course_home/activity.php @@ -20,13 +20,13 @@ require_once api_get_path(LIBRARY_PATH).'course_home.lib.php'; if (api_is_allowed_to_edit(null, true)) { // HIDE if (!empty($_GET['hide'])) { - $sql = "UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."'"; + $sql = "UPDATE $tool_table SET visibility=0 WHERE id=".intval($_GET['id']); Database::query($sql); Display::display_confirmation_message(get_lang('ToolIsNowHidden')); } elseif (!empty($_GET['restore'])) { // visibility 0,2 -> 1 // REACTIVATE - $sql = "UPDATE $tool_table SET visibility=1 WHERE id='".intval($_GET["id"])."'"; + $sql = "UPDATE $tool_table SET visibility=1 WHERE id=".intval($_GET['id']); Database::query($sql); Display::display_confirmation_message(get_lang('ToolIsNowVisible')); } From a759e5bb09b9096bc00f78eef3143b878ae409b8 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 21 Oct 2011 00:31:02 -0500 Subject: [PATCH 7/8] Applied for buggy BBB where running status is always false. Also, implemented getRunningMeetings() and getMeetingInfo() --- plugin/bbb/bbb.lib.php | 61 +++++++++++++++++++++++++++++++++++++++--- plugin/bbb/start.php | 30 ++++++++++++++++++++- 2 files changed, 87 insertions(+), 4 deletions(-) diff --git a/plugin/bbb/bbb.lib.php b/plugin/bbb/bbb.lib.php index 89267309b4..243bb019bd 100644 --- a/plugin/bbb/bbb.lib.php +++ b/plugin/bbb/bbb.lib.php @@ -183,7 +183,6 @@ function wc_isMeetingRunningURL($myIP,$mySecuritySalt,$myMeetingID) { $queryStr = "meetingID=".$myMeetingID; $checksum = sha1('isMeetingRunning'.$queryStr.$mySecuritySalt); $secQueryURL = "http://".$myIP.$checkAPI.$queryStr."&checksum=".$checksum; - return $secQueryURL; } @@ -276,8 +275,35 @@ function wc_listAttendees() { /** * This API is not yet supported in bigbluebutton */ -function wc_getMeetingInfo() { - return false; +function wc_getMeetingInfo($myIP,$mySecuritySalt,$meetingID,$modPW) { + $checkAPI = "/bigbluebutton/api/getMeetingInfo?"; + $queryStr = 'meetingID='.$meetingID.'&password='.$modPW; + $checksum = sha1('getMeetingInfo'.$queryStr.$mySecuritySalt); + $secQueryURL = "http://".$myIP.$checkAPI.$queryStr."&checksum=".$checksum; + $myResponse = @file_get_contents($secQueryURL); + if ($myResponse === false) { return false;} + $doc = new DOMDocument(); + $doc->loadXML($myResponse); + $returnCodeNode = $doc->getElementsByTagName("returncode"); + $returnCode = $returnCodeNode->item(0)->nodeValue; + $createTimeNode = $doc->getElementsByTagName("createTime"); + $createTime = $createTimeNode->item(0)->nodeValue; + $runningNode = $doc->getElementsByTagName("running"); + $running = $runningNode->item(0)->nodeValue; + $attendeesNode = $doc->getElementsByTagName("attendee"); + $attendees = array(); + foreach ($attendeesNode as $attendeeNode) { + $attendee = array(); + if ($attendeeNode->childNodes->length) { + foreach ($attendeeNode->childNodes as $i) { + //see http://code.google.com/p/bigbluebutton/wiki/API#Get_Meeting_Info for details + $attendee[$i->nodeName] = $i->nodeValue; + } + } + $attendees[] = $attendee; + } + $info = array('returnCode'=>$returnCode,'createTime'=>$createTime,'attendees'=>$attendees,'running'=>$running); + return $info; } /** @@ -313,3 +339,32 @@ function wc_needUpgrade() { } return $returnValue; } + +/** + * Gets a list of all meetings currently running + */ +function wc_getRunningMeetings($myIP,$mySecuritySalt) { + $checkAPI = "/bigbluebutton/api/getMeetings?"; + $queryStr = ''; + $checksum = sha1('getMeetings'.$queryStr.$mySecuritySalt); + $secQueryURL = "http://".$myIP.$checkAPI.$queryStr."&checksum=".$checksum; + $myResponse = @file_get_contents($secQueryURL); + if ($myResponse === false) { return false;} + $doc = new DOMDocument(); + $doc->loadXML($myResponse); + $returnCodeNode = $doc->getElementsByTagName("returncode"); + $returnCode = $returnCodeNode->item(0)->nodeValue; + $meetingsNode = $doc->getElementsByTagName("meeting"); + $meetings = array(); + foreach ($meetingsNode as $meetingNode) { + $meeting = array(); + if ($meetingNode->childNodes->length) { + foreach ($meetingNode->childNodes as $i) { + //see http://code.google.com/p/bigbluebutton/wiki/API#Get_Meetings for details + $meeting[$i->nodeName] = $i->nodeValue; + } + } + $meetings[] = $meeting; + } + return $meetings; +} diff --git a/plugin/bbb/start.php b/plugin/bbb/start.php index 2436dc65bd..ff1a61d7fd 100644 --- a/plugin/bbb/start.php +++ b/plugin/bbb/start.php @@ -44,12 +44,40 @@ $user_id = api_get_user_id(); $is_running = wc_isMeetingRunning($bbb_host,$bbb_salt,$meeting_name); if ($is_running == 'true') { + // The conference is running, everything is fine, join header('location: '.wc_joinMeetingURL($bbb_host,$bbb_salt,$full_user_name,$meeting_name,($teacher?$meeting_mod_pw:$meeting_att_pw),$user_id)); + exit; } else { //$is_running = false or 'false' + // The conference room does not seem to be running... + // First, try harder and ignore the "running" status + $meetings = wc_getRunningMeetings($bbb_host,$bbb_salt); + $found = false; + foreach ($meetings as $meeting) { + //Try to find our meeting room in the list... + if ($meeting['meetingID'] == $meeting_name) { + $meeting_info = wc_getMeetingInfo($bbb_host,$bbb_salt,$meeting_name,$meeting_mod_pw); + error_log('Found passive meeting created '.($meeting_info['createTime']).' seconds ago with '.count($meeting_info['attendees']).' attendees - joining as '.($teacher?'teacher':'student')); + //if the user is a teacher, or if there are already attendees in + // the conference room, then allow joining it + if ($teacher or count($meeting_info['attendees'])>0) { + header('location: '.wc_joinMeetingURL($bbb_host,$bbb_salt,$full_user_name,$meeting_name,($teacher?$meeting_mod_pw:$meeting_att_pw),$user_id)); + exit; + } + } + } + // That conference room is really not running or it has no + // accompanying moderator subscribed if ($teacher) { + // The user is a teacher, so he has the right to create the + // room, so create it and join it wc_createMeeting($bbb_host,$bbb_salt,$meeting_name,$meeting_name,$meeting_att_pw,$meeting_mod_pw,$meeting_wel_ms,api_get_path(WEB_COURSE_PATH).'/'.$ccode); - header('location: '.wc_joinMeetingURL($bbb_host,$bbb_salt,$full_user_name,$meeting_name,$meeting_mod_pw,$user_id)); + header('location: '.wc_joinMeetingURL($bbb_host,$bbb_salt,$full_user_name,$meeting_name,($teacher?$meeting_mod_pw:$meeting_att_pw),$user_id)); + exit; } else { + // There is no conference room for this course and the user + // is a mere student, so he cannot start a conference room by + // himself: a teacher has to launch it first header('location: '.api_get_path(WEB_COURSE_PATH).'/'.$ccode); + exit; } } From b48f55edbe2526a897d2a0cbb1018a27caa095ed Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 21 Oct 2011 00:45:00 -0500 Subject: [PATCH 8/8] Updated documentation --- documentation/changelog.html | 5 +++ documentation/migration-checklist.html | 62 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 documentation/migration-checklist.html diff --git a/documentation/changelog.html b/documentation/changelog.html index 504f5a6b62..337df1a9d7 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -110,6 +110,11 @@ This version of Chamilo only includes new features:
+
  • Videoconference +
      +
    • A fix was applied to avoid a bug in BigBlueButton by which all videoconference rooms are marked as "not running" (BT#3102). Financed by NoSoloRed
    • +
    +
  • Style changes
      diff --git a/documentation/migration-checklist.html b/documentation/migration-checklist.html new file mode 100644 index 0000000000..b58961f5fd --- /dev/null +++ b/documentation/migration-checklist.html @@ -0,0 +1,62 @@ + + + + + Chamilo Migration Checklist + + + + + +
      +

      Chamilo Migration Checklist

      +
      + +Documentation > Migration checklist +
      +
      + +

      In seldom cases, Chamilo will generate a series of problems after a migration. This list is a helper designed mainly by BeezNest after its many migration jobs assisting large companies to migrate this critical piece of software.

      + + +

      Contents

      + +
        + +
      1. Version specific issues
      2. +
      3. Documents
      4. +
      5. Database entries
      6. +
      + +

      1. Version specific issues

      +

      Sadly, some issues happen over certain migrations and, so far, the difficulty of fixing things is still less than the difficulty of knowing exactly what to do to improve the migration script for all scenarios

      +

      2. Documents

      +
        +
      • The worst that could happen is a change of codification while migrating from 1.8.5 to 1.8.8.4. Codification problems are nightmares because you generally get a limited number of characters you can freely change without affecting already existing files. Scrips can be made to ananlyse and fix most of the problems, but you will still need a lot of manual review before you can be sure you eliminated all problems
      • +
      +

      3. Database entries

      +
        +
      • Some users reported problems with quizzes: when migrating from 1.8.5 to 1.8.8.4, the quiz_question table has a question_order field filled with 1's. This generates a bug when using exercises marked random, as you only ever get one question to the test. Solution: update the question_order field to have sequential numbers.
      • +
      • +
      + + +
      +Don't have time or resources to optimize your Chamilo installation yourself? Hire an official Chamilo provider and get it sorted out professionally by specialists. + Valid XHTML 1.0 Transitional + + Valid CSS + +
      +

      Authors

      + +