Commit bcec71e8 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

key will be included into opensearch.xml

parent ee27fc43
......@@ -29,7 +29,7 @@ class KeyController extends Controller
$host = $request->header("Host", "");
}
Cookie::queue('key', $key, 525600, '/meta/', null, false, false);
Cookie::queue('key', $key, 525600, '/', null, false, false);
return redirect($redirUrl);
} else {
return view('key')
......@@ -41,7 +41,7 @@ class KeyController extends Controller
public function removeKey(Request $request)
{
$redirUrl = $request->input('redirUrl', "");
Cookie::queue('key', '', 0, '/meta/', null, false, false);
Cookie::queue('key', '', 0, '/', null, false, false);
$url = LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), action('KeyController@index', ['redirUrl' => $redirUrl]));
return redirect($url);
}
......@@ -68,7 +68,6 @@ class KeyController extends Controller
} else {
return false;
}
} catch (\ErrorException $e) {
return false;
}
......
......@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App;
use Cookie;
use Illuminate\Http\Request;
use Jenssegers\Agent\Agent;
use LaravelLocalization;
......@@ -76,13 +77,15 @@ class StartpageController extends Controller
return loadPage($subpage);
}
public function loadPlugin($locale = "de")
public function loadPlugin(Request $request, $locale = "de")
{
$link = action('MetaGerSearch@search', []);
$key = Cookie::get('key');
$response = Response::make(
view('plugin')
->with('link', $link)
->with('key', $key)
, "200");
$response->header('Content-Type', "application/opensearchdescription+xml");
return $response;
......
......@@ -4,6 +4,6 @@
<Description>{{ trans('plugin.description') }}</Description>
<Contact>office@suma-ev.de</Contact>
<Image width="16" height="16" type="image/x-icon">{{ url('/favicon.ico') }}</Image>
<Url type="text/html" template="{{ $link }}?eingabe={searchTerms}" method="GET" />
<Url type="text/html" template="{{ $link }}?{{ empty($key) ? "" : "key=" . urlencode($key) . "&amp;" }}eingabe={searchTerms}" method="GET" />
<InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment