Check variables initialization to avoid notice

1.10.x
Yannick Warnier 10 years ago
parent 18d0d7e5a0
commit 9c6076f2ce
  1. 16
      main/course_home/course_home.php

@ -154,13 +154,15 @@ if (api_is_invitee()) {
Session::erase('toolgroup');
Session::erase('_gid');
$is_speacialcourse = CourseManager::is_special_course($course_code);
if ($is_speacialcourse) {
$autoreg = Security::remove_XSS($_GET['autoreg']);
if ($autoreg == 1) {
if (CourseManager::subscribe_user($user_id, $course_code, $status = STUDENT)) {
Session::write('is_allowed_in_course', true);
$isSpecialCourse = CourseManager::is_special_course($course_code);
if ($isSpecialCourse) {
if (isset($_GET['autoreg'])) {
$autoRegistration = Security::remove_XSS($_GET['autoreg']);
if ($autoRegistration == 1) {
if (CourseManager::subscribe_user($user_id, $course_code, $status = STUDENT)) {
Session::write('is_allowed_in_course', true);
}
}
}
}

Loading…
Cancel
Save