Merge pull request #1499 from nosolored/t0007

Redirect to 'buycourses' plugin after the registration form
1.10.x
Julio Montoya 9 years ago committed by GitHub
commit a55cbc8bdf
  1. 5
      main/auth/inscription.php
  2. 2
      plugin/buycourses/src/process.php
  3. 6
      plugin/buycourses/view/catalog.tpl

@ -719,6 +719,11 @@ if ($form->validate()) {
}
}
if (!empty($_SESSION['urlReturn'])) {
$form_data['action'] = api_get_path(WEB_PATH).$_SESSION['urlReturn'];
Session::erase('urlReturn');
}
$form_data = CourseManager::redirectToCourse($form_data);
$form_register = new FormValidator('form_register', 'post', $form_data['action']);

@ -8,10 +8,12 @@
* Initialization
*/
require_once '../config.php';
use ChamiloSession as Session;
$currentUserId = api_get_user_id();
if (empty($currentUserId)) {
Session::write('urlReturn', Security :: remove_XSS($_SERVER['REQUEST_URI']));
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'auth/inscription.php');
exit;
}

@ -42,10 +42,10 @@
</div>
{% elseif course.enrolled == "NO" %}
<div class="text-center">
<a class="ajax btn btn-primary" title="" href="{{ course_description_url }}" data-title="{{ course.title }}">
<a class="ajax btn btn-primary btn-sm" title="" href="{{ course_description_url }}" data-title="{{ course.title }}">
<em class="fa fa-file-text"></em> {{ 'SeeDescription'|get_plugin_lang('BuyCoursesPlugin') }}
</a>
<a class="btn btn-success" title="" href="{{ _p.web_plugin ~ 'buycourses/src/process.php?' ~ {'i': course.id, 't': 1}|url_encode() }}">
<a class="btn btn-success btn-sm" title="" href="{{ _p.web_plugin ~ 'buycourses/src/process.php?' ~ {'i': course.id, 't': 1}|url_encode() }}">
<em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
</a>
</div>
@ -92,7 +92,7 @@
</div>
{% elseif session.enrolled == "NO" %}
<div class="text-center">
<a class="btn btn-success" href="{{ _p.web_plugin ~ 'buycourses/src/process.php?' ~ {'i': session.id, 't': 2}|url_encode() }}">
<a class="btn btn-success btn-sm" href="{{ _p.web_plugin ~ 'buycourses/src/process.php?' ~ {'i': session.id, 't': 2}|url_encode() }}">
<em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
</a>
</div>

Loading…
Cancel
Save