web.php 7.45 KB
Newer Older
Dominik Hebeler's avatar
Dominik Hebeler committed
1
2
3
4
<?php

/*
|--------------------------------------------------------------------------
5
| Web Routes
Dominik Hebeler's avatar
Dominik Hebeler committed
6
7
|--------------------------------------------------------------------------
|
8
9
10
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
Dominik Hebeler's avatar
Dominik Hebeler committed
11
|
12
 */
karl's avatar
karl committed
13

14
15
16
17
18
19
20
Route::group(
    [
        'prefix' => LaravelLocalization::setLocale(), /*,
    'middleware' => [ 'localeSessionRedirect', 'localizationRedirect' ]*/
    ],
    function () {
        /** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/
21

22
        Route::get('/', 'StartpageController@loadStartPage');
Dominik Hebeler's avatar
Dominik Hebeler committed
23

24
        Route::get('img/piwik.png', 'ImageController@generateImage');
Dominik Hebeler's avatar
Dominik Hebeler committed
25

26
27
28
29
30
31
32
33
        Route::get('impressum', function () {
            return view('impressum')
                ->with('title', trans('titles.impressum'))
                ->with('navbarFocus', 'kontakt');
        });
        Route::get('impressum.html', function () {
            return redirect(url('impressum'));
        });
34

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
        Route::get('about', function () {
            return view('about')
                ->with('title', trans('titles.about'))
                ->with('navbarFocus', 'kontakt');
        });
        Route::get('team', function () {
            return view('team.team')
                ->with('title', trans('titles.team'))
                ->with('navbarFocus', 'kontakt');
        });
        Route::get('team/pubkey-wsb', function () {
            return view('team.pubkey-wsb')
                ->with('title', trans('titles.team'))
                ->with('navbarFocus', 'kontakt');
        });
50

51
52
53
54
55
        Route::get('kontakt', function () {
            return view('kontakt.kontakt')
                ->with('title', trans('titles.kontakt'))
                ->with('navbarFocus', 'kontakt');
        });
Dominik Hebeler's avatar
Dominik Hebeler committed
56

57
        Route::post('kontakt', 'MailController@contactMail');
58

59
60
61
62
63
64
65
66
67
68
        Route::get('tor', function () {
            return view('tor')
                ->with('title', 'tor hidden service - MetaGer')
                ->with('navbarFocus', 'dienste');
        });
        Route::get('spende', function () {
            return view('spende.spende')
                ->with('title', trans('titles.spende'))
                ->with('navbarFocus', 'foerdern');
        });
69
        Route::get('spende/danke/{data}', ['as' => 'danke', function ($data) {
70
71
72
73
            return view('spende.danke')
                ->with('title', trans('titles.spende'))
                ->with('navbarFocus', 'foerdern')
                ->with('data', unserialize(base64_decode($data)));
74
        }]);
75
76
77
        Route::get('partnershops', function () {
            return view('spende.partnershops')
                ->with('title', trans('titles.partnershops'))
78
                ->with('navbarFocus', 'foerdern');
79
        });
80

81
82
83
84
85
        Route::get('beitritt', function () {
            return view('spende.beitritt')
                ->with('title', trans('titles.beitritt'))
                ->with('navbarFocus', 'foerdern');
        });
86

87
88
89
90
91
92
93
94
        Route::get('bform1.htm', function () {
            return redirect('beitritt');
        });
        Route::get('spendenaufruf', function () {
            return view('spende.spendenaufruf')
                ->with('title', 'Spendenaufruf - MetaGer')
                ->with('navbarFocus', 'foerdern');
        });
95

96
        Route::post('spende', 'MailController@donation');
97

98
99
100
101
102
        Route::get('datenschutz', function () {
            return view('datenschutz')
                ->with('title', trans('titles.datenschutz'))
                ->with('navbarFocus', 'datenschutz');
        });
Dominik Hebeler's avatar
Dominik Hebeler committed
103

104
105
106
        Route::get('hilfe', function () {
            return view('hilfe')
                ->with('title', trans('titles.hilfe'))
107
108
                ->with('navbarFocus', 'hilfe');
        });
109

110
111
112
113
        Route::get('faq', function () {
            return view('faq')
                ->with('title', trans('titles.faq'))
                ->with('navbarFocus', 'hilfe');
114
        });
115

116
        Route::get('widget', function () {
117
            return view('widget.widget')
118
119
                ->with('title', trans('titles.widget'))
                ->with('navbarFocus', 'dienste');
karl's avatar
karl committed
120
        });
121
122
123

        Route::get('sitesearch', 'SitesearchController@loadPage');

124
        Route::get('websearch', function () {
125
126
            return view('widget.websearch')
                ->with('title', trans('titles.websearch'))
127
                ->with('navbarFocus', 'dienste');
128
129
        });

130
131
        Route::get('zitat-suche', 'ZitatController@zitatSuche');

132
133
134
135
136
137
        Route::group(['middleware' => ['referer.check'], 'prefix' => 'admin'], function () {
            Route::get('/', 'AdminInterface@index');
            Route::get('count', 'AdminInterface@count');
            Route::get('check', 'AdminInterface@check');
            Route::get('engines', 'AdminInterface@engines');
        });
Dominik Hebeler's avatar
Dominik Hebeler committed
138

139
        Route::get('settings', 'StartpageController@loadSettings');
karl's avatar
karl committed
140

141
        Route::match(['get', 'post'], 'meta/meta.ger3', 'MetaGerSearch@search');
142
        Route::get('noaccess/{redirect}', 'MetaGerSearch@botProtection');
143
144
145
146
        Route::get('meta/picture', 'Pictureproxy@get');
        Route::get('clickstats', 'LogController@clicklog');
        Route::get('pluginClose', 'LogController@pluginClose');
        Route::get('pluginInstall', 'LogController@pluginInstall');
147

148
149
150
151
152
153
        Route::get('qt', 'MetaGerSearch@quicktips');
        Route::get('tips', 'MetaGerSearch@tips');
        Route::get('/plugins/{params}/opensearch.xml', 'StartpageController@loadPlugin');
        Route::get('owi', function () {
            return redirect('https://metager.de/klassik/en/owi/');
        });
Dominik Hebeler's avatar
Dominik Hebeler committed
154
155
156
157
158
159
        Route::get('MG20', function () {
            return redirect('https://metager.de/klassik/MG20');
        });
        Route::get('databund', function () {
            return redirect('https://metager.de/klassik/databund');
        });
160
        Route::get('languages', 'LanguageController@createOverview');
161
        Route::get('languages/edit/{from}/{to}/{exclude?}/{email?}', 'LanguageController@createEditPage');
162
        Route::post('languages/edit/{from}/{to}/{exclude?}', 'MailController@sendLanguageFile');
163
        Route::get('berlin', 'StartpageController@berlin');
164
165
166
167
168
169
170
171
172
173
174
175
176

        Route::group(['prefix' => 'app'], function () {
            Route::get('/', function () {
                return view('app')
                    ->with('title', trans('titles.app'))
                    ->with('navbarFocus', 'dienste');
            });
            Route::get('metager', function () {
                $filePath = storage_path() . "/app/public/MetaGer-release.apk";
                return response()->download($filePath, "MetaGer-release.apk");
            });

            Route::get('maps', function () {
Dominik Hebeler's avatar
Dominik Hebeler committed
177
                $filePath     = env('maps_app');
178
179
180
181
182
183
184
                $fileContents = file_get_contents($filePath);
                return response($fileContents, 200)
                    ->header('Cache-Control', 'public')
                    ->header('Content-Type', 'application/vnd.android.package-archive')
                    ->header('Content-Transfer-Encoding', 'Binary')
                    ->header("Content-Disposition", "attachment; filename=app-release.apk");
            });
Dominik Hebeler's avatar
Dominik Hebeler committed
185
186
187
188
189
190
            Route::get('maps/version', function () {
                $filePath     = env('maps_version');
                $fileContents = file_get_contents($filePath);
                return response($fileContents, 200)
                    ->header('Content-Type', 'text/plain');
            });
191
        });
192
    });