Browse Source

Remove header class

Julio Montoya 9 years ago
parent
commit
471cd47e93

+ 2 - 1
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;
         }
     }
 

+ 2 - 1
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 */

+ 2 - 1
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 */

+ 2 - 1
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);

+ 6 - 4
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;
     }
 }
 

+ 4 - 2
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) {

+ 0 - 23
main/inc/lib/system/web/header.class.php

@@ -1,23 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-
-/**
- * Header utility functions.
- *
- * @license see /license.txt
- * @author Laurent Opprecht <laurent@opprecht.info> 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;
-    }
-}

+ 6 - 5
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;
                         }
                     }

+ 1 - 1
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']);