web.php 8.94 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 13 14 15 16 17 18 19
 */
Route::group(
    [
        'prefix' => LaravelLocalization::setLocale(), /*,
    'middleware' => [ 'localeSessionRedirect', 'localizationRedirect' ]*/
    ],
    function () {
        /** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/
20

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

23 24 25 26 27 28
        Route::get('asso', 'Assoziator@asso'/*function(){
            return view('assoziator.asso')
                ->with('title', trans('titles.asso'))
                ->with('navbarFocus', 'dienste');
        }*/);

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

31 32 33 34 35 36 37 38
        Route::get('impressum', function () {
            return view('impressum')
                ->with('title', trans('titles.impressum'))
                ->with('navbarFocus', 'kontakt');
        });
        Route::get('impressum.html', function () {
            return redirect(url('impressum'));
        });
39

40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
        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');
        });
55

56
        Route::get('kontakt/{url?}', function ($url = "") {
57 58
            return view('kontakt.kontakt')
                ->with('title', trans('titles.kontakt'))
59
                ->with('navbarFocus', 'kontakt')
60
                ->with('url', $url);
61
        });
Dominik Hebeler's avatar
Dominik Hebeler committed
62

63
        Route::post('kontakt', 'MailController@contactMail');
64

65 66 67 68 69 70 71 72 73 74
        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');
        });
75
        Route::get('spende/danke/{data}', ['as' => 'danke', function ($data) {
76 77 78 79
            return view('spende.danke')
                ->with('title', trans('titles.spende'))
                ->with('navbarFocus', 'foerdern')
                ->with('data', unserialize(base64_decode($data)));
80
        }]);
81 82 83
        Route::get('partnershops', function () {
            return view('spende.partnershops')
                ->with('title', trans('titles.partnershops'))
84
                ->with('navbarFocus', 'foerdern');
85
        });
86

87 88 89 90 91
        Route::get('beitritt', function () {
            return view('spende.beitritt')
                ->with('title', trans('titles.beitritt'))
                ->with('navbarFocus', 'foerdern');
        });
92

93 94 95
        Route::get('bform1.htm', function () {
            return redirect('beitritt');
        });
96

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

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

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

Karl Hasselbring's avatar
Karl Hasselbring committed
111
        Route::get('hilfe/faktencheck', function () {
112 113 114 115 116
            return view('faktencheck')
                ->with('title', trans('titles.faktencheck'))
                ->with('navbarFocus', 'hilfe');
        });

117 118 119 120
        Route::get('faq', function () {
            return view('faq')
                ->with('title', trans('titles.faq'))
                ->with('navbarFocus', 'hilfe');
121
        });
122

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

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

131
        Route::get('websearch', function () {
132 133
            return view('widget.websearch')
                ->with('title', trans('titles.websearch'))
134
                ->with('navbarFocus', 'dienste');
135 136
        });

137 138
        Route::get('zitat-suche', 'ZitatController@zitatSuche');

Karl Hasselbring's avatar
Karl Hasselbring committed
139 140 141 142 143
        Route::get('jugendschutz', function () {
            return view('jugendschutz')
                ->with('title', trans('titles.jugendschutz'));
        });

Karl Hasselbring's avatar
Karl Hasselbring committed
144 145 146 147 148
        Route::get('ad-info', function () {
            return view('ad-info')
                ->with('title', trans('titles.ad-info'));
        });

Karl Hasselbring's avatar
Karl Hasselbring committed
149 150 151 152 153 154 155 156 157 158 159 160
        Route::get('age.xml', function () {
            $response = Response::make(file_get_contents(resource_path('age/age.xml')));
            $response->header('Content-Type', "application/xml");
            return $response;
        });

        Route::get('age-de.xml', function () {
            $response = Response::make(file_get_contents(resource_path('age/age-de.xml')));
            $response->header('Content-Type', "application/xml");
            return $response;
        });

Karl Hasselbring's avatar
Karl Hasselbring committed
161
        Route::group([/*'middleware' => ['referer.check'],*/'prefix' => 'admin'], function () {
162
            Route::get('/', 'AdminInterface@index');
Karl Hasselbring's avatar
Karl Hasselbring committed
163
            Route::match(['get', 'post'], 'count', 'AdminInterface@count');
164 165 166
            Route::get('check', 'AdminInterface@check');
            Route::get('engines', 'AdminInterface@engines');
        });
167

168
        Route::get('settings', 'StartpageController@loadSettings');
169

Dominik Hebeler's avatar
Dominik Hebeler committed
170 171 172
        Route::match(['get', 'post'], 'meta/meta.ger3', 'MetaGerSearch@search')->middleware('humanverification');
        Route::post('img/cat.jpg', 'HumanVerification@remove');
        Route::get('r/metager/{mm}/{pw}/{url}', ['as' => 'humanverification', 'uses' => 'HumanVerification@removeGet']);
173
        Route::post('img/dog.jpg', 'HumanVerification@whitelist');
Karl Hasselbring's avatar
Karl Hasselbring committed
174

175 176 177 178
        Route::get('meta/picture', 'Pictureproxy@get');
        Route::get('clickstats', 'LogController@clicklog');
        Route::get('pluginClose', 'LogController@pluginClose');
        Route::get('pluginInstall', 'LogController@pluginInstall');
179

180 181 182 183 184 185
        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/');
        });
186 187 188 189 190 191
        Route::get('MG20', function () {
            return redirect('https://metager.de/klassik/MG20');
        });
        Route::get('databund', function () {
            return redirect('https://metager.de/klassik/databund');
        });
192
        Route::get('languages', 'LanguageController@createOverview');
193
        Route::get('synoptic/{exclude?}/{chosenFile?}', 'LanguageController@createSynopticEditPage');
194
        Route::post('synoptic/{exclude?}/{chosenFile?}', 'LanguageController@processSynopticPageInput');
195
        Route::get('languages/edit/{from}/{to}/{exclude?}/{email?}', 'LanguageController@createEditPage');
Aria Givi's avatar
Aria Givi committed
196
        Route::post('languages/edit/{from}/{to}/{exclude?}/{email?}', 'MailController@sendLanguageFile');
197
        Route::get('berlin', 'StartpageController@berlin');
198 199 200 201 202 203 204 205 206 207 208 209

        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 () {
Karl Hasselbring's avatar
Karl Hasselbring committed
210
                $filePath = env('maps_app');
211 212 213 214 215 216 217
                $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
218

Dominik Hebeler's avatar
Dominik Hebeler committed
219
            Route::get('maps/version', function () {
Karl Hasselbring's avatar
Karl Hasselbring committed
220
                $filePath = env('maps_version');
Dominik Hebeler's avatar
Dominik Hebeler committed
221 222 223 224
                $fileContents = file_get_contents($filePath);
                return response($fileContents, 200)
                    ->header('Content-Type', 'text/plain');
            });
225
        });
226
    });