Whispeak: Fix auth with a LP - refs BT#18476

pull/3758/head
Angel Fernando Quiroz Campos 5 years ago
parent 22cd9e75fb
commit 6ec0b00b22
  1. 19
      main/lp/lp_content.php

@ -56,16 +56,6 @@ if ($dir) {
$learnPath->stop_previous_item();
$prerequisiteCheck = $learnPath->prerequisites_match($lpItemId);
if ($prerequisiteCheck === true) {
if (WhispeakAuthPlugin::isLpItemMarked($lpItemId)) {
ChamiloSession::write(
WhispeakAuthPlugin::SESSION_LP_ITEM,
['lp' => $learnPath->lp_id, 'lp_item' => $lpItemId, 'src' => $src]
);
$src = api_get_path(WEB_PLUGIN_PATH).'whispeakauth/authentify.php';
break;
}
$src = $learnPath->get_link('http', $lpItemId);
if (empty($src)) {
$src = 'blank.php?'.api_get_cidreq().'&error=document_protected';
@ -74,6 +64,15 @@ if ($dir) {
$learnPath->start_current_item(); // starts time counter manually if asset
$src = $learnPath->fixBlockedLinks($src);
if (WhispeakAuthPlugin::isLpItemMarked($lpItemId)) {
ChamiloSession::write(
WhispeakAuthPlugin::SESSION_LP_ITEM,
['lp' => $learnPath->lp_id, 'lp_item' => $lpItemId, 'src' => $src]
);
$src = api_get_path(WEB_PLUGIN_PATH).'whispeakauth/authentify.php';
}
break;
}
$src = 'blank.php?'.api_get_cidreq().'&error=prerequisites&prerequisite_message='.Security::remove_XSS($learnPath->error);

Loading…
Cancel
Save