Completed
Pull Request — 1.11.x (#1628)
by José
97:30 queued 69:06
created
plugin/vchamilo/vcron.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 global $VCRON;
31 31
 
32 32
 $VCRON = new stdClass();
33
-$VCRON->ACTIVATION = 'cli';                         // choose how individual cron are launched, 'cli' or 'web'
34
-$VCRON->STRATEGY = ROUND_ROBIN ;                    // choose vcron rotation mode
35
-$VCRON->PERIOD = 15 * MINSECS ;                     // used if LOWEST_POSSIBLE_GAP to setup the max gap
36
-$VCRON->TIMEOUT = 300;                              // time out for CURL call to effective cron
33
+$VCRON->ACTIVATION = 'cli'; // choose how individual cron are launched, 'cli' or 'web'
34
+$VCRON->STRATEGY = ROUND_ROBIN; // choose vcron rotation mode
35
+$VCRON->PERIOD = 15 * MINSECS; // used if LOWEST_POSSIBLE_GAP to setup the max gap
36
+$VCRON->TIMEOUT = 300; // time out for CURL call to effective cron
37 37
 // $VCRON->TRACE = $_configuration['root_sys'].'plugin/vchamilo/log/vcrontrace.log';   // Trace file where to collect cron outputs
38
-$VCRON->TRACE = '/data/log/chamilo/vcrontrace.log';   // Trace file where to collect cron outputs
39
-$VCRON->TRACE_ENABLE = true;                        // enables tracing
38
+$VCRON->TRACE = '/data/log/chamilo/vcrontrace.log'; // Trace file where to collect cron outputs
39
+$VCRON->TRACE_ENABLE = true; // enables tracing
40 40
 
41 41
 if (!is_dir($_configuration['root_sys'].'plugin/vchamilo/log')) {
42 42
     mkdir($_configuration['root_sys'].'plugin/vchamilo/log', 0777, true);
@@ -97,32 +97,32 @@  discard block
 block discarded – undo
97 97
     $timestamp_receive = time();
98 98
 
99 99
     if ($rawresponse === false) {
100
-        $error = curl_errno($ch) .':'. curl_error($ch);
101
-        if ($VCRON->TRACE_ENABLE){
102
-            if ($CRONTRACE){
103
-                fputs($CRONTRACE, "VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" );
100
+        $error = curl_errno($ch).':'.curl_error($ch);
101
+        if ($VCRON->TRACE_ENABLE) {
102
+            if ($CRONTRACE) {
103
+                fputs($CRONTRACE, "VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n");
104 104
                 fputs($CRONTRACE, "VCron Error : $error \n");
105
-                fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n" );
105
+                fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n");
106 106
                 fclose($CRONTRACE);
107 107
             }
108 108
         }
109
-        echo("VCron started on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" );
109
+        echo("VCron started on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n");
110 110
         echo("VCron Error : $error \n");
111
-        echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" );
111
+        echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n");
112 112
         return false;
113 113
     }
114 114
 
115 115
     if ($VCRON->TRACE_ENABLE) {
116 116
         if ($CRONTRACE) {
117
-            fputs($CRONTRACE, "VCron start on $vhost->vhostname : ".api_time_to_hms($timestamp_send)."\n" );
117
+            fputs($CRONTRACE, "VCron start on $vhost->vhostname : ".api_time_to_hms($timestamp_send)."\n");
118 118
             fputs($CRONTRACE, $rawresponse."\n");
119
-            fputs($CRONTRACE, "VCron stop on $vhost->vhostname : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" );
119
+            fputs($CRONTRACE, "VCron stop on $vhost->vhostname : ".api_time_to_hms($timestamp_receive)."\n#################\n\n");
120 120
             fclose($CRONTRACE);
121 121
         }
122 122
     }
123
-    echo("VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" );
123
+    echo("VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n");
124 124
     echo($rawresponse."\n");
125
-    echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" );
125
+    echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n");
126 126
     $vhost->lastcrongap = time() - $vhost->lastcron;
127 127
     $vhost->lastcron = $timestamp_send;
128 128
     $vhost->croncount++;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     $vhostid = $vhost->id;
131 131
     unset($vhost->id);
132 132
 
133
-    Database::update('vchamilo', (array)$vhost, array('id = ?' => $vhostid));
133
+    Database::update('vchamilo', (array) $vhost, array('id = ?' => $vhostid));
134 134
 
135 135
 }
136 136
 
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 
155 155
     if ($VCRON->TRACE_ENABLE) {
156 156
         if ($CRONTRACE) {
157
-            fputs($CRONTRACE, "VCron start on $vhost->root_web : $timestamp_send\n" );
157
+            fputs($CRONTRACE, "VCron start on $vhost->root_web : $timestamp_send\n");
158 158
             fputs($CRONTRACE, $rawresponse."\n");
159
-            fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n" );
159
+            fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n");
160 160
             fclose($CRONTRACE);
161 161
         }
162 162
     }
@@ -209,14 +209,14 @@  discard block
 block discarded – undo
209 209
         $match = trim($match);
210 210
 
211 211
         // try for IP match (Left side)
212
-        $lhs = substr($host,0,strlen($match));
213
-        if (strcasecmp($match,$lhs)==0) {
212
+        $lhs = substr($host, 0, strlen($match));
213
+        if (strcasecmp($match, $lhs) == 0) {
214 214
             return true;
215 215
         }
216 216
 
217 217
         // try for host match (Right side)
218
-        $rhs = substr($host,-strlen($match));
219
-        if (strcasecmp($match,$rhs)==0) {
218
+        $rhs = substr($host, -strlen($match));
219
+        if (strcasecmp($match, $rhs) == 0) {
220 220
             return true;
221 221
         }
222 222
     }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 // Main execution sequence
229 229
 
230
-if (!$vchamilos = Database::select('*', 'vchamilo', array(), 'all')){
230
+if (!$vchamilos = Database::select('*', 'vchamilo', array(), 'all')) {
231 231
     die("Nothing to do. No Vhosts");
232 232
 }
233 233
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 if ($VCRON->STRATEGY == ROUND_ROBIN) {
241 241
     $rr = 0;
242 242
     foreach ($allvhosts as $vhostassoc) {
243
-        $vhost = (object)$vhostassoc;
243
+        $vhost = (object) $vhostassoc;
244 244
         if ($rr == 1) {
245 245
             api_set_setting('vchamilo_cron_lasthost', $vhost->id);
246 246
             echo("Round Robin : ".$vhost->root_web."\n");
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
 
253 253
             die('Done.');
254 254
         }
255
-        if ($vhost->id == api_get_setting('vchamilo_cron_lasthost', 'vchamilo')){
255
+        if ($vhost->id == api_get_setting('vchamilo_cron_lasthost', 'vchamilo')) {
256 256
             $rr = 1; // take next one
257 257
         }
258 258
     }
259 259
 
260 260
     // We were at last. Loop back and take first.
261
-    $firsthost = (object)$allvhosts[0];
261
+    $firsthost = (object) $allvhosts[0];
262 262
     api_set_setting('vchamilo_cron_lasthost', $firsthost->id, 'vchamilo');
263 263
     echo("Round Robin : ".$firsthost->root_web."\n");
264 264
     if ($VCRON->ACTIVATION == 'cli') {
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     $hostsperturn = max(1, $VCRON->PERIOD / api_get_setting('vcrontickperiod', 'vchamilo') * count($allvhosts));
278 278
     $i = 0;
279 279
     foreach ($allvhosts as $vhostassoc) {
280
-        $vhost = (object)$vhostassoc;
280
+        $vhost = (object) $vhostassoc;
281 281
         if ((time() - $vhost->lastcron) > $VCRON->PERIOD) {
282 282
             if ($VCRON->ACTIVATION == 'cli') {
283 283
                 exec_vhost_cron($vhost);
Please login to merge, or discard this patch.
plugin/buycourses/src/panel.ajax.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
 
37 37
         $userInfo = api_get_user_info($sale['user_id']);
38 38
 
39
-        $html = '<h2>' . $sale['product_name'] .'</h2>';
39
+        $html = '<h2>'.$sale['product_name'].'</h2>';
40 40
         $html .= '<div class="row">';
41 41
         $html .= '<div class="col-sm-6 col-md-6">';
42 42
         $html .= '<ul>';
43
-        $html .= '<li><b>'. $plugin->get_lang('OrderPrice') . ':</b> '. $sale['price'] . '</li>';
44
-        $html .= '<li><b>'. $plugin->get_lang('CurrencyType') . ':</b> '. $currency['iso_code'] . '</li>';
45
-        $html .= '<li><b>'. $plugin->get_lang('ProductType') . ':</b> '. $productType . '</li>';
46
-        $html .= '<li><b>'. $plugin->get_lang('OrderDate') . ':</b> '. api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H) . '</li>';
47
-        $html .= '<li><b>'. $plugin->get_lang('Buyer') . ':</b> '. $userInfo['complete_name'] . '</li>';
48
-        $html .= '<li><b>'. $plugin->get_lang('PaymentMethods') . ':</b> '. $paymentType . '</li>';
43
+        $html .= '<li><b>'.$plugin->get_lang('OrderPrice').':</b> '.$sale['price'].'</li>';
44
+        $html .= '<li><b>'.$plugin->get_lang('CurrencyType').':</b> '.$currency['iso_code'].'</li>';
45
+        $html .= '<li><b>'.$plugin->get_lang('ProductType').':</b> '.$productType.'</li>';
46
+        $html .= '<li><b>'.$plugin->get_lang('OrderDate').':</b> '.api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H).'</li>';
47
+        $html .= '<li><b>'.$plugin->get_lang('Buyer').':</b> '.$userInfo['complete_name'].'</li>';
48
+        $html .= '<li><b>'.$plugin->get_lang('PaymentMethods').':</b> '.$paymentType.'</li>';
49 49
         $html .= '</ul>';
50 50
         $html .= '</div>';
51 51
         $html .= '<div class="col-sm-6 col-md-6">';
52
-        $html .= '<img class="thumbnail" src="'. $productImage .'" >';
52
+        $html .= '<img class="thumbnail" src="'.$productImage.'" >';
53 53
         $html .= '</div>';
54 54
         $html .= '</div>';
55 55
         echo $html;
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
         $html = '<div class="row">'
90 90
         . '<p>'
91 91
             . '<ul>'
92
-                . '<li>'. get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin") .' <b>'. $stats['completed_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['completed_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
93
-                . '<li>'. get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin") .' <b>'. $stats['pending_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['pending_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
94
-                . '<li>'. get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin") .' <b>'. $stats['canceled_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['canceled_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
92
+                . '<li>'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").' <b>'.$stats['completed_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['completed_total_amount'].' '.$currency['iso_code'].'</b></li>'
93
+                . '<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").' <b>'.$stats['pending_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['pending_total_amount'].' '.$currency['iso_code'].'</b></li>'
94
+                . '<li>'.get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b></li>'
95 95
             . '</ul>'
96 96
         . '</p>';
97 97
         $html .= '</div>';
@@ -127,15 +127,15 @@  discard block
 block discarded – undo
127 127
 
128 128
         $isoCode = $currentCurrency['iso_code'];
129 129
 
130
-        $html .= '<p>'. get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin") .'</p>';
130
+        $html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>';
131 131
         $html .= ''
132 132
         . '<p>'
133 133
             . '<ul>'
134
-                . '<li>'. get_plugin_lang("TotalAcounts", "BuyCoursesPlugin") .' <b>'. $totalAccounts .'</b></li>'
135
-                . '<li>'. get_plugin_lang("TotalPayout", "BuyCoursesPlugin") .' <b>'. $isoCode .' '. $totalPayout .'</b></li>'
134
+                . '<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>'
135
+                . '<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>'
136 136
             . '</ul>'
137 137
         . '</p>';
138
-        $html .= '<p>'. get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin") .'</p>';
138
+        $html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>';
139 139
         $html .= '<br /><br />';
140 140
         $html .= '<div id="spinner" class="text-center"></div>';
141 141
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             }
183 183
             echo Display::return_message(get_plugin_lang("PayoutSuccess", "BuyCoursesPlugin"), 'success', false);
184 184
         } else {
185
-            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'. $result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
185
+            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'.$result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
186 186
         }
187 187
         break;
188 188
 
Please login to merge, or discard this patch.
plugin/buycourses/src/configuration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
 // breadcrumbs
28 28
 $interbreadcrumb[] = [
29
-    'url' => api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php',
29
+    'url' => api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php',
30 30
     'name' => $plugin->get_lang('plugin_title')
31 31
 ];
32 32
 
Please login to merge, or discard this patch.
plugin/buycourses/src/configure_course.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 $commissionsEnable = $plugin->get('commissions_enable');
23 23
 
24 24
 if ($commissionsEnable == 'true') {
25
-    $htmlHeadXtra[] = '<script type="text/javascript" src="' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/js/commissions.js"></script>';
25
+    $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_PLUGIN_PATH).'buycourses/resources/js/commissions.js"></script>';
26 26
     $defaultCommissions = [];
27 27
     $commissions = '';
28 28
 }
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
     . '<script>'
167 167
         . '$(function(){'
168 168
             . 'if ($("[name=\'commissions\']").val() === "") {'
169
-                . '$("#panelSliders").html("<button id=\"setCommissionsButton\" class=\"btn btn-warning\">' . get_plugin_lang("SetCommissions", "BuyCoursesPlugin") . '</button>");'
169
+                . '$("#panelSliders").html("<button id=\"setCommissionsButton\" class=\"btn btn-warning\">'.get_plugin_lang("SetCommissions", "BuyCoursesPlugin").'</button>");'
170 170
             . '} else {'
171
-                . 'showSliders(100, "default", "' . $commissions . '");'
171
+                . 'showSliders(100, "default", "'.$commissions.'");'
172 172
             . '}'
173 173
         . '});'
174 174
 
@@ -219,14 +219,14 @@  discard block
 block discarded – undo
219 219
 
220 220
 if ($commissionsEnable === 'true') {
221 221
     $platformCommission = $plugin->getPlatformCommission();
222
-    $form->addHtml( ''
222
+    $form->addHtml(''
223 223
             . '<div class="form-group">'
224 224
                 . '<label for="sliders" class="col-sm-2 control-label">'
225 225
                     . get_plugin_lang('Commissions', 'BuyCoursesPlugin')
226 226
                 . '</label>'
227 227
                 . '<div class="col-sm-8">'
228 228
                     . Display::return_message(
229
-                        sprintf($plugin->get_lang('TheActualPlatformCommissionIsX'), $platformCommission['commission']. '%'),
229
+                        sprintf($plugin->get_lang('TheActualPlatformCommissionIsX'), $platformCommission['commission'].'%'),
230 230
                         'info',
231 231
                         false
232 232
                     )
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
         $plugin->deleteItem($productItem['id']);
285 285
     }
286 286
 
287
-    header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/configuration.php');
287
+    header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/configuration.php');
288 288
     exit;
289 289
 }
290 290
 
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/Proxy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,5 +29,5 @@
 block discarded – undo
29 29
 	 * @see Requests_Hooks::register
30 30
 	 * @param Requests_Hooks $hooks Hook system
31 31
 	 */
32
-	public function register(Requests_Hooks &$hooks);
32
+	public function register(Requests_Hooks & $hooks);
33 33
 }
34 34
\ No newline at end of file
Please login to merge, or discard this patch.
plugin/bbb/start.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * @package chamilo.plugin.bigbluebutton
5 5
  */
6 6
 
7
-require __DIR__ . '/../../vendor/autoload.php';
7
+require __DIR__.'/../../vendor/autoload.php';
8 8
 
9 9
 $course_plugin = 'bbb'; //needed in order to load the plugin lang variables
10 10
 require_once __DIR__.'/config.php';
@@ -16,22 +16,22 @@  discard block
 block discarded – undo
16 16
 $host = '';
17 17
 $salt = '';
18 18
 $isGlobal = isset($_GET['global']) ? true : false;
19
-$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id']: false;
19
+$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
20 20
 $bbb = new bbb('', '', $isGlobal, $isGlobalPerUser);
21 21
 
22 22
 if ($bbb->pluginEnabled) {
23 23
     if ($bbb->isServerRunning()) {
24 24
         if (isset($_GET['launch']) && $_GET['launch'] == 1) {
25
-            if (file_exists(__DIR__ . '/config.vm.php')) {
26
-                $config = require __DIR__ . '/config.vm.php';
25
+            if (file_exists(__DIR__.'/config.vm.php')) {
26
+                $config = require __DIR__.'/config.vm.php';
27 27
                 $vmIsEnabled = true;
28 28
                 $host = '';
29 29
                 $salt = '';
30 30
 
31
-                require __DIR__ . '/lib/vm/AbstractVM.php';
32
-                require __DIR__ . '/lib/vm/VMInterface.php';
33
-                require __DIR__ . '/lib/vm/DigitalOceanVM.php';
34
-                require __DIR__ . '/lib/VM.php';
31
+                require __DIR__.'/lib/vm/AbstractVM.php';
32
+                require __DIR__.'/lib/vm/VMInterface.php';
33
+                require __DIR__.'/lib/vm/DigitalOceanVM.php';
34
+                require __DIR__.'/lib/VM.php';
35 35
 
36 36
                 $vm = new VM($config);
37 37
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             $bbb->redirectToBBB($url);
61 61
         } else {
62 62
             $url = $bbb->getListingUrl();
63
-            header('Location: ' . $url);
63
+            header('Location: '.$url);
64 64
             exit;
65 65
         }
66 66
     } else {
Please login to merge, or discard this patch.
plugin/bbb/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 /* bbb parameters that will be registered in the course settings */
5 5
 
6
-require_once __DIR__ . '/../../main/inc/global.inc.php';
6
+require_once __DIR__.'/../../main/inc/global.inc.php';
7 7
 
8 8
 require_once 'lib/bbb.lib.php';
9 9
 require_once 'lib/bbb_api.php';
Please login to merge, or discard this patch.
plugin/bbb/lib/bbb_api.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -55,25 +55,25 @@  discard block
 block discarded – undo
55 55
 	*/
56 56
 		// BASE CONFIGS - set these for your BBB server in config.php and they will
57 57
 		// simply flow in here via the constants:
58
-		$this->_securitySalt 		= CONFIG_SECURITY_SALT;
59
-		$this->_bbbServerBaseUrl 	= CONFIG_SERVER_BASE_URL;
58
+		$this->_securitySalt = CONFIG_SECURITY_SALT;
59
+		$this->_bbbServerBaseUrl = CONFIG_SERVER_BASE_URL;
60 60
 	}
61 61
 
62
-	private function _processXmlResponse($url){
62
+	private function _processXmlResponse($url) {
63 63
 	/*
64 64
 	A private utility method used by other public methods to process XML responses.
65 65
 	*/
66 66
 		if (extension_loaded('curl')) {
67
-			$ch = curl_init() or die ( curl_error($ch) );
67
+			$ch = curl_init() or die (curl_error($ch));
68 68
 			$timeout = 10;
69
-			curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false);
70
-			curl_setopt( $ch, CURLOPT_URL, $url );
71
-			curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
72
-			curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout);
73
-			$data = curl_exec( $ch );
74
-			curl_close( $ch );
75
-
76
-			if($data)
69
+			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
70
+			curl_setopt($ch, CURLOPT_URL, $url);
71
+			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
72
+			curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
73
+			$data = curl_exec($ch);
74
+			curl_close($ch);
75
+
76
+			if ($data)
77 77
 				return (new SimpleXMLElement($data));
78 78
 			else
79 79
 				return false;
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 		'&duration='.urlencode($creationParams['duration']);
138 138
 		//'&meta_category='.urlencode($creationParams['meta_category']);
139 139
 		$welcomeMessage = $creationParams['welcomeMsg'];
140
-		if(trim($welcomeMessage))
140
+		if (trim($welcomeMessage))
141 141
 			$params .= '&welcome='.urlencode($welcomeMessage);
142 142
 		// Return the complete URL:
143
-		return ( $creationUrl.$params.'&checksum='.sha1("create".$params.$this->_securitySalt) );
143
+		return ($creationUrl.$params.'&checksum='.sha1("create".$params.$this->_securitySalt));
144 144
 	}
145 145
 
146 146
 	public function createMeetingWithXmlResponseArray($creationParams) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		$xml = $this->_processXmlResponse($this->getCreateMeetingURL($creationParams));
166 166
 
167 167
         if ($xml) {
168
-			if($xml->meetingID)
168
+			if ($xml->meetingID)
169 169
 				return array(
170 170
 					'returncode' => $xml->returncode->__toString(),
171 171
 					'message' => $xml->message->__toString(),
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		$meetingId = '1234'		-- REQUIRED - The unique id for the meeting
284 284
 		*/
285 285
 		$xml = $this->_processXmlResponse($this->getIsMeetingRunningUrl($meetingId));
286
-		if($xml) {
286
+		if ($xml) {
287 287
 			return array(
288 288
 				'returncode' => $xml->returncode->__toString(),
289 289
 				'running' => $xml->running->__toString() 	// -- Returns true/false.
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 		and then handle the results that we get in the XML response.
311 311
 		*/
312 312
 		$xml = $this->_processXmlResponse($this->getGetMeetingsUrl());
313
-		if($xml) {
313
+		if ($xml) {
314 314
 			// If we don't get a success code, stop processing and return just the returncode:
315 315
 			if ($xml->returncode != 'SUCCESS') {
316 316
 				$result = array(
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 		);
380 380
 		*/
381 381
 		$xml = $this->_processXmlResponse($this->getMeetingInfoUrl($infoParams));
382
-		if($xml) {
382
+		if ($xml) {
383 383
 			// If we don't get a success code or messageKey, find out why:
384 384
 			if (($xml->returncode != 'SUCCESS') || ($xml->messageKey == null)) {
385 385
 				$result = array(
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		probably be required in user code when 'recording' is set to true.
455 455
 		*/
456 456
 		$xml = $this->_processXmlResponse($this->getRecordingsUrl($recordingParams));
457
-		if($xml) {
457
+		if ($xml) {
458 458
 			// If we don't get a success code or messageKey, find out why:
459 459
 			if (($xml->returncode != 'SUCCESS') || ($xml->messageKey == null)) {
460 460
 				$result = array(
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 		);
525 525
 		*/
526 526
 		$xml = $this->_processXmlResponse($this->getPublishRecordingsUrl($recordingParams));
527
-		if($xml) {
527
+		if ($xml) {
528 528
 			return array(
529 529
 				'returncode' => $xml->returncode->__toString(),
530 530
 				'published' => $xml->published->__toString() 	// -- Returns true/false.
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 		*/
558 558
 
559 559
 		$xml = $this->_processXmlResponse($this->getDeleteRecordingsUrl($recordingParams));
560
-		if($xml) {
560
+		if ($xml) {
561 561
 			return array(
562 562
 				'returncode' => $xml->returncode->__toString(),
563 563
 				'deleted' => $xml->deleted->__toString() 	// -- Returns true/false.
Please login to merge, or discard this patch.
plugin/courselegal/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 /* For licensing terms, see /license.txt */
3 3
 
4
-require_once __DIR__ . '/../../main/inc/global.inc.php';
4
+require_once __DIR__.'/../../main/inc/global.inc.php';
5 5
 require_once __DIR__.'/CourseLegalPlugin.php';
Please login to merge, or discard this patch.