From 621fefae922bef53a35adcfc9847d4d9c2a67d3f Mon Sep 17 00:00:00 2001
From: jmontoyaa 1. Using opcaches
@@ -598,13 +599,42 @@ In 1.10.0, we have added the possibility to enable this compression very
This should have an immediate effect on the load average on your server.
+ As your use of Chamilo increases and you get above the thousands of users,
+ you're likely to hit a few milestones set by PHP to avoid hacks.
+ One of them is PHP5.4's Suhosin extension limit post_max_vars, which was
+ extended into PHP5.5 and above through the max_input_vars limit. This limit
+ is usually set to 1000. What does it mean?
+ It means that, when you manipulate any list greater than 1000 items, PHP will
+ automatically remove anything sent above the first 1000 registers (usually
+ a little bit less because it needs to add the other input fields of the page).
+ For example, if subscribing 5 new users to a course where you already have
+ 1000 users subscribed, you will remain at 1000, although the 1000 will not
+ necessarily be the 1000 that were there in the first place (they are sent
+ in order of the elements inside the form, so probably alphabetically,
+ depending on the page).
+ Increasing this limit to a higher level (say 10,000 instead of 1000) should
+ be relatively safe, considering your application is normally not open to
+ the public (and so also open to the evil kind of users). So, in your
+ php.ini, this limit should now look like this:
+
+ max_input_vars = 10000 +
NIbg*HtuBvJ}-LlHFr zhOXfl8kVl135X&^WIE&xgKD+Qj_r3Z-RQF_Kq3(zX}JMC3Tke^=;;||>K-G7IJ<{4 z#7!LlUq-lrr0q+ZZb;J$Y59_d7Z61t1o&Y{IuTKclsDYpzpy3%$FfFRfucO$fJu80(jl- z;Mv8HPaPWMjma8+nW6&~t%hX!JM+J+^@m5JZYFT85A^0wATjbh}*~+nQJt zz?Z)EO}o0ZnA^R1h#&r8g87z@t}Tac<-VdoMpWBAm6nff2ojcoyao{|KxkxzOTF15 znM#bW31H`k?&z!4YK&e`cxLh@(_2Xs5J*L>8?Z8669T0PvYJP;)n@(1p^LW#_|bDe zBOZ6wO;2A%WHyi#8ZuHu*Gj4)P$-nTHHe`JQjS5=(lK?75Q9R?!*e}KeWeMd6hesA z0Y3BS5nlfFs~gLW4(m4-P=SvO6=4`HUs54MNf<`RYn#&woULn=Qa1UxManU-bPX?p z?5sx>*t})S)Q#q=wm=9r*CNT#P==t}T{a4q(=KI%3>1Ns%j0WsC`Bn|QA$|k9g~!; zV+ujDn4BjiBNp!vM>+%D2qSyI;KY%i|n=_|Wsf z^8jZj%GUY6y}6~+>FlyBdtYOzvcp_-x0TQRDIS_JDxQnX=J5(e!hv-->(-IWq$xQD zY2aL^f$w?PiR8?h01iKV=pUXxxS`|&Z!4wFKKcD0v}R|o&JGWM;9FByXTCdq^-ABs zx*_s`PwnlusHS?D3ni}$L2tgq(9kgRm3dsZOTKU5!kPeXrJuiieAg47f8uz%*~m>z zUE$Qp-!3o12$mKX5ePI*$1qJa%i`$KqhGBwr|zDbJ-f@T`Wr0UVPxxF&-}~3WB^Z( zzPSC=?_ND!U09%6tzz32&1Q>sr-SSHNGUN4lT ro25V&rKR3b(u zoxpWHYPB|V 0*N4Epnr&;JpCMp9(w4{zVAPJ;`l2U0rj5(+!SEbvU`tw z;*)p9V%C1!w)Uq}$$Jv<*uXpQj3LpU8h!SeFF)|$gNv`7IPsnzq{OuqmD#yx@AgLy jA9(;synnv@ztG kdg00002VoOIv0RM-N z%)bBt010qNS#tmY3ljhU3ljkVnw%H_000McNliru-~|c@Di@z-#$f;e14BtfK~zY` z-IYsh8$}q$f3v$@uh;81kGf4Apl>UsJW`a3lt{hs5QrXlTncBzwHHnt5T~Btg18`Y zLqNm Osv_st9b zQ}!hQ7w$_Vc6NVy%c|68%5#^?AN&6bP;7mX%8_F){VVnYCI4n)x>0mX)#W$be*kzt zd!|;wq0AChJTxpaWErH7R6|>qrJxv2%bR*>&)k!>9)PcoXa59?h>!?LOhk(sRaS6m zBQQzfuph-lcA^1bYzOo| daEc zM|DCJXe2NY#OP#LU~FwevjgB9^@wTl3v2A-FeVTY65!(z;Gqz-$q@(nY7c;Uv`v}s z8RZEg0zyInG!h6BgtTcBVn9Wx9)S2joifiLy4gcaOpHVlAv+$0HovLa0q{m{^CCs& zaEUv)8>FxhL`WiHK;V;{?E!c RCg0MR!WgXM^VFNcy@EF3wWLH4%InG z)X6sLmMtR2Ad7>Afn*&h%!}PM5XagS@H@io7)1sLha`d)Gw7VI^eAFjP^@AzK$4iC za~~uT3DRV+u`swzj9C+{UVyJpXu-+ak&+f-Vc{@H27?GeiWD|!bXJHk%Uh~0;2X|P zF$FW`?}gU5Ik9#!e&m|1)52khJQ)T^W8f2DFZBSN?X-v5TvLC1*j!pZ@ZS6fi^C%* zZjm7Z_V6GTeD+=M0obx{$IoAMhvvD0La~ZKkig*FJGI9a#_I=@6h8gSCk>{?e)z4* z3Q63~eMsOi#4M+7<$mnD^3?TwbM)#x0B $5c5xc@cYtn*&B0e6PEDGV*~jht4b(@Uzy0j$rThM{1P1-5#$I}wH2+7t19)Xr U&bGy3m;e9(07*qoM6N<$g4C3zjsO4v literal 0 HcmV?d00001 diff --git a/plugin/bbb/changelog.md b/plugin/bbb/changelog.md index 86ed797e33..edf37fe39f 100644 --- a/plugin/bbb/changelog.md +++ b/plugin/bbb/changelog.md @@ -1,16 +1,17 @@ -Version 2.4 +Version 2.4 2016-05 ------------------------ Changes: -* Global conference support (Requires to turn on, in plugin settings) -* Course group conference support. - * Requires a DB change: "ALTER TABLE plugin_bbb_meeting ADD COLUMN group_id INT DEFAULT 0" +* Global conference support (Requires to update the plugin settings). +* Course group conference support + * Requires a database change: "ALTER TABLE plugin_bbb_meeting ADD COLUMN group_id INT DEFAULT 0" + * Requires to update the plugin settings. Version 2.3 - 2015-05-18 ------------------------ Changes: * Added support for variable voiceBridge to be sent on meeting creation. See https://code.google.com/p/bigbluebutton/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Component%20Summary&groupby=&sort=&id=1186 and https://support.chamilo.org/issues/7669 for details. -* Requires a DB change: "ALTER TABLE plugin_bbb_meeting ADD COLUMN voice_bridge INT NOT NULL DEFAULT 1;" +* Requires a database change: "ALTER TABLE plugin_bbb_meeting ADD COLUMN voice_bridge INT NOT NULL DEFAULT 1;" Version 2.2 - 2014-10-15 ------------------------ diff --git a/plugin/bbb/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index 10b35ac0f4..8c7597521a 100755 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -53,6 +53,10 @@ class bbb $columns = Database::listTableColumns($this->table); $this->groupSupport = isset($columns['group_id']) ? true : false; + if ($this->groupSupport) { + $this->groupSupport = (bool) $plugin->get('enable_conference_in_course_groups'); + } + if ($bbbPlugin === true) { $userInfo = api_get_user_info(); $this->user_complete_name = $userInfo['complete_name']; @@ -998,7 +1002,7 @@ class bbb return api_get_course_id().'-'.api_get_session_id().'-'.api_get_group_id(); } - + return api_get_course_id().'-'.api_get_session_id(); } diff --git a/plugin/bbb/lib/bbb_plugin.class.php b/plugin/bbb/lib/bbb_plugin.class.php index 9e7ff4e75a..fd7bb6df51 100755 --- a/plugin/bbb/lib/bbb_plugin.class.php +++ b/plugin/bbb/lib/bbb_plugin.class.php @@ -37,6 +37,7 @@ class BBBPlugin extends Plugin 'host' => 'text', 'salt' => 'text', 'enable_global_conference' => 'boolean', + 'enable_conference_in_course_groups' => 'boolean', ] ); } @@ -76,7 +77,7 @@ class BBBPlugin extends Plugin )"; Database::query($sql); - //Installing course settings + // Installing course settings $this->install_course_fields_in_all_courses(); } @@ -89,25 +90,26 @@ class BBBPlugin extends Plugin $t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS); $t_tool = Database::get_course_table(TABLE_TOOL_LIST); - // New settings - $sql = "DELETE FROM $t_settings WHERE variable = 'bbb_tool_enable'"; - Database::query($sql); - $sql = "DELETE FROM $t_settings WHERE variable = 'bbb_salt'"; - Database::query($sql); - $sql = "DELETE FROM $t_settings WHERE variable = 'bbb_host'"; - Database::query($sql); + $variables = [ + 'bbb_salt', + 'bbb_host', + 'bbb_tool_enable', + 'enable_global_conference', + 'enable_conference_in_course_groups', + 'bbb_plugin', + 'bbb_plugin_host', + 'bbb_plugin_salt' + ]; + + foreach ($variables as $variable) { + $sql = "DELETE FROM $t_settings WHERE variable = '$variable'"; + Database::query($sql); + } - //Old settings deleting just in case - $sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin'"; - Database::query($sql); $sql = "DELETE FROM $t_options WHERE variable = 'bbb_plugin'"; Database::query($sql); - $sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin_host'"; - Database::query($sql); - $sql = "DELETE FROM $t_settings WHERE variable = 'bbb_plugin_salt'"; - Database::query($sql); - //hack to get rid of Database::query warning (please add c_id...) + // hack to get rid of Database::query warning (please add c_id...) $sql = "DELETE FROM $t_tool WHERE name = 'bbb' AND c_id != 0"; Database::query($sql); @@ -115,7 +117,7 @@ class BBBPlugin extends Plugin $sql = "DROP TABLE IF EXISTS $t"; Database::query($sql); - //Deleting course settings + // Deleting course settings $this->uninstall_course_fields_in_all_courses($this->course_settings); } } From 123d3dc396ec9a1069bd6b32790ca25d3f9e0992 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 10 May 2016 10:47:20 +0200 Subject: [PATCH 07/12] Remove unused function --- main/inc/lib/api.lib.php | 15 --------------- main/inc/lib/plugin.lib.php | 3 +-- tests/main/inc/lib/main_api.lib.test.php | 7 ------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index a091f7360c..4b20060228 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -4535,21 +4535,6 @@ function api_number_of_plugins($location) { return isset($_plugins[$location]) && is_array($_plugins[$location]) ? count($_plugins[$location]) : 0; } -/** - * Checks to see wether a certain plugin is installed. - * @return boolean true if the plugin is installed, false otherwise. - */ -function api_is_plugin_installed($plugin_list, $plugin_name) { - if (is_array($plugin_list)) { - foreach ($plugin_list as $plugin_location) { - if (array_search($plugin_name, $plugin_location) !== false) { - return true; - } - } - } - return false; -} - /** * Transforms a number of seconds in hh:mm:ss format * @author Julian Prud'homme diff --git a/main/inc/lib/plugin.lib.php b/main/inc/lib/plugin.lib.php index f1ae10cadb..2eb3ca9a55 100755 --- a/main/inc/lib/plugin.lib.php +++ b/main/inc/lib/plugin.lib.php @@ -372,8 +372,7 @@ class AppPlugin $_template['plugin_info'] = $plugin_info; } - // Setting the plugin info available in the template if exists - + // Setting the plugin info available in the template if exists. $template->assign($plugin_name, $_template); // Loading the Twig template plugin files if exists diff --git a/tests/main/inc/lib/main_api.lib.test.php b/tests/main/inc/lib/main_api.lib.test.php index ff900a334a..96838aceaf 100755 --- a/tests/main/inc/lib/main_api.lib.test.php +++ b/tests/main/inc/lib/main_api.lib.test.php @@ -491,13 +491,6 @@ class TestMainApi extends UnitTestCase { $this->assertTrue($_plugins[$location]); } - function testApiIsPluginInstalled(){ - $plugin_name = false; - $plugin_list = true; - $res = api_is_plugin_installed($plugin_list, $plugin_name); - $this->assertTrue(is_bool($res)); - } - function testApiTimeToHms(){ $seconds = -1; ob_start(); From c88a5e9ea16027daeef1e6588b1beb2af63e8d99 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 10 May 2016 11:04:36 +0200 Subject: [PATCH 08/12] Fix infocourse when using checkbox --- main/course_info/infocours.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main/course_info/infocours.php b/main/course_info/infocours.php index c695750e6a..adcbbccc35 100755 --- a/main/course_info/infocours.php +++ b/main/course_info/infocours.php @@ -483,7 +483,7 @@ $form->setDefaults($values); // Validate form if ($form->validate() && is_settings_editable()) { - $updateValues = $form->exportValues(); + $updateValues = $form->getSubmitValues(); // update course picture $picture = $_FILES['picture']; @@ -571,7 +571,6 @@ if ($form->validate() && is_settings_editable()) { ]; Database::update($table_course, $params, ['id = ?' => $courseId]); - // Insert/Updates course_settings table foreach ($courseSettings as $setting) { $value = isset($updateValues[$setting]) ? $updateValues[$setting] : null; From b39334d0c6ac96cf9e4c8ed02f5add7157ff5cc0 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 10 May 2016 11:04:46 +0200 Subject: [PATCH 09/12] Fix constructor --- main/inc/lib/formvalidator/Element/SelectTheme.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/formvalidator/Element/SelectTheme.php b/main/inc/lib/formvalidator/Element/SelectTheme.php index 9bc0433109..7a31c0546b 100644 --- a/main/inc/lib/formvalidator/Element/SelectTheme.php +++ b/main/inc/lib/formvalidator/Element/SelectTheme.php @@ -9,14 +9,15 @@ class SelectTheme extends HTML_QuickForm_select /** * Class constructor */ - function SelectTheme($elementName=null, $elementLabel=null, $options=null, $attributes=null) { + public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null) + { parent::__construct($elementName, $elementLabel, $options, $attributes); // Get all languages $themes = api_get_themes(); $this->_options = array(); $this->_values = array(); $this->addOption('--',''); // no theme select - for ($i=0; $i< count($themes[0]);$i++) { + for ($i=0; $i < count($themes[0]); $i++) { $this->addOption($themes[1][$i],$themes[0][$i]); } } From 1c76446ff2967542afc9f1ec963f6444593b3c5e Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 10 May 2016 11:05:08 +0200 Subject: [PATCH 10/12] Add course setting "bbb_enable_conference_in_groups" --- plugin/bbb/lib/bbb.lib.php | 3 +++ plugin/bbb/lib/bbb_plugin.class.php | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/plugin/bbb/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index 8c7597521a..827df0fe0f 100755 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -55,6 +55,9 @@ class bbb if ($this->groupSupport) { $this->groupSupport = (bool) $plugin->get('enable_conference_in_course_groups'); + if ($this->groupSupport) { + $this->groupSupport = api_get_course_setting('bbb_enable_conference_in_groups') === '1'; + } } if ($bbbPlugin === true) { diff --git a/plugin/bbb/lib/bbb_plugin.class.php b/plugin/bbb/lib/bbb_plugin.class.php index fd7bb6df51..846bada9f6 100755 --- a/plugin/bbb/lib/bbb_plugin.class.php +++ b/plugin/bbb/lib/bbb_plugin.class.php @@ -17,12 +17,16 @@ class BBBPlugin extends Plugin public $isCoursePlugin = true; // When creating a new course this settings are added to the course - public $course_settings = array( - array( + public $course_settings = [ + [ 'name' => 'big_blue_button_record_and_store', - 'type' => 'checkbox' - ) - ); + 'type' => 'checkbox', + ], + [ + 'name' => 'bbb_enable_conference_in_groups', + 'type' => 'checkbox', + ] + ]; /** * BBBPlugin constructor. From a32a3a251bd9b0a806f7671507fce0b07833a271 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 10 May 2016 11:46:52 +0200 Subject: [PATCH 11/12] Add validateCourseSetting function to show/hide course plugin settings. --- main/inc/lib/course.lib.php | 2 +- main/inc/lib/plugin.class.php | 9 +++++++++ main/inc/lib/plugin.lib.php | 3 +++ plugin/bbb/lang/english.php | 4 ++++ plugin/bbb/lang/french.php | 12 +----------- plugin/bbb/lang/spanish.php | 3 ++- plugin/bbb/lib/bbb.lib.php | 7 +++++-- plugin/bbb/lib/bbb_plugin.class.php | 18 ++++++++++++++++++ 8 files changed, 43 insertions(+), 15 deletions(-) diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 4f2fe296e0..ed2822bdb5 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -5024,11 +5024,11 @@ class CourseManager $settingList = self::getCourseSettingVariables($appPlugin); if (!in_array($variable, $settingList)) { + return false; } $courseSettingTable = Database::get_course_table(TABLE_COURSE_SETTING); - if (self::hasCourseSetting($variable, $courseId)) { // Update Database::update( diff --git a/main/inc/lib/plugin.class.php b/main/inc/lib/plugin.class.php index 1f6a6151b0..8f1c856013 100755 --- a/main/inc/lib/plugin.class.php +++ b/main/inc/lib/plugin.class.php @@ -746,4 +746,13 @@ class Plugin } } } + + /** + * @param string $variable + * @return bool + */ + public function validateCourseSetting($variable) + { + return true; + } } diff --git a/main/inc/lib/plugin.lib.php b/main/inc/lib/plugin.lib.php index 2eb3ca9a55..916d51b83e 100755 --- a/main/inc/lib/plugin.lib.php +++ b/main/inc/lib/plugin.lib.php @@ -547,6 +547,9 @@ class AppPlugin $groups = array(); foreach ($obj->course_settings as $setting) { + if ($obj->validateCourseSetting($setting['name']) === false) { + continue; + } if ($setting['type'] != 'checkbox') { $form->addElement($setting['type'], $setting['name'], $obj->get_lang($setting['name'])); } else { diff --git a/plugin/bbb/lang/english.php b/plugin/bbb/lang/english.php index 5ff171edec..1846866483 100755 --- a/plugin/bbb/lang/english.php +++ b/plugin/bbb/lang/english.php @@ -45,7 +45,11 @@ $strings['tool_enable_help'] = "Choose whether you want to enable the BigBlueBut Once enabled, it will show as an additional course tool in all courses' homepage, and teachers will be able to launch a conference at any time. Students will not be able to launch a conference, only join one. If you don't have a BigBlueButton server, please set one up or ask the Chamilo official providers for a quote. BigBlueButton is a free (as in freedom *and* beer), but its installation requires a set of technical skills that might not be immediately available to all. You can install it on your own or seek professional help to assist you or do it for you. This help, however, will generate a certain cost. In the pure logic of the free software, we offer you the tools to make your work easier and recommend professionals (the Chamilo Official Providers) that will be able to help you if this were too difficult.
"; $strings['big_blue_button_welcome_message'] = 'Welcome message'; +$strings['enable_global_conference'] = 'Enable global conference'; +$strings['enable_conference_in_course_groups'] = 'Enable conference in course groups'; + $strings['big_blue_button_record_and_store'] = 'Record and store sessions'; +$strings['bbb_enable_conference_in_groups'] = 'Allow conference in groups'; $strings['plugin_tool_bbb'] = 'Video'; diff --git a/plugin/bbb/lang/french.php b/plugin/bbb/lang/french.php index 5f271382e9..38ec3e6edd 100755 --- a/plugin/bbb/lang/french.php +++ b/plugin/bbb/lang/french.php @@ -13,38 +13,28 @@ $strings['CloseMeeting'] = "Fermer la session"; $strings['VideoConferenceXCourseX'] = "Vidéoconférence #%s, cours %s"; $strings['VideoConferenceAddedToTheCalendar'] = "Vidéoconférence ajoutée au calendrier"; $strings['VideoConferenceAddedToTheLinkTool'] = "Vidéoconférence ajoutée comme lien. Vous pouvez éditer et publier le lien sur la page principale du cours depuis l'outil liens."; - $strings['GoToTheVideoConference'] = "Entrer dans la salle de conférence"; - $strings['Records'] = "Enregistrement"; $strings['Meeting'] = "Salle de conférence"; - $strings['ViewRecord'] = "Voir l'enregistrement"; $strings['CopyToLinkTool'] = "Ajouter comme lien du cours"; - $strings['EnterConference'] = "Entrer dans la salle de conférence"; $strings['RecordList'] = "Liste des enregistrements"; $strings['ServerIsNotRunning'] = "Le serveur de vidéoconférence ne fonctionne pas"; $strings['ServerIsNotConfigured'] = "Le serveur de vidéoconférence n'est pas configuré correctement"; - $strings['XUsersOnLine'] = "%s utilisateurs dans la salle"; - $strings['host'] = 'Hôte de BigBlueButton'; $strings['host_help'] = "C'est le nom du serveur où le serveur de vidéoconférence a été habilité. Cela peut être localhost, une adresse IP (du genre 192.168.13.54) ou un nom de domaine (du genre ma.video.com)."; - $strings['salt'] = 'Clef BigBlueButton'; $strings['salt_help'] = "C'est la clef de sécurité de votre serveur BigBlueButton (appelée 'salt' en anglais) qui permet à votre serveur de vérifier l'identité de votre installation de Chamilo et ainsi l'autoriser à se connecter. Veuillez vous référer à la documentation de BigBlueButton pour la localiser, ou utilisez la commande 'bbb-conf --salt' si vous disposez d'un accès en ligne de commande au serveur de vidéoconférence."; - $strings['tool_enable'] = 'Outil de vidéoconférence BigBlueButton activé'; $strings['tool_enable_help'] = "Choisissez si vous souhaitez activer l'outil de vidéoconférence BigBlueButton. Une fois activé, il apparaîtra comme un outil additionnel sur toutes les pages principales de cours, et les enseignants pourront démarrer une conférence à n'importe quel moment. Les étudiants ne pourront pas lancer de nouvelle session de conférence, seulement se joindre à une session existante. Si vous ne disposez pas d'un serveur de vidéoconférence BigBlueButton, veuillez en installer un avant de poursuivre, ou demander un devis à l'un des fournisseurs officiels de Chamilo. BigBlueButton est un outil de logiciel libre (et gratuit), mais son installation pourrait présenter une certaine complexité et demander des compétences qui ne sont peut-être pas à la portée de tous. Vous pouvez l'installer vous-même à partir de la documentation (disponible publiquement) de BigBlueButton, ou recherchez un soutien professionnel. Ce soutien pourrait générer certains coûts (au moins le temps de la personne qui vous assiste dans l'opération). Dans le plus pur esprit du logiciel libre, nous vous fournissons les outils pour simplifier votre travail dans la mesure de nos possibilités, et nous vous recommandons des professionnels (les fournisseurs officiels de Chamilo) pour vous venir en aide au cas où ceux-ci seraient insuffisants.
"; $strings['big_blue_button_welcome_message'] = 'Message de bienvenue de BigBlueButton'; $strings['big_blue_button_record_and_store'] = 'Enregistrer les sessions de vidéoconférence'; - +$strings['bbb_enable_conference_in_groups'] = 'Permettre la création de vidéoconférence pour les groupes'; $strings['plugin_tool_bbb'] = 'Vidéo'; - $strings['ThereAreNotRecordingsForTheMeetings'] = 'Aucun enregistrement disponible'; $strings['NoRecording'] = "Pas d'enregistrement"; - $strings['ClickToContinue'] = 'Cliquez pour continuer'; diff --git a/plugin/bbb/lang/spanish.php b/plugin/bbb/lang/spanish.php index 1ab48767d1..6cacc628bf 100755 --- a/plugin/bbb/lang/spanish.php +++ b/plugin/bbb/lang/spanish.php @@ -40,7 +40,8 @@ $strings['tool_enable_help'] = "Escoja si desea activar la herramienta de videoc Una vez activada, se mostrará como una herramienta adicional en todas las páginas principales de cursos, y los profesores podrán iniciar una conferencia en cualquier momento. Los estudiantes no podrían lanzar una conferencia, solo juntarse a una existente. Si no tiene un servidor de videoconferencia BigBlueButton, por favor configure uno antes de seguir, o pida una cotización a uno de los proveedores oficiales de Chamilo. BigBlueButton es una herramienta de software libre (y gratuita), pero su instalación requiere de competencias que quizás no sean inmediatamente disponibles para todos. Puede instalarla usted mismo o buscar ayuda profesional. Esta ayuda podría no obstante generar algunos costos (por lo menos el tiempo de la persona quien lo ayude). En el puro espíritu del software libre, le ofrecemos las herramientas para hacer su trabajo más simple, en la medida de nuestras posibilidades, y le recomendamos profesionales (los proveedores oficiales de Chamilo) para ayudarlo en caso esto fuera demasiado complicado.
"; $strings['big_blue_button_welcome_message'] = 'Mensaje de bienvenida de BigBlueButton'; -$strings['big_blue_button_record_and_store'] = 'Grabar las sesiones de videoconferencia'; +$strings['big_blue_button_record_and_store'] = 'Grabar las sesiones de videoconferencia.'; +$strings['bbb_enable_conference_in_groups'] = 'Activar la creación de videoconferencia en los grupos.'; $strings['plugin_tool_bbb'] = 'Video'; diff --git a/plugin/bbb/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index 827df0fe0f..f6464a08c6 100755 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -56,7 +56,10 @@ class bbb if ($this->groupSupport) { $this->groupSupport = (bool) $plugin->get('enable_conference_in_course_groups'); if ($this->groupSupport) { - $this->groupSupport = api_get_course_setting('bbb_enable_conference_in_groups') === '1'; + $courseInfo = api_get_course_info(); + if ($courseInfo) { + $this->groupSupport = api_get_course_setting('bbb_enable_conference_in_groups') === '1'; + } } } @@ -79,7 +82,7 @@ class bbb $this->pluginEnabled = true; } } - + /** * @return bool */ diff --git a/plugin/bbb/lib/bbb_plugin.class.php b/plugin/bbb/lib/bbb_plugin.class.php index 846bada9f6..dc83bf43f9 100755 --- a/plugin/bbb/lib/bbb_plugin.class.php +++ b/plugin/bbb/lib/bbb_plugin.class.php @@ -46,6 +46,24 @@ class BBBPlugin extends Plugin ); } + /** + * @param string $variable + * @return bool + */ + public function validateCourseSetting($variable) + { + if ($variable == 'bbb_enable_conference_in_groups') { + if ($this->get('enable_conference_in_course_groups') === 'true') { + + return true; + } else { + return false; + } + } + + return true; + } + /** * @return BBBPlugin|null */ From 6ee2856479cb34b9a32930ee335e01582a5d6f5d Mon Sep 17 00:00:00 2001 From: jmontoyaaDate: Tue, 10 May 2016 13:14:08 +0200 Subject: [PATCH 12/12] Minor - format code, update comments --- main/inc/lib/internationalization.lib.php | 23 +++++++++++++++------- main/inc/lib/pear/PEAR.php | 8 +------- plugin/bbb/lib/bbb.lib.php | 24 ++++++++++------------- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/main/inc/lib/internationalization.lib.php b/main/inc/lib/internationalization.lib.php index afd69f5793..b331057d5b 100755 --- a/main/inc/lib/internationalization.lib.php +++ b/main/inc/lib/internationalization.lib.php @@ -3,7 +3,7 @@ /** * File: internationalization.lib.php - * Internationalization library for Chamilo 1.8.7 LMS + * Internationalization library for Chamilo 1.x LMS * A library implementing internationalization related functions. * License: GNU General Public License Version 3 (Free Software Foundation)ww * @author Ivan Tcholakov, , 2009, 2010 @@ -275,7 +275,7 @@ function api_get_language_isocode($language = null, $default_code = 'en') } /** - * Gets language isocode column from the language table + * Gets language iso code column from the language table * * @return array An array with the current isocodes * @@ -283,7 +283,8 @@ function api_get_language_isocode($language = null, $default_code = 'en') function api_get_platform_isocodes() { $iso_code = array(); - $sql_result = Database::query("SELECT isocode FROM ".Database::get_main_table(TABLE_MAIN_LANGUAGE)." ORDER BY isocode "); + $sql = "SELECT isocode FROM ".Database::get_main_table(TABLE_MAIN_LANGUAGE)." ORDER BY isocode "; + $sql_result = Database::query($sql); if (Database::num_rows($sql_result)) { while ($row = Database::fetch_array($sql_result)) {; $iso_code[] = trim($row['isocode']); @@ -348,6 +349,7 @@ function api_get_timezones() } $null_option = array('' => ''); $result = array_merge($null_option, $out); + return $result; } @@ -439,8 +441,12 @@ function api_get_utc_datetime($time = null, $return_null_if_invalid_date = false * * @author Guillaume Viguier */ -function api_get_local_time($time = null, $to_timezone = null, $from_timezone = null, $return_null_if_invalid_date = false) -{ +function api_get_local_time( + $time = null, + $to_timezone = null, + $from_timezone = null, + $return_null_if_invalid_date = false +) { // Determining the timezone to be converted from if (is_null($from_timezone)) { $from_timezone = 'UTC'; @@ -471,8 +477,10 @@ function api_get_local_time($time = null, $to_timezone = null, $from_timezone = try { $date = new DateTime($time, new DateTimezone($from_timezone)); $date->setTimezone(new DateTimeZone($to_timezone)); + return $date->format('Y-m-d H:i:s'); } catch (Exception $e) { + return null; } } @@ -480,8 +488,8 @@ function api_get_local_time($time = null, $to_timezone = null, $from_timezone = /** * Converts a string into a timestamp safely (handling timezones), using strtotime * - * @param string String to be converted - * @param string Timezone (if null, the timezone will be determined based + * @param string $time to be converted + * @param string $timezone (if null, the timezone will be determined based * on user preference, or timezone chosen by the admin for the platform) * @return int Timestamp * @@ -494,6 +502,7 @@ function api_strtotime($time, $timezone = null) { } $timestamp = strtotime($time); date_default_timezone_set($system_timezone); + return $timestamp; } diff --git a/main/inc/lib/pear/PEAR.php b/main/inc/lib/pear/PEAR.php index 005954069e..b794dc9aec 100755 --- a/main/inc/lib/pear/PEAR.php +++ b/main/inc/lib/pear/PEAR.php @@ -253,7 +253,7 @@ class PEAR $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); } - // }}} + // }}} // {{{ isError() /** @@ -558,12 +558,6 @@ class PEAR $ec = 'PEAR_Error'; } - if (intval(PHP_VERSION) < 5) { - // little non-eval hack to fix bug #12147 - include 'PEAR/FixPHP5PEARWarnings.php'; - return $a; - } - if ($skipmsg) { $a = new $ec($code, $mode, $options, $userinfo); } else { diff --git a/plugin/bbb/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index f6464a08c6..c85f09f5d9 100755 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -20,7 +20,7 @@ class bbb public $url; public $salt; public $api; - public $user_complete_name = ''; + public $userCompleteName = ''; public $protocol = 'http://'; public $debug = false; public $logoutUrl = ''; @@ -34,6 +34,7 @@ class bbb * required for the connection to the video conference server) * @param string $host * @param string $salt + * @param bool $isGlobalConference */ public function __construct($host = '', $salt = '', $isGlobalConference = false) { @@ -65,7 +66,7 @@ class bbb if ($bbbPlugin === true) { $userInfo = api_get_user_info(); - $this->user_complete_name = $userInfo['complete_name']; + $this->userCompleteName = $userInfo['complete_name']; $this->salt = $bbb_salt; $info = parse_url($bbb_host); $this->url = $bbb_host.'/bigbluebutton/'; @@ -82,7 +83,7 @@ class bbb $this->pluginEnabled = true; } } - + /** * @return bool */ @@ -151,7 +152,8 @@ class bbb # a user joins. If after this period, a user hasn't joined, the meeting is # removed from memory. defaultMeetingCreateJoinDuration=5 - * + * + * @return mixed */ public function createMeeting($params) { @@ -385,7 +387,7 @@ class bbb if ($meetingInfoExists) { $joinParams = array( 'meetingId' => $meetingData['remote_id'], // -- REQUIRED - A unique id for the meeting - 'username' => $this->user_complete_name, //-- REQUIRED - The name that will display for the user in the meeting + 'username' => $this->userCompleteName, //-- REQUIRED - The name that will display for the user in the meeting 'password' => $pass, //-- REQUIRED - The attendee or moderator password, depending on what's passed here //'createTime' => api_get_utc_datetime(), //-- OPTIONAL - string. Leave blank ('') unless you set this correctly. 'userID' => api_get_user_id(), //-- OPTIONAL - string @@ -437,7 +439,7 @@ class bbb { $pass = $this->getUserMeetingPassword(); $courseId = api_get_course_int_id(); - $sessionId = api_get_session_id(); + $sessionId = api_get_session_id(); $conditions = array( 'where' => array( @@ -669,7 +671,7 @@ class bbb if ($meetingDB['status'] == 1) { $joinParams = array( 'meetingId' => $meetingDB['remote_id'], //-- REQUIRED - A unique id for the meeting - 'username' => $this->user_complete_name, //-- REQUIRED - The name that will display for the user in the meeting + 'username' => $this->userCompleteName, //-- REQUIRED - The name that will display for the user in the meeting 'password' => $pass, //-- REQUIRED - The attendee or moderator password, depending on what's passed here 'createTime' => '', //-- OPTIONAL - string. Leave blank ('') unless you set this correctly. 'userID' => '', // -- OPTIONAL - string @@ -928,7 +930,7 @@ class bbb } /** - * Checks if the videoconference server is running. + * Checks if the video conference server is running. * Function currently disabled (always returns 1) * @return bool True if server is running, false otherwise * @assert () === false @@ -968,12 +970,6 @@ class bbb header("Location: $url"); exit; } - - // js - /*echo ''; - exit;*/ } /**