diff --git a/.gitignore b/.gitignore index 1770e1b1c25cac60f62f129e594271d1f95c9888..39b7301419844d473a136dff2740e9ae1290d2d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ metager/_ide_helper.php -metager/.phpstorm.meta.php \ No newline at end of file +metager/.phpstorm.meta.php +metager/config/sumasEn.json diff --git a/metager/app/Http/Controllers/MailController.php b/metager/app/Http/Controllers/MailController.php index fdca961ee63131f912335444b389664ba56eeb3b..0ae45bc979a1f67d38fa4d97dbbbbe7cee867a89 100644 --- a/metager/app/Http/Controllers/MailController.php +++ b/metager/app/Http/Controllers/MailController.php @@ -71,7 +71,7 @@ class MailController extends Controller "email" => $replyTo, "subject" => $subject, "ip" => $request->ip(), - "deptId" => 5, + "topicId" => 11, // English "message" => "data:text/plain;charset=utf-8, $message", "attachments" => [] ]; @@ -87,7 +87,7 @@ class MailController extends Controller $language = Localization::getLanguage(); if ($language === "de") { - $postdata["deptId"] = 1; + $postdata["topicId"] = 1; // German } $postdata = json_encode($postdata); @@ -110,9 +110,9 @@ class MailController extends Controller "curlopts" => [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => $postdata, - CURLOPT_LOW_SPEED_TIME => 20, + CURLOPT_LOW_SPEED_TIME => 60, CURLOPT_CONNECTTIMEOUT => 10, - CURLOPT_TIMEOUT => 20 + CURLOPT_TIMEOUT => 60 ] ]; $mission = json_encode($mission); diff --git a/metager/app/Http/Middleware/BrowserVerification.php b/metager/app/Http/Middleware/BrowserVerification.php index 3ba5a071a34313cc0ded06098bb55227e3ab2962..e6a5ec0448d9d153236c92d647c51c97d8ab8dd7 100644 --- a/metager/app/Http/Middleware/BrowserVerification.php +++ b/metager/app/Http/Middleware/BrowserVerification.php @@ -41,7 +41,7 @@ class BrowserVerification } } - if (($request->input("out", "") === "api" || $request->input("out", "") === "atom10") && app('App\Models\Key')->getStatus()) { + if (\in_array($request->input("out", ""), ["api", "atom10", "rss20"]) && (app('App\Models\Key')->getStatus() || ($request->filled("key") && $request->input('key') === config("metager.metager.keys.uni_mainz")))) { header('Content-type: application/xml; charset=utf-8'); } elseif (($request->input("out", "") === "api" || $request->input("out", "") === "atom10") && !app('App\Models\Key')->getStatus()) { \app()->make(QueryTimer::class)->observeEnd(self::class); @@ -50,18 +50,20 @@ class BrowserVerification header('Content-type: text/html; charset=utf-8'); } header('X-Accel-Buffering: no'); + ini_set('zlib.output_compression', 'Off'); + ini_set('output_buffering', 'Off'); + ini_set('output_handler', ''); + ob_end_clean(); //use parameter for middleware to skip this when using associator - if (($request->filled("loadMore") && Cache::has($request->input("loadMore"))) || app('App\Models\Key')->getStatus()) { + if (($request->filled("loadMore") && Cache::has($request->input("loadMore"))) || app('App\Models\Key')->getStatus() || + ($request->filled("key") && $request->input('key') === config("metager.metager.keys.uni_mainz")) + ) { \app()->make(QueryTimer::class)->observeEnd(self::class); + \app()->make(SearchSettings::class)->header_printed = false; return $next($request); } - ini_set('zlib.output_compression', 'Off'); - ini_set('output_buffering', 'Off'); - ini_set('output_handler', ''); - ob_end_clean(); - if ($request->filled("mgv")) { $key = $request->input('mgv', ""); // Verify that key is a md5 checksum