From 4405d3dbf0e5714336eab92d79eacfc175a7984b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Apr 2014 19:12:50 -0400 Subject: [PATCH] Fixing access error messsage -refs #6768 --- main/auth/inscription.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/auth/inscription.php b/main/auth/inscription.php index 1cdf0aee45..e6c20c1782 100644 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -544,13 +544,13 @@ if ($form->validate()) { $form_data['button'] = Display::button('next', get_lang('GoToCourse', null, $_user['language']), array('class' => 'btn btn-primary btn-large')); $exercise_redirect = intval(Session::read('exercise_redirect')); - - if (!empty($exercise_redirect)) { + $objExercise = new Exercise(); + $result = $objExercise->read($exercise_id); + if (!empty($exercise_redirect) && !empty($result)) { $form_data['action'] = api_get_path(WEB_CODE_PATH).'exercice/overview.php?exerciseId='.intval($exercise_redirect).'&cidReq='.$course_info['code']; $form_data['message'] .= '
'.get_lang('YouCanAccessTheExercise'); $form_data['button'] = Display::button('next', get_lang('Go', null, $_user['language']), array('class' => 'btn btn-primary btn-large')); } - if (!empty($form_data['action'])) { header('Location: '.$form_data['action']); exit;