From 2fa39544aaaade7fcc87b6f47f74a068be3f3238 Mon Sep 17 00:00:00 2001 From: Imanol Losada Date: Tue, 27 Jan 2015 15:43:53 -0500 Subject: [PATCH 1/8] Fix a few buy courses plugin issues - refs #7370 --- plugin/buycourses/lang/english.php | 1 + plugin/buycourses/lang/french.php | 1 + plugin/buycourses/lang/spanish.php | 1 + plugin/buycourses/src/buy_course.lib.php | 14 +++++++------- plugin/buycourses/src/configuration.php | 3 ++- plugin/buycourses/view/index.tpl | 16 ++++++++++++---- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/plugin/buycourses/lang/english.php b/plugin/buycourses/lang/english.php index ae2408d163..fa715aca2a 100644 --- a/plugin/buycourses/lang/english.php +++ b/plugin/buycourses/lang/english.php @@ -11,6 +11,7 @@ $strings['Private'] = "Private - access authorized only for course members"; $strings['CourseVisibilityClosed'] = "Closed - no access to this course"; $strings['OpenToThePlatform'] = "Open - access authorized only for users registered on the platform"; $strings['OpenToTheWorld'] = "Public - access open to anybody"; +$strings['CourseVisibilityHidden'] = "Hidden - Completely hidden to all users except the administrators"; $strings['Description'] = "Description"; $strings['Buy'] = "Buy"; $strings['Mostrar_disponibles'] = "Show available courses"; diff --git a/plugin/buycourses/lang/french.php b/plugin/buycourses/lang/french.php index 97c20312dc..0d152e8daa 100644 --- a/plugin/buycourses/lang/french.php +++ b/plugin/buycourses/lang/french.php @@ -11,6 +11,7 @@ $strings['Private'] = "Privé - Accès autorisé seulement aux inscrits au cours $strings['CourseVisibilityClosed'] = "Fermé - Pas d'accès au cours"; $strings['OpenToThePlatform'] = "Ouvert - Accès autorisé seulement pour les utilisateurs inscrits à la plateforme"; $strings['OpenToTheWorld'] = "Public - Accès autorisé à tous"; +$strings['CourseVisibilityHidden'] = "Invisible - Complètement invisible et inaccessible pour tous les utilisateurs excepté les administrateurs"; $strings['Description'] = "Description"; $strings['Buy'] = "Acheter"; $strings['Mostrar_disponibles'] = "Montrer les cours disponibles"; diff --git a/plugin/buycourses/lang/spanish.php b/plugin/buycourses/lang/spanish.php index 38ccef238f..5a3f4e8b1a 100644 --- a/plugin/buycourses/lang/spanish.php +++ b/plugin/buycourses/lang/spanish.php @@ -11,6 +11,7 @@ $strings['Private'] = "Privado - acceso autorizado sólo para los miembros $strings['CourseVisibilityClosed'] = "Cerrado - no hay acceso a este curso"; $strings['OpenToThePlatform'] = "Abierto - acceso autorizado sólo para los usuarios registrados en la plataforma"; $strings['OpenToTheWorld'] = "Público - acceso autorizado a cualquier persona"; +$strings['CourseVisibilityHidden'] = "Invisible - Totalmente invisible para todos los usuarios a parte de los administradores"; $strings['Description'] = "Descripción"; $strings['Buy'] = "Comprar"; $strings['Mostrar_disponibles'] = "Mostrar cursos disponibles"; diff --git a/plugin/buycourses/src/buy_course.lib.php b/plugin/buycourses/src/buy_course.lib.php index e3eb0b6a13..418298873a 100644 --- a/plugin/buycourses/src/buy_course.lib.php +++ b/plugin/buycourses/src/buy_course.lib.php @@ -126,7 +126,7 @@ function listCourses() $tableCourse = Database::get_main_table(TABLE_MAIN_COURSE); $sql = "SELECT a.course_id, a.visible, a.price, b.* FROM $tableBuyCourse a, $tableCourse b - WHERE a.course_id = b.id;"; + WHERE a.course_id = b.id AND a.session_id = 0;"; $res = Database::query($sql); $aux = array(); while ($row = Database::fetch_assoc($res)) { @@ -170,7 +170,7 @@ function userSessionList() // get course of current session $sql = "SELECT a.course_id, a.session_id, a.visible, a.price, b.* FROM $tableBuyCourse a, $tableCourse b - WHERE a.code = b.code AND a.code = '" . $rowSessionCourse['course_code'] . "' AND a.visible = 1;"; + WHERE a.code = b.code AND a.code = '" . $rowSessionCourse['course_code'] . "'"; $res = Database::query($sql); // loop inside a course of current session while ($row = Database::fetch_assoc($res)) { @@ -369,19 +369,19 @@ function getCourseVisibilityIcon($option) $style = 'margin-bottom:-5px;margin-right:5px;'; switch ($option) { case 0: - return Display::return_icon('bullet_red.gif', get_lang('CourseVisibilityClosed'), array('style' => $style)); + return Display::return_icon('bullet_red.gif', get_plugin_lang('CourseVisibilityClosed', 'BuyCoursesPlugin'), array('style' => $style)); break; case 1: - return Display::return_icon('bullet_orange.gif', get_lang('Private'), array('style' => $style)); + return Display::return_icon('bullet_orange.gif', get_plugin_lang('Private', 'BuyCoursesPlugin'), array('style' => $style)); break; case 2: - return Display::return_icon('bullet_green.gif', get_lang('OpenToThePlatform'), array('style' => $style)); + return Display::return_icon('bullet_green.gif', get_plugin_lang('OpenToThePlatform', 'BuyCoursesPlugin'), array('style' => $style)); break; case 3: - return Display::return_icon('bullet_blue.gif', get_lang('OpenToTheWorld'), array('style' => $style)); + return Display::return_icon('bullet_blue.gif', get_plugin_lang('OpenToTheWorld', 'BuyCoursesPlugin'), array('style' => $style)); break; default: - return ''; + return Display::return_icon('bullet_grey.gif', get_plugin_lang('CourseVisibilityHidden', 'BuyCoursesPlugin'), array('style' => $style));; } } /** diff --git a/plugin/buycourses/src/configuration.php b/plugin/buycourses/src/configuration.php index 5f84896ca1..bb596eef9d 100644 --- a/plugin/buycourses/src/configuration.php +++ b/plugin/buycourses/src/configuration.php @@ -21,7 +21,7 @@ $interbreadcrumb[] = array("url" => "paymentsetup.php", "name" => get_lang('Conf $tpl = new Template($templateName); $teacher = api_is_platform_admin(); -api_protect_course_script(true); +//api_protect_course_script(true); if ($teacher) { // sync course table with the plugin @@ -31,6 +31,7 @@ if ($teacher) { $visibility[] = getCourseVisibilityIcon('1'); $visibility[] = getCourseVisibilityIcon('2'); $visibility[] = getCourseVisibilityIcon('3'); + $visibility[] = getCourseVisibilityIcon('4'); $coursesList = listCourses(); $confirmationImgPath = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/img/32/accept.png'; diff --git a/plugin/buycourses/view/index.tpl b/plugin/buycourses/view/index.tpl index 8e671f214e..80aed3709c 100644 --- a/plugin/buycourses/view/index.tpl +++ b/plugin/buycourses/view/index.tpl @@ -26,7 +26,9 @@
- + + + @@ -35,7 +37,9 @@ {% if isAdmin == 'true' %}
- + + + From 5fe3e21d0a8da4d04e6fc9d97e468ff23fdbf947 Mon Sep 17 00:00:00 2001 From: Imanol Losada Date: Tue, 27 Jan 2015 16:18:37 -0500 Subject: [PATCH 2/8] Enable course protection script - refs #7370 --- plugin/buycourses/src/configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/buycourses/src/configuration.php b/plugin/buycourses/src/configuration.php index bb596eef9d..da48a808ca 100644 --- a/plugin/buycourses/src/configuration.php +++ b/plugin/buycourses/src/configuration.php @@ -21,7 +21,7 @@ $interbreadcrumb[] = array("url" => "paymentsetup.php", "name" => get_lang('Conf $tpl = new Template($templateName); $teacher = api_is_platform_admin(); -//api_protect_course_script(true); +api_protect_course_script(true); if ($teacher) { // sync course table with the plugin From 68ce8d755a6e5a7f4c7ed01e21d6bd87d5edeff6 Mon Sep 17 00:00:00 2001 From: Imanol Losada Date: Wed, 28 Jan 2015 08:27:37 -0500 Subject: [PATCH 3/8] Replace api_protect_course_script with api_protect_admin_script - refs #7370 --- plugin/buycourses/src/configuration.php | 2 +- plugin/buycourses/src/paymentsetup.php | 2 +- plugin/buycourses/src/pending_orders.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/buycourses/src/configuration.php b/plugin/buycourses/src/configuration.php index da48a808ca..9010434d09 100644 --- a/plugin/buycourses/src/configuration.php +++ b/plugin/buycourses/src/configuration.php @@ -21,7 +21,7 @@ $interbreadcrumb[] = array("url" => "paymentsetup.php", "name" => get_lang('Conf $tpl = new Template($templateName); $teacher = api_is_platform_admin(); -api_protect_course_script(true); +api_protect_admin_script(true); if ($teacher) { // sync course table with the plugin diff --git a/plugin/buycourses/src/paymentsetup.php b/plugin/buycourses/src/paymentsetup.php index 6310008fda..fe6d2a1f98 100644 --- a/plugin/buycourses/src/paymentsetup.php +++ b/plugin/buycourses/src/paymentsetup.php @@ -18,7 +18,7 @@ $interbreadcrumb[] = array("url" => "configuration.php", "name" => $plugin->get_ $tpl = new Template($templateName); $teacher = api_is_platform_admin(); -api_protect_course_script(true); +api_protect_admin_script(true); if ($teacher) { // Sync course table with the plugin diff --git a/plugin/buycourses/src/pending_orders.php b/plugin/buycourses/src/pending_orders.php index 4d80fd55ef..d844ab9046 100644 --- a/plugin/buycourses/src/pending_orders.php +++ b/plugin/buycourses/src/pending_orders.php @@ -19,7 +19,7 @@ $interbreadcrumb[] = array("url" => "paymentsetup.php", "name" => $plugin->get_l $tpl = new Template($tableName); $teacher = api_is_platform_admin(); -api_protect_course_script(true); +api_protect_admin_script(true); if ($teacher) { $pendingList = pendingList($_SESSION['bc_codetext']); From c641adb6e19ab0ddf6e81f4fdac4b90b55a21199 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 19 Mar 2015 13:58:01 +0100 Subject: [PATCH 4/8] Fix ribbon see BT#9573 --- main/css/base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/css/base.css b/main/css/base.css index 7689e46d54..c18c900e1c 100755 --- a/main/css/base.css +++ b/main/css/base.css @@ -2915,7 +2915,7 @@ div.admin_section h4 { } .ribbon .rib-total { - width: 275px; + width: 275px !important; } .ribbon .rib-error, .ribbon .ribbon-total-error { From ad5d2d6041a4e50cf554379164787bd7b34567cd Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 19 Mar 2015 12:23:19 -0500 Subject: [PATCH 5/8] Update changelog to 1.9.10.2 --- documentation/changelog.html | 70 ++++++++++++++++++++++++++++++++++++ main/install/index.php | 2 +- main/install/version.php | 2 +- 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index d0ee4dd90f..22630d817e 100755 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -44,6 +44,76 @@

