@@ -9,9 +9,9 @@ |
||
| 9 | 9 | $plugin = BuyCoursesPlugin::create(); |
| 10 | 10 | $guess_enable = $plugin->get('unregistered_users_enable');
|
| 11 | 11 | |
| 12 | -if ($guess_enable == "true" || isset($_SESSION['_user'])) {
|
|
| 12 | +if ($guess_enable == "true" || isset($_SESSION['_user'])) { |
|
| 13 | 13 | // If the user is NOT an administrator, redirect it to course/session buy list |
| 14 | - if (!api_is_platform_admin()) {
|
|
| 14 | + if (!api_is_platform_admin()) { |
|
| 15 | 15 | header('Location: src/course_panel.php');
|
| 16 | 16 | exit; |
| 17 | 17 | } |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | $commissionsEnable = $plugin->get('commissions_enable');
|
| 19 | 19 | $culqiEnable = $plugin->get('culqi_enable');
|
| 20 | 20 | |
| 21 | -if (isset($_GET['action'], $_GET['id'])) {
|
|
| 22 | - if ($_GET['action'] == 'delete_taccount') {
|
|
| 21 | +if (isset($_GET['action'], $_GET['id'])) { |
|
| 22 | + if ($_GET['action'] == 'delete_taccount') { |
|
| 23 | 23 | $plugin->deleteTransferAccount($_GET['id']); |
| 24 | 24 | |
| 25 | 25 | Display::addFlash( |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $currencyForm = new FormValidator('currency');
|
| 35 | 35 | |
| 36 | -if ($currencyForm->validate()) {
|
|
| 36 | +if ($currencyForm->validate()) { |
|
| 37 | 37 | $currencyFormValues = $currencyForm->getSubmitValues(); |
| 38 | 38 | |
| 39 | 39 | $plugin->selectCurrency($currencyFormValues['currency']); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | [get_lang('Select')]
|
| 60 | 60 | ); |
| 61 | 61 | |
| 62 | -foreach ($currencies as $currency) {
|
|
| 62 | +foreach ($currencies as $currency) { |
|
| 63 | 63 | $currencyText = implode( |
| 64 | 64 | ' => ', |
| 65 | 65 | [ |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $currencySelect->addOption($currencyText, $currencyValue); |
| 73 | 73 | |
| 74 | - if ($currency['status']) {
|
|
| 74 | + if ($currency['status']) { |
|
| 75 | 75 | $currencySelect->setSelected($currencyValue); |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | $paypalForm = new FormValidator('paypal');
|
| 86 | 86 | |
| 87 | -if ($paypalForm->validate()) {
|
|
| 87 | +if ($paypalForm->validate()) { |
|
| 88 | 88 | $paypalFormValues = $paypalForm->getSubmitValues(); |
| 89 | 89 | |
| 90 | 90 | $plugin->savePaypalParams($paypalFormValues); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $commissionForm = new FormValidator('commissions');
|
| 125 | 125 | |
| 126 | -if ($commissionForm->validate()) {
|
|
| 126 | +if ($commissionForm->validate()) { |
|
| 127 | 127 | $commissionFormValues = $commissionForm->getSubmitValues(); |
| 128 | 128 | |
| 129 | 129 | $plugin->updateCommission($commissionFormValues); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | $transferForm = new FormValidator('transfer_account');
|
| 151 | 151 | |
| 152 | -if ($transferForm->validate()) {
|
|
| 152 | +if ($transferForm->validate()) { |
|
| 153 | 153 | $transferFormValues = $transferForm->getSubmitValues(); |
| 154 | 154 | |
| 155 | 155 | $plugin->saveTransferAccount($transferFormValues); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | $culqiForm = new FormValidator('culqi_config');
|
| 190 | 190 | |
| 191 | -if ($culqiForm->validate()) {
|
|
| 191 | +if ($culqiForm->validate()) { |
|
| 192 | 192 | $culqiFormValues = $culqiForm->getSubmitValues(); |
| 193 | 193 | |
| 194 | 194 | $plugin->saveCulqiParameters($culqiFormValues); |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | $currencyForm->addTextarea( |
| 80 | 80 | 'terms_and_conditions', |
| 81 | 81 | [get_lang('TermsAndConditions'),
|
| 82 | - $plugin->get_lang('WriteHereTheTermsAndConditionsOfYourECommerce')],
|
|
| 82 | + $plugin->get_lang('WriteHereTheTermsAndConditionsOfYourECommerce')],
|
|
| 83 | 83 | [] |
| 84 | 84 | ); |
| 85 | 85 | $currencyForm->addButtonSave(get_lang('Save'));
|
@@ -30,9 +30,9 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | $resArray = CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL); |
| 32 | 32 | $ack = strtoupper($resArray["ACK"]); |
| 33 | -if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
|
|
| 33 | +if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") { |
|
| 34 | 34 | RedirectToPayPal($resArray["TOKEN"]); |
| 35 | -} else {
|
|
| 35 | +} else { |
|
| 36 | 36 | //Display a user friendly Error on the page using any of the following error information returned by PayPal |
| 37 | 37 | $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); |
| 38 | 38 | $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); |
@@ -21,16 +21,16 @@ discard block |
||
| 21 | 21 | $payoutStatuses = $plugin->getPayoutStatuses(); |
| 22 | 22 | $selectedStatus = isset($_GET['status']) ? $_GET['status'] : BuyCoursesPlugin::SALE_STATUS_COMPLETED; |
| 23 | 23 | |
| 24 | -if ($commissionsEnable !== "true") {
|
|
| 24 | +if ($commissionsEnable !== "true") { |
|
| 25 | 25 | api_not_allowed(true); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | $form = new FormValidator('search', 'get');
|
| 29 | 29 | |
| 30 | -if ($form->validate()) {
|
|
| 30 | +if ($form->validate()) { |
|
| 31 | 31 | $selectedStatus = $form->getSubmitValue('status');
|
| 32 | 32 | |
| 33 | - if ($selectedStatus === false) {
|
|
| 33 | + if ($selectedStatus === false) { |
|
| 34 | 34 | $selectedStatus = BuyCoursesPlugin::PAYOUT_STATUS_PENDING; |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | 'status' => $selectedStatus |
| 42 | 42 | ]); |
| 43 | 43 | |
| 44 | -switch ($selectedStatus) {
|
|
| 44 | +switch ($selectedStatus) { |
|
| 45 | 45 | case '2': |
| 46 | 46 | $payouts = $plugin->getPayouts($selectedStatus); |
| 47 | 47 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $payoutList = []; |
| 62 | 62 | |
| 63 | -foreach ($payouts as $payout) {
|
|
| 63 | +foreach ($payouts as $payout) { |
|
| 64 | 64 | $payoutList[] = [ |
| 65 | 65 | 'id' => $payout['id'], |
| 66 | 66 | 'sale_id' => $payout['sale_id'], |
@@ -53,4 +53,4 @@ |
||
| 53 | 53 | <div id="news" class="" style="min-height:300px;"></div> |
| 54 | 54 | </div> |
| 55 | 55 | </div> |
| 56 | -EOT; |
|
| 56 | +eot; |
|
@@ -22,4 +22,4 @@ |
||
| 22 | 22 | </div> |
| 23 | 23 | </div> |
| 24 | 24 | </div> |
| 25 | -EOT; |
|
| 25 | +eot; |
|
@@ -15,7 +15,9 @@ |
||
| 15 | 15 | $hostName = api_get_path(WEB_PATH); |
| 16 | 16 | |
| 17 | 17 | define('DOKU_BASE', '/tmp'); |
| 18 | -function getSecurityToken() {}; |
|
| 18 | +function getSecurityToken() |
|
| 19 | +{ |
|
| 20 | +}; |
|
| 19 | 21 | |
| 20 | 22 | //close sesseion |
| 21 | 23 | session_write_close(); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $result = Database::query($sql); |
| 43 | 43 | |
| 44 | 44 | if (Database::num_rows($result)) { |
| 45 | - $sql = "UPDATE $table SET |
|
| 45 | + $sql = "update $table SET |
|
| 46 | 46 | selected_value = '$value' |
| 47 | 47 | WHERE id = $settingId"; |
| 48 | 48 | Database::query($sql); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $result = $connection->fetchAll($sql); |
| 104 | 104 | |
| 105 | 105 | if (!empty($result)) { |
| 106 | - $sql = "UPDATE $table SET selected_value = '$value' WHERE id = $settingId"; |
|
| 106 | + $sql = "update $table SET selected_value = '$value' WHERE id = $settingId"; |
|
| 107 | 107 | $connection->executeQuery($sql); |
| 108 | 108 | } else { |
| 109 | 109 | $connection->insert($table, $params); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | Display::addFlash(Display::return_message("Disabling instance")); |
| 33 | 33 | // Make it not visible. |
| 34 | 34 | |
| 35 | - $sql = "UPDATE $table SET visible = 0 WHERE id IN ('$vidlist')"; |
|
| 35 | + $sql = "update $table SET visible = 0 WHERE id IN ('$vidlist')"; |
|
| 36 | 36 | Database::query($sql); |
| 37 | 37 | } |
| 38 | 38 | Virtual::redirect(api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/manage.php'); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | case 'enableinstances': |
| 41 | 41 | if (!empty($vidlist)) { |
| 42 | 42 | Display::addFlash(Display::return_message("Enabling instance")); |
| 43 | - $sql = "UPDATE $table SET visible = 1 WHERE id IN ('$vidlist') "; |
|
| 43 | + $sql = "update $table SET visible = 1 WHERE id IN ('$vidlist') "; |
|
| 44 | 44 | Database::query($sql); |
| 45 | 45 | } |
| 46 | 46 | Virtual::redirect(api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/manage.php'); |
@@ -69,14 +69,14 @@ discard block |
||
| 69 | 69 | $absalternatecourse = Virtual::getConfig('vchamilo', 'course_real_root'); |
| 70 | 70 | $coursedir = $absalternatecourse.$slug; |
| 71 | 71 | |
| 72 | - Display::addFlash(Display::return_message("Deleting $coursedir")); |
|
| 72 | + Display::addFlash(Display::return_message("deleting $coursedir")); |
|
| 73 | 73 | |
| 74 | 74 | removeDir($coursedir); |
| 75 | 75 | |
| 76 | 76 | if ($absalternatehome = Virtual::getConfig('vchamilo', 'home_real_root')) { |
| 77 | 77 | $homedir = $absalternatehome.'/'.$slug; |
| 78 | 78 | |
| 79 | - Display::addFlash(Display::return_message("Deleting $homedir")); |
|
| 79 | + Display::addFlash(Display::return_message("deleting $homedir")); |
|
| 80 | 80 | removeDir($homedir); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | if ($absalternatearchive = Virtual::getConfig('vchamilo', 'archive_real_root')) { |
| 85 | 85 | $archivedir = $absalternatearchive.'/'.$slug; |
| 86 | 86 | |
| 87 | - Display::addFlash(Display::return_message("Deleting $archivedir")); |
|
| 87 | + Display::addFlash(Display::return_message("deleting $archivedir")); |
|
| 88 | 88 | removeDir($archivedir); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if ($dir = Virtual::getConfig('vchamilo', 'upload_real_root')) { |
| 93 | 93 | $dir = $dir.'/'.$slug; |
| 94 | 94 | |
| 95 | - Display::addFlash(Display::return_message("Deleting $dir")); |
|
| 95 | + Display::addFlash(Display::return_message("deleting $dir")); |
|
| 96 | 96 | removeDir($dir); |
| 97 | 97 | } |
| 98 | 98 | } |