diff --git a/main/admin/index.php b/main/admin/index.php index 2fe2c98cf3..f1ef5c592e 100644 --- a/main/admin/index.php +++ b/main/admin/index.php @@ -498,7 +498,8 @@ if (api_is_platform_admin()) { file_put_contents($fullFilePath, $extraData['extra_content']); - Header::location(api_get_self()); + header('Location: '.api_get_self()); + exit; } } diff --git a/main/admin/skill_create.php b/main/admin/skill_create.php index 2f93b0a79d..a3b446e438 100644 --- a/main/admin/skill_create.php +++ b/main/admin/skill_create.php @@ -90,7 +90,8 @@ if ($createForm->validate()) { ); } - Header::location(api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php'); + header('Location: '.api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php'); + exit; } /* view */ diff --git a/main/admin/skill_edit.php b/main/admin/skill_edit.php index d7ab12194e..59513d99e2 100644 --- a/main/admin/skill_edit.php +++ b/main/admin/skill_edit.php @@ -94,7 +94,8 @@ if ($editForm->validate()) { ); } - Header::location(api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php'); + header('Location: '.api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php'); + exit; } /* view */ diff --git a/main/gradebook/certificate_report.php b/main/gradebook/certificate_report.php index 513f94b6cd..65c4981497 100644 --- a/main/gradebook/certificate_report.php +++ b/main/gradebook/certificate_report.php @@ -187,7 +187,8 @@ if ($searchSessionAndCourse || $searchCourseOnly) { if (empty($selectedStudentInfo)) { Session::write('reportErrorMessage', get_lang('NoUser')); - Header::location($selfUrl); + header('Location: '.$selfUrl); + exit; } $sessionList = SessionManager::getSessionsFollowedByUser($selectedStudent); diff --git a/main/gradebook/search.php b/main/gradebook/search.php index 90df63ded0..9f6653d3cf 100644 --- a/main/gradebook/search.php +++ b/main/gradebook/search.php @@ -37,15 +37,16 @@ if ($searchForm->validate()) { if (empty($userList)) { Session::write('message', Display::return_message(get_lang('NoResults'), 'warning')); - Header::location(api_get_self()); + header('Location: '.api_get_self()); + exit; } } elseif ($userId > 0) { $userInfo = api_get_user_info($userId); if (empty($userInfo)) { Session::write('message', Display::return_message(get_lang('NoUser'), 'warning')); - - Header::location(api_get_self()); + header('Location: '.api_get_self()); + exit; } $courseList = GradebookUtils::getUserCertificatesInCourses($userId, false); @@ -60,7 +61,8 @@ if ($searchForm->validate()) { ) ); - Header::location(api_get_self()); + header('Location: '.api_get_self()); + exit; } } diff --git a/main/inc/lib/javascript/chat/video.php b/main/inc/lib/javascript/chat/video.php index c751a11302..30923e8b6e 100644 --- a/main/inc/lib/javascript/chat/video.php +++ b/main/inc/lib/javascript/chat/video.php @@ -11,7 +11,8 @@ $roomName = isset($_GET['room']) ? $_GET['room'] : null; $room = VideoChat::getChatRoomByName($roomName); if ($room === false) { - Header::location(api_get_path(WEB_PATH)); + header('Location: '.api_get_path(WEB_PATH)); + exit; } $friend_html = SocialManager::listMyFriendsBlock($user_id, '', false); @@ -20,7 +21,8 @@ $isSender = $room['from_user'] == api_get_user_id(); $isReceiver = $room['to_user'] == api_get_user_id(); if (!$isSender && !$isReceiver) { - Header::location(api_get_path(WEB_PATH)); + header('Location: '.api_get_path(WEB_PATH)); + exit; } if ($isSender) { diff --git a/main/inc/lib/system/web/header.class.php b/main/inc/lib/system/web/header.class.php deleted file mode 100755 index 75137f1541..0000000000 --- a/main/inc/lib/system/web/header.class.php +++ /dev/null @@ -1,23 +0,0 @@ - for the Univesity of Geneva - * @deprecated - */ -class Header -{ - /** - * Redirect the navigator to the specified url. - * - * @param string $url - */ - public static function location($url) - { - header("Location: $url"); - exit; - } -} diff --git a/plugin/advanced_subscription/ajax/advanced_subscription.ajax.php b/plugin/advanced_subscription/ajax/advanced_subscription.ajax.php index 74f5edcebd..d9d6c59cdb 100644 --- a/plugin/advanced_subscription/ajax/advanced_subscription.ajax.php +++ b/plugin/advanced_subscription/ajax/advanced_subscription.ajax.php @@ -156,7 +156,7 @@ if ($verified) { if (isset($result['mailIds']['render'])) { // Render mail $url = $plugin->getRenderMailUrl(array('queueId' => $result['mailIds']['render'])); - Header::location($url); + header('Location: '.$url); exit; } } @@ -180,7 +180,7 @@ if ($verified) { if (isset($result['mailIds']['render'])) { // Render mail $url = $plugin->getRenderMailUrl(array('queueId' => $result['mailIds']['render'])); - Header::location($url); + header('Location: '.$url); exit; } } @@ -190,7 +190,7 @@ if ($verified) { if ($lastMessageId !== false) { // Render mail $url = $plugin->getRenderMailUrl(array('queueId' => $lastMessageId)); - Header::location($url); + header('Location: '.$url); exit; } else { if (is_string($res)) { @@ -200,7 +200,8 @@ if ($verified) { } $result['pass'] = false; $url = $plugin->getTermsUrl($data, ADVANCED_SUBSCRIPTION_TERMS_MODE_FINAL); - Header::location($url); + header('Location: '.$url); + exit; } } @@ -329,7 +330,7 @@ if ($verified) { if (isset($result['mailIds']['render'])) { // Render mail $url = $plugin->getRenderMailUrl(array('queueId' => $result['mailIds']['render'])); - Header::location($url); + header('Location: '.$url); exit; } } diff --git a/plugin/advanced_subscription/src/terms_and_conditions.php b/plugin/advanced_subscription/src/terms_and_conditions.php index 4eae379080..7f6f2a3bfa 100644 --- a/plugin/advanced_subscription/src/terms_and_conditions.php +++ b/plugin/advanced_subscription/src/terms_and_conditions.php @@ -39,7 +39,7 @@ if ( if ($lastMessageId !== false) { // Render mail $url = $plugin->getRenderMailUrl(array('queueId' => $lastMessageId)); - Header::location($url); + header('Location: '.$url); exit; } $courses = SessionManager::get_course_list_by_session_id($data['sessionId']);