Note: most #wxyz references are issue numbers you can find in our public bug tracking system. Some references marked BT#xyz are developments made externally for BeezNest customers and integrated into Chamilo. The details of these tasks cannot be seen for confidentiality reasons, but the code change is public and can be reviewed by anyone.

 

+ +

Chamilo 1.9.10.2 - Sipán, 19th of March, 2015

+

Release notes - summary

+

Chamilo 1.9.10.2 is a patch (minor) version of the 1.9.x branch, with + bugfixes and a few new minor features, but more importantly fixes for + vulnerabilities discovered in 1.9.10 and previous versions (as such, you + can just overwrite previous files to upgrade from 1.9.8, 1.9.8.1 or + 1.9.8.2 to 1.9.10.2).

+

See our Security page for more information.

+

Release name

+

Sipán + is a small city on the Peruvian Coast where the remains of the Lord of Sipán + (a ruler of the 3rd century AC) were discovered in 1987. It held many well-conserved + offerings. We believe this version of Chamilo, containing additional fixes on + top of an excellent 1.9.10 version, has its fair share of common points with Sipán.

+

Security fixes

+ +

Improvements (minor features) and debug

+ + +

Chamilo 1.9.10 - Huánuco, 25th of January, 2015

Release notes - summary

Chamilo 1.9.10 is a new minor version of the 1.9.x branch, with many bugfixes and a few interesting new features (as such, you can just overwrite previous files to upgrade from 1.9.8, 1.9.8.1 or 1.9.8.2 to 1.9.10).

diff --git a/main/install/index.php b/main/install/index.php index 2fb77d01b9..7355ea9f07 100755 --- a/main/install/index.php +++ b/main/install/index.php @@ -111,7 +111,7 @@ error_reporting(E_ALL); // Upgrading from any subversion of 1.6 is just like upgrading from 1.6.5 $update_from_version_6 = array('1.6', '1.6.1', '1.6.2', '1.6.3', '1.6.4', '1.6.5'); // Upgrading from any subversion of 1.8 avoids the additional step of upgrading from 1.6 -$update_from_version_8 = array('1.8', '1.8.2', '1.8.3', '1.8.4', '1.8.5', '1.8.6', '1.8.6.1', '1.8.6.2','1.8.7','1.8.7.1','1.8.8','1.8.8.2', '1.8.8.4', '1.8.8.6', '1.9.0', '1.9.2','1.9.4','1.9.6', '1.9.6.1'); +$update_from_version_8 = array('1.8', '1.8.2', '1.8.3', '1.8.4', '1.8.5', '1.8.6', '1.8.6.1', '1.8.6.2','1.8.7','1.8.7.1','1.8.8','1.8.8.2', '1.8.8.4', '1.8.8.6', '1.9.0', '1.9.2','1.9.4','1.9.6', '1.9.6.1', '1.9.8', '1.9.10'); $my_old_version = ''; $tmp_version = get_config_param('dokeos_version'); diff --git a/main/install/version.php b/main/install/version.php index 0bd55a4ce8..6e8a87f6fd 100755 --- a/main/install/version.php +++ b/main/install/version.php @@ -12,7 +12,7 @@ /** * Variables used from the main/install/index.php */ -$new_version = '1.9.10'; +$new_version = '1.9.10.2'; $new_version_status = 'stable'; $new_version_last_id = 0; $new_version_stable = true; From d93b95f83d75b1c6c910c27d127f07fc0497c666 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 22 Mar 2015 01:31:26 -0500 Subject: [PATCH 6/8] Minor session icon edition (fuzzy icon otherwise) --- main/inc/lib/userportal.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 84944005a6..83614497c6 100755 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -1111,7 +1111,7 @@ class IndexManager 'window_list.png', $session_box['title'], array('id' => 'session_img_' . $session_id), - ICON_SIZE_LARGE + ICON_SIZE_BIG ); $extra_info = !empty($session_box['coach']) ? $session_box['coach'] : null; $extra_info .= !empty($session_box['coach']) ? ' - '.$session_box['dates'] : $session_box['dates']; @@ -1244,7 +1244,8 @@ class IndexManager 'width' => '48px', 'align' => 'absmiddle', 'id' => 'session_img_' . $session_id - ) + ), + ICON_SIZE_BIG ) . ' '; if (api_is_drh()) { From 241096206294efc1c36deb1d58137c4649899984 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 22 Mar 2015 01:39:35 -0500 Subject: [PATCH 7/8] Fix issue in course advance showing title of first module in "next topic" section on course homepage --- main/inc/introductionSection.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/introductionSection.inc.php b/main/inc/introductionSection.inc.php index 6f4595df45..f215b88777 100755 --- a/main/inc/introductionSection.inc.php +++ b/main/inc/introductionSection.inc.php @@ -324,7 +324,7 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) { $thematic_description_html .= '
'.$subTitle2.'
-

'.$thematic_info['title'].'

+

'.$thematic_info2['title'].'

'.$thematic_advance_info2['start_date'].'

'.$thematic_advance_info2['content'].'

'.get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - '.get_lang('SeeDetail').'

From ada067400b2ab78857224b8be122b367ce76d49a Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 23 Mar 2015 10:41:42 +0100 Subject: [PATCH 8/8] Fix condition. --- main/tracking/courseLog.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main/tracking/courseLog.php b/main/tracking/courseLog.php index bb48059ad2..2200f0ee11 100755 --- a/main/tracking/courseLog.php +++ b/main/tracking/courseLog.php @@ -50,21 +50,28 @@ if (api_is_drh()) { if (api_drh_can_access_all_session_content()) { // If the drh has been configured to be allowed to see all session content, give him access to the session courses $coursesFromSession = SessionManager::getAllCoursesFollowedByUser(api_get_user_id(), null); + + $coursesFromSessionCodeList = array(); if (!empty($coursesFromSession)) { - $coursesFromSession = array_keys($coursesFromSession); + foreach ($coursesFromSession as $course) { + $coursesFromSessionCodeList[$course['code']] = $course['code']; + } } $coursesFollowedList = CourseManager::get_courses_followed_by_drh(api_get_user_id()); + if (!empty($coursesFollowedList)) { $coursesFollowedList = array_keys($coursesFollowedList); } + if (!in_array($courseCode, $coursesFollowedList)) { - if (!in_array($courseCode, $coursesFromSession)) { + if (!in_array($courseCode, $coursesFromSessionCodeList)) { api_not_allowed(); } } } else { - // If the drh has *not* been configured to be allowed to see all session content, then check if he has also been given access to the corresponding courses + // If the drh has *not* been configured to be allowed to see all session content, + // then check if he has also been given access to the corresponding courses $coursesFollowedList = CourseManager::get_courses_followed_by_drh(api_get_user_id()); $coursesFollowedList = array_keys($coursesFollowedList); if (!in_array(api_get_course_id(), $coursesFollowedList)) {