diff --git a/app/Http/Controllers/HumanVerification.php b/app/Http/Controllers/HumanVerification.php new file mode 100644 index 0000000000000000000000000000000000000000..5e745da76ee875d6013e451804fbee17e3371cf4 --- /dev/null +++ b/app/Http/Controllers/HumanVerification.php @@ -0,0 +1,68 @@ +<?php + +namespace App\Http\Controllers; + +use Illuminate\Http\Request; +use Validator; +use Input; +use DB; +use Carbon; + +class HumanVerification extends Controller +{ + public static function captcha(Request $request, $id, $url){ + if($request->getMethod() == 'POST'){ + $rules = ['captcha' => 'required|captcha']; + $validator = Validator::make($request->all(), $rules); + if($validator->fails()){ + return view('captcha')->with('title', 'Bestätigung notwendig')->with('id', $id)->with('url', base64_decode($url))->with('errorMessage', 'Bitte Captcha eingeben:'); + }else{ + # If we can unlock the Account of this user we will redirect him to the result page + $id = $request->input('id'); + $url = $request->input('url'); + + $user = DB::table('humanverification')->where('id', $id)->first(); + if($user !== null && $user->locked === 1){ + DB::table('humanverification')->where('id', $id)->update(['locked' => false]); + return redirect($url); + }else{ + return redirect('/'); + } + } + } + return view('captcha')->with('title', 'Bestätigung notwendig')->with('id', $id)->with('url', base64_decode($url)); + } + + public static function remove(Request $request){ + if(!$request->has('mm')){ + abort(404, "Keine Katze gefunden."); + } + $id = md5($request->ip()); + if(HumanVerification::checkId($request, $request->input('mm'))){ + # Remove the entry from the database + DB::table('humanverification')->where('id', $id)->where('updated_at', '<', Carbon::NOW()->subSeconds(2) )->delete(); + } + return response(hex2bin('89504e470d0a1a0a0000000d494844520000000100000001010300000025db56ca00000003504c5445000000a77a3dda0000000174524e530040e6d8660000000a4944415408d76360000000020001e221bc330000000049454e44ae426082'), 200) + ->header('Content-Type', 'image/png'); + } + + public static function removeGet(Request $request, $mm, $password, $url){ + $url = base64_decode($url); + + # If the user is correct and the password is we will delete any entry in the database + $requiredPass = md5($mm . Carbon::NOW()->day . $url . env("PROXY_PASSWORD")); + if(HumanVerification::checkId($request, $mm) && $requiredPass === $password){ + # Remove the entry from the database + DB::table('humanverification')->where('id', $mm)->where('updated_at', '<', Carbon::NOW()->subSeconds(2) )->delete(); + } + return redirect($url); + } + + private static function checkId($request, $id){ + if(md5($request->ip()) === $id){ + return true; + }else{ + return false; + } + } +} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 308d74c647cb52d7640473d45046b2e90f506d18..3d09c78a379345664050c61c227711dd9e9aaa0a 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -16,6 +16,7 @@ class Kernel extends HttpKernel protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, \Fideloper\Proxy\TrustProxies::class, + // \App\Http\Middleware\VerifyCsrfToken::class, ]; /** @@ -26,10 +27,6 @@ class Kernel extends HttpKernel protected $middlewareGroups = [ 'web' => [ \App\Http\Middleware\EncryptCookies::class, - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \Illuminate\Session\Middleware\StartSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, - #\App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, ], @@ -37,6 +34,15 @@ class Kernel extends HttpKernel 'throttle:60,1', 'bindings', ], + + 'session' => [ + \App\Http\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \App\Http\Middleware\VerifyCsrfToken::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], ]; /** @@ -54,5 +60,6 @@ class Kernel extends HttpKernel 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'referer.check' => \App\Http\Middleware\RefererCheck::class, + 'humanverification' => \App\Http\Middleware\HumanVerification::class, ]; } diff --git a/app/Http/Middleware/HumanVerification.php b/app/Http/Middleware/HumanVerification.php new file mode 100644 index 0000000000000000000000000000000000000000..7261043c218dcecd73e7f682a1b49ea02b10f79c --- /dev/null +++ b/app/Http/Middleware/HumanVerification.php @@ -0,0 +1,68 @@ +<?php + +namespace App\Http\Middleware; + +use Closure; +use DB; +use Carbon; + +class HumanVerification +{ + /** + * Handle an incoming request. + * + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @return mixed + */ + public function handle($request, Closure $next) + { + $id = md5($request->ip()); + + /** + * If the user sends a Password or a key + * We will not verificate the user. + * If someone that uses a bot finds this out we + * might have to change it at some point. + */ + if($request->filled('password') || $request->filled('key') || $request->filled('appversion') || !env('BOT_PROTECTION', false)){ + return $next($request); + } + + $user = DB::table('humanverification')->where('id', $id)->first(); + $createdAt = now(); + $unusedResultPages = 1; + $locked = false; + # If this user doesn't have an entry we will create one + if($user === null){ + DB::table('humanverification')->insert( + ['id' => $id, 'unusedResultPages' => 1, 'locked' => false, 'updated_at' => now()] + ); + # Insert the URL the user tries to reach + DB::table('usedurls')->insert(['user_id' => $id, 'url' => url()->full()]); + $user = DB::table('humanverification')->where('id', $id)->first(); + }else if($user->locked !== 1){ + $unusedResultPages = intval($user->unusedResultPages); + $unusedResultPages++; + # We have different security gates: + # 50, 75, 85, >=90 => Captcha validated Result Pages + # If the user shows activity on our result page the counter will be deleted + # Maybe I'll add a ban if the user reaches 100 + if($unusedResultPages === 50 || $unusedResultPages === 75 || $unusedResultPages === 85 || $unusedResultPages >= 90){ + $locked = true; + } + DB::table('humanverification')->where('id', $id)->update(['unusedResultPages' => $unusedResultPages, 'locked' => $locked, 'updated_at' => $createdAt]); + # Insert the URL the user tries to reach + DB::table('usedurls')->insert(['user_id' => $id, 'url' => url()->full()]); + } + $request->request->add(['verification_id' => $id, 'verification_count' => $unusedResultPages]); + + + # If the user is locked we will force a Captcha validation + if($user->locked === 1){ + return redirect('meta/verification/' . $id . '/' . urlencode(base64_encode(url()->full()))); + } + + return $next($request); + } +} diff --git a/app/MetaGer.php b/app/MetaGer.php index a9b0e341b0b63a4e86b099d4eb98a7217c7b4b04..4b792318a787e54d11d67e20c8af5ae7abed721b 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Redis; use Jenssegers\Agent\Agent; use LaravelLocalization; use Log; +use Carbon; use Predis\Connection\ConnectionException; class MetaGer @@ -53,12 +54,13 @@ class MetaGer protected $urlsBlacklisted = []; protected $url; protected $languageDetect; + protected $verificationId; + protected $verificationCount; public function __construct() { # Timer starten $this->starttime = microtime(true); - # Versuchen Blacklists einzulesen if (file_exists(config_path() . "/blacklistDomains.txt") && file_exists(config_path() . "/blacklistUrl.txt")) { $tmp = file_get_contents(config_path() . "/blacklistDomains.txt"); @@ -252,6 +254,9 @@ class MetaGer #Adgoal Implementation $this->results = $this->parseAdgoal($this->results); + # Human Verification + $this->results = $this->humanVerification($this->results); + $counter = 0; $firstRank = 0; @@ -447,6 +452,22 @@ class MetaGer return $results; } + public function humanVerification($results){ + # Let's check if we need to implement a redirect for human verification + if($this->verificationCount > 10){ + foreach($results as $result){ + $link = $result->link; + $day = Carbon::now()->day; + $pw = md5($this->verificationId . $day . $link . env("PROXY_PASSWORD")); + $url = route('humanverification', ['mm' => $this->verificationId, 'pw' => $pw, "url" => urlencode(base64_encode($link))]); + $result->link = $url; + } + return $results; + }else{ + return $results; + } + } + public function authorize($key) { $postdata = http_build_query(array( @@ -1022,6 +1043,8 @@ class MetaGer $this->quicktips = true; } + $this->verificationId = $request->input('verification_id', null); + $this->verificationCount = intval($request->input('verification_count', '0')); $this->apiKey = $request->input('key', ''); $this->validated = false; diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 87ffb05a9faf971475fc6ed15eaf763445ed3000..20d6563527e7613e46b36372c6b9ded21ebc9579 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -39,6 +39,8 @@ class RouteServiceProvider extends ServiceProvider $this->mapWebRoutes(); + $this->mapSessionRoutes(); + // } @@ -76,4 +78,21 @@ class RouteServiceProvider extends ServiceProvider require base_path('routes/api.php'); }); } + + /** + * Define the "session" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapSessionRoutes() + { + Route::group([ + 'middleware' => 'session', + 'namespace' => $this->namespace, + ], function ($router) { + require base_path('routes/session.php'); + }); + } } diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json index 0a1b510ac572d1d2b156feb8933f2a9641cc6c98..9a80f170c79b4fa5b4838ff4983dbfc351c56bb6 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "laravel/framework": "5.5.*", "laravelcollective/html": "^5.2.0", "mcamara/laravel-localization": "^1.1", + "mews/captcha": "^2.2", "piwik/piwik-php-tracker": "^1.0", "predis/predis": "^1.1" }, diff --git a/config/app.php b/config/app.php index 30b6eaa039f389cb2e292832caffdadff4ed1e96..a060739ed517cd79a25f73731bdbb975645ee95a 100644 --- a/config/app.php +++ b/config/app.php @@ -182,6 +182,7 @@ return [ Jenssegers\Agent\AgentServiceProvider::class, Fideloper\Proxy\TrustedProxyServiceProvider::class, Collective\Html\HtmlServiceProvider::class, + Mews\Captcha\CaptchaServiceProvider::class, ], /* @@ -233,6 +234,8 @@ return [ 'Agent' => Jenssegers\Agent\Facades\Agent::class, 'Form' => Collective\Html\FormFacade::class, 'HTML' => Collective\Html\HtmlFacade::class, + 'Captcha' => Mews\Captcha\Facades\Captcha::class, + 'Carbon' => Carbon\Carbon::class, ], ]; diff --git a/config/captcha.php b/config/captcha.php new file mode 100644 index 0000000000000000000000000000000000000000..c66516e681014b2d55d8c5d098ddfee64d6fd9c5 --- /dev/null +++ b/config/captcha.php @@ -0,0 +1,45 @@ +<?php + +return [ + + 'characters' => '2346789abcdefghjmnpqrtuxyzABCDEFGHJMNPQRTUXYZ', + + 'default' => [ + 'length' => 5, + 'width' => 220, + 'height' => 66, + 'quality' => 90, + ], + + 'flat' => [ + 'length' => 6, + 'width' => 160, + 'height' => 46, + 'quality' => 90, + 'lines' => 6, + 'bgImage' => false, + 'bgColor' => '#ecf2f4', + 'fontColors'=> ['#2c3e50', '#c0392b', '#16a085', '#c0392b', '#8e44ad', '#303f9f', '#f57c00', '#795548'], + 'contrast' => -5, + ], + + 'mini' => [ + 'length' => 3, + 'width' => 60, + 'height' => 32, + ], + + 'inverse' => [ + 'length' => 5, + 'width' => 120, + 'height' => 36, + 'quality' => 90, + 'sensitive' => true, + 'angle' => 12, + 'sharpen' => 10, + 'blur' => 2, + 'invert' => true, + 'contrast' => -5, + ] + +]; diff --git a/database/migrations/2018_04_26_114745_create_humanverification_table.php b/database/migrations/2018_04_26_114745_create_humanverification_table.php new file mode 100644 index 0000000000000000000000000000000000000000..95c94233c98e95c00a0a6381c478362e80bd9ff4 --- /dev/null +++ b/database/migrations/2018_04_26_114745_create_humanverification_table.php @@ -0,0 +1,33 @@ +<?php + +use Illuminate\Support\Facades\Schema; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class CreateHumanverificationTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('humanverification', function (Blueprint $table) { + $table->string('id')->unique(); + $table->integer('unusedResultPages'); + $table->boolean('locked'); + $table->timestamp('updated_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('humanverification'); + } +} diff --git a/database/migrations/2018_05_03_101301_usedurls.php b/database/migrations/2018_05_03_101301_usedurls.php new file mode 100644 index 0000000000000000000000000000000000000000..341d0b664072a7095838b0adb61e769a084b8c91 --- /dev/null +++ b/database/migrations/2018_05_03_101301_usedurls.php @@ -0,0 +1,34 @@ +<?php + +use Illuminate\Support\Facades\Schema; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class Usedurls extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('usedurls', function (Blueprint $table) { + $table->increments('id')->unique(); + $table->string('user_id'); + $table->text('url'); + $table->timestamp('created_at'); + $table->foreign('user_id')->references('id')->on('humanverification')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('usedurls'); + } +} diff --git a/readme.md b/readme.md index cc73063a9b7d2ed0defffab47153f73ee6b01c34..49f6f125da7d61a4dbb84a04cccc6232013f3868 100644 --- a/readme.md +++ b/readme.md @@ -15,6 +15,7 @@ * php-xml * php-zip * php-redis + * php-gd * sqlite3 * redis-server * Die Perl-Pakete @@ -40,4 +41,4 @@ zögere bitte nicht ein [Ticket zu schreiben](https://gitlab.metager3.de/open-so Der MetaGer-eigene Code, sofern nicht anders anders angegeben, steht unter der [AGPL-Lizenz Version 3](https://www.gnu.org/licenses/agpl-3.0). -Eine Liste der Projekte, auf denen MetaGer basiert, und deren Lizenzen sind in der Datei [LICENSE]( zu finden. +Eine Liste der Projekte, auf denen MetaGer basiert, und deren Lizenzen sind in der Datei [LICENSE](https://gitlab.metager3.de/open-source/MetaGer/blob/development/LICENSE) zu finden. diff --git a/resources/assets/js/focus-creator.js b/resources/assets/js/focus-creator.js index 30e8739c3e6a84246401b54dd569e2c499b2fc3e..f5eea805db4a211889e24bfc0ccccca1d45a7c18 100644 --- a/resources/assets/js/focus-creator.js +++ b/resources/assets/js/focus-creator.js @@ -1,359 +1,65 @@ -$(function () { - setFocusCreatorActionListeners(); - loadInitialCustomFocuses(); - loadInitialSelectedFocus(); - focusChanged(); +$(function() { + setLabelText(); + setKeyListeners(); + setDropdownListeners(); }); /** * Sets all action listeners for this page */ -function setFocusCreatorActionListeners () { - $('.focusCheckbox').click(checkboxCheckListener); - $('#addFocusBtn').click(() => showFocusCreateDialog('')); - $('#editFocusBtn').click(editCurrentFocus); - $('.save-focus-btn').click(saveFocus); - $('.delete-focus-btn').click(deleteFocus); - $('#focus-select').change(focusChanged); - // Save Focus on clicking enter while in the focus name input - $('#focus-name').keyup(function (event) { - if (event.keyCode == 13) { - saveFocus(); - } - }); - $('#create-focus-modal').on('shown.bs.modal', function () { - $('#focus-name').focus(); - }); -} -/** - * Loads all the custom focuses stored in local storage - */ -function loadInitialCustomFocuses () { - for (var key in localStorage) { - if (key.startsWith('focus_')) { - var focus = loadFocusById(key); - addFocus(focus.name); - } - } -} - -function loadInitialSelectedFocus () { - setFocus(getFocusInUrl()); -} - -/** - * Shows the focus create dialog - * If an id is given it will try to load a focus for the given id - */ -function showFocusCreateDialog (id) { - if (id === undefined) { - id = ''; - } - document.getElementById('original-id').value = id; - $('#create-focus-modal').modal('show'); - var storedFocus = loadFocusById(id); - var focus = {}; - // Try to load a focus for the given id - $('#focus-name').val(''); - uncheckAll(); - if (storedFocus !== null) { - try { - focus = JSON.parse(localStorage.getItem(id)); - $('#focus-name').val(focus.name); - for (var key in focus) { - if (key.startsWith('engine_')) { - $('.focusCheckbox[name=' + key + ']').prop('checked', true); - } +function setKeyListeners() { + $(document).keydown(function(event) { + if ($("input#show-create-focus").is(":checked")) { + if (event.keyCode == 27) { + $("input#show-create-focus").prop("checked", false); + } else if (event.keyCode == 13) { + $("#customSearchForm").submit(); } - } catch (ex) { - console.error(ex); - } - } - toggleDeleteButton(); -} - -/** - * Shows the focus create dialog for a given id - */ -function showFocusEditDialog (id) { - showFocusCreateDialog(id); -} - -function getCurrentFocus () { - return $('#foki > div.active').attr('id'); -} - -/** - * Shows an edit dialog for the current selected focus - */ -function editCurrentFocus () { - var currentFocus = getCurrentFocus(); - if (currentFocus !== undefined) { - showFocusEditDialog(currentFocus); - } -} - -/** - * Shows/Hides the delete button if (no) checkboxes are selected - */ -function toggleDeleteButton () { - if (atLeastOneChecked()) { - $('.delete-focus-btn').show(); - } else { - $('.delete-focus-btn').hide(); - } -} - -/** - * Save the current Focus - * Listens for save button - */ -function saveFocus () { - /* Vorprüfungen */ - // Falls keine Suchmaschine ausgewählt wurde - if (!atLeastOneChecked()) { - switch (document.documentElement.lang) { - case 'en': - alert('Please select at least 1 search engine.'); - break; - case 'es': - alert('Por favor, seleccione al menos un motor de búsqueda.'); - break; - default: - alert('Bitte mindestens 1 Suchmaschine auswählen.'); - break; - } - return; - } - // Falls der Name zu kurz ist oder ungültige Zeichen enthält - var name = document.getElementById('focus-name').value; - if (!isValidName(name)) { - switch (document.documentElement.lang) { - case 'en': - alert('No characters other than a-z, A-Z, 0-9, ä, ö, ü, ß, -, _ allowed, at least 1 character'); - break; - case 'es': - alert('Por favor, introduzca un nombre válido'); - break; - default: - alert('Bitte gültigen Namen eingeben:\n* Keine Sonderzeichen\n* Mindestens 1 Buchstabe\n'); - break; - } - return; - } - // Liest die original-id des aktuellen fokus-dialogs (gesetzt wenn man einen Fokus bearbeitet) - var oldId = document.getElementById('original-id').value; - var id = getIdFromName(name); - var overwrite = true; - // Wenn bereits ein Fokus mit dem Namen existiert, man diesen aber nicht editiert sondern gerade einen Neuen erstellt - if (alreadyInUse(name) && oldId !== id) { - // Fragt den Nutzer ob er den Fokus überschreiben möchte - if (!confirm('Name bereits genutzt\nüberschreiben?')) { - // Falls nicht wird das Speichern abgebrochen - return; } - // Ansonsten wird der andere Fokus gelöscht - deleteFocusById(id); - } - /* Fokus speichern */ - var focus = {}; - // Ausgewählte Suchmaschinen lesen und zu Fokus hinzufügen - $('input[type=checkbox]:checked').each(function (el) { - focus[$(this).attr('name')] = $(this).val(); }); - - // Name setzen - focus['name'] = name; - // Alte Version des Fokus löschen (aus localStorage und von der Webseite, falls eine existiert) - if (oldId !== '') { - localStorage.removeItem(oldId); - removeFocusById(oldId); - } - // Neue Version des Fokus hinzufügen (zu localStorage und der Webseite) - localStorage.setItem(id, JSON.stringify(focus)); - addFocus(name); - setFocus(id); - // Fokus-Formular verbergen - $('#create-focus-modal').modal('hide'); } -/** - * Delete current Focus - * Listens for delete button - */ -function deleteFocusById (id) { - localStorage.removeItem(id); - removeFocusById(id); - $('#focus-select').change(); -} - -/** - * Delete current Focus - * Listens for delete button - */ -function deleteFocus () { - var oldId = document.getElementById('original-id').value; - deleteFocusById(oldId); - $('#create-focus-modal').modal('hide'); - $('#focus-select').change(); -} - -/** - * Is the name valid (in terms of characters)? - */ -function isValidName (name) { - // no Characters other then a-z, A-Z, 0-9, ä, ö, ü, ß, -, _ allowed - // at least 1 character - return /^[a-zA-Z0-9äöüß\-_ ]+$/.test(name); -} - -/** - * Is at least one focus selected? - */ -function atLeastOneChecked () { - return $('.focusCheckbox:checked').length > 0; -} - -/** - * Is there already a focus with this name? - */ -function alreadyInUse (name) { - return localStorage.hasOwnProperty(getIdFromName(name)); -} - -/** - * Adds an option to the focus selector - */ -function addFocus (name) { - var id = getIdFromName(name); - var customFocus = $('<div id="' + id + '"><a href="#" target="_self">' + name + '</a><a class="edit-focus" data-id="' + id + '" href="#"><i class="fa fa-wrench"></i></div>'); - $(customFocus).find('.edit-focus').click(function () { - showFocusEditDialog($(this).attr('data-id')); +function setDropdownListeners() { + // Listener for 'Open/Collapse all' label + $("input:checkbox#toggle-dropdowns").change(function() { + if ($(this).is(":checked")) { + // Open all dropdowns + $(".focus-dropdown-toggle").prop("checked", true); + } else { + // Close all dropdowns + $(".focus-dropdown-toggle").prop("checked", false); + } + setLabelText(); }); - $('#foki .search-option-frame').before(customFocus); -} - -/** - * Remove the focuses html-elements - */ -function removeFocus (name) { - removeFocusById(getIdFromName(name)); -} - -/** - * Remove the focuses html-elements - */ -function removeFocusById (id) { - if (id == '') { - return; - } - $('#focus-select option[value="' + id + '"]').remove(); -} - -/** - * Turns a name into an id - * Converts special characters and spaces - */ -function getIdFromName (name) { - name = name.toLowerCase(); - name = name.split(' ').join('_'); - name = name.split('ä').join('ae'); - name = name.split('ö').join('oe'); - name = name.split('ü').join('ue'); - return 'focus_' + name; -} - -/** - * Loads the focus object for the given id from local storage - */ -function loadFocusById (id) { - return JSON.parse(localStorage.getItem(id)); -} - -/** - * Unchecks all focuses from the focus creator dialog - */ -function uncheckAll () { - $('.focusCheckbox').prop('checked', false); -} - -/** - * Sets the selected focus to default - */ -function setFocusToDefault () { - setFocus(DEFAULT_FOCUS); -} - -/** - * Sets the selected focus - * @param {String} focusID The id of the focus, without # - */ -function setFocus (focusID) { - $('#focus-select option[value="' + focusID + '"]').prop('selected', true); - $('#focus-select').change(); -} - -function focusChanged () { - var selectedFocus = getCurrentFocus(); - if (typeof(currentFocus) !== 'undefined') { - if (focusIsEditable(selectedFocus)) { - enableEditFocusBtn(); + // Change 'Open/Collapse' all when single dropdown is changed + $(".focus-dropdown-toggle").change(function() { + var expanded = false; + $(".focus-dropdown-toggle").each(function() { + if ($(this).is(":checked")) { + expanded = true; + } + }); + if (expanded === true) { + $("input:checkbox#toggle-dropdowns").prop("checked", true); } else { - disableEditFocusBtn(); + $("input:checkbox#toggle-dropdowns").prop("checked", false); } - loadFocusForSearch(selectedFocus); - } + setLabelText(); + }); } -function focusIsEditable (focus) { - if (focus.startsWith('focus_')) { - return true; +// +// Adjusts the 'Open/Colapse all' label +function setLabelText() { + if ($("input:checkbox#toggle-dropdowns").is(":checked")) { + $("#toggle-dropdowns-label").html( + t("close-dropdowns") + + ' <i class="fa fa-minus-square" aria-hidden="true"></i>' + ); } else { - return false; - } -} - -function enableEditFocusBtn () { - $('#editFocusBtn').removeClass('disabled').click(editCurrentFocus); -} - -function disableEditFocusBtn () { - $('#editFocusBtn').addClass('disabled').off('click'); -} - -function loadFocusForSearch (focus) { - var focus = loadFocusById(focus); - - var url = '/meta/meta.ger3?eingabe=x&focus='; - - // clearCustomSearch() - for (var key in focus) { - if (key.startsWith('engine_') && focus[key] == 'on') { - addSumaToCustomSearch(key); - } - } -} - -function getFocusInUrl () { - var url = window.location; - var focReg = /focus=(focus_\w+)/.exec(url); - if (focReg && focReg[1]) { - return focReg[1]; + $("#toggle-dropdowns-label").html( + t("open-dropdowns") + + ' <i class="fa fa-plus-square" aria-hidden="true"></i>' + ); } } - -function checkboxCheckListener (event) { - toggleDeleteButton(); - var elem = event.target; - if (elem.name) { - if (elem.checked) { - setCheckedForAllWithName(elem.name, true); - } else { - setCheckedForAllWithName(elem.name, false); - } - } -} - -function setCheckedForAllWithName (name, checked) { - $('.focusCheckbox[name=' + name + ']').prop('checked', checked); -} diff --git a/resources/assets/js/scriptJoinPage.js b/resources/assets/js/scriptJoinPage.js index 80aed71c643d3dd055beb3803fcc3db268766a57..5c1030c0ae18eeb7ceed8e09ce6e018450c11e72 100644 --- a/resources/assets/js/scriptJoinPage.js +++ b/resources/assets/js/scriptJoinPage.js @@ -1,7 +1,7 @@ function checkFormBeforePrinting () { var requiredElements = document.querySelectorAll("[required]"); var passed = true; - for (i = 0; i < requiredElements.length; i++) { + for (var i = 0; i < requiredElements.length; i++) { if(requiredElements[i].value == "") { passed = false; requiredElements[i].style.backgroundColor = "#ff9999"; diff --git a/resources/assets/js/scriptResultPage.js b/resources/assets/js/scriptResultPage.js index dcac046b4f664a1d3734224856fa8c279767ec42..6d44170c749d80dad8bfb912b52cf57f82d69ec8 100644 --- a/resources/assets/js/scriptResultPage.js +++ b/resources/assets/js/scriptResultPage.js @@ -16,7 +16,7 @@ $(document).ready(function () { var search = getMetaTag('q') || ''; var locale = getMetaTag('l') || 'de'; - //loadQuicktips(search, locale, sprueche); // load the quicktips +// loadQuicktips(search, locale, sprueche) // load the quicktips }); /* @@ -65,6 +65,7 @@ function tabs () { getDocumentReadyForUse(fokus); } }); + $('#search-delete-btn').removeClass('hidden'); } function getDocumentReadyForUse (fokus, custom) { @@ -85,11 +86,11 @@ function getDocumentReadyForUse (fokus, custom) { } function addListeners () { - $('#reset').attr('type', 'button').click(resetSearchbar); + $('#search-delete-btn').click(resetSearchbar); } function resetSearchbar () { - $('#eingabeTop').val(''); + $('.search-input input').val('').focus(); } function pluginInfo () { @@ -133,11 +134,27 @@ function clickLog () { } function botProtection () { - if ($('meta[name=pqr]').length > 0) { - var link = atob($('meta[name=pqr]').attr('content')); - var hash = $('meta[name=pq]').attr('content'); - document.location.href = link + '&bot=' + hash; - } + $('.result').find('a').click(function () { + var link = $(this).attr('href'); + var newtab = false; + if ($(this).attr('target') == '_blank') { + newtab = true; + } + $.ajax({ + url: '/img/cat.jpg', + type: 'post', + data: { mm: $('meta[name=mm]').attr('content')}, + timeout: 2000 + }) + .always(function () { + if (!newtab) + document.location.href = link; + }); + if (!newtab) + return false; + else + return true; + }); } function popovers () { @@ -271,7 +288,6 @@ function fokiChanger () { }); })(jQuery); - /** * Loads the content for a given fokus */ diff --git a/resources/assets/js/translations.js b/resources/assets/js/translations.js index d0ca59cbcefc00be097dd56f8e3b9c44905014a6..1d6ce9a98d6929f976c4e91d3f6d555ca5627e09 100644 --- a/resources/assets/js/translations.js +++ b/resources/assets/js/translations.js @@ -21,7 +21,9 @@ var translations = { 'result-saver.deleteAll': '<span class="hidden-xs">Ergebnisse</span> löschen</button>', 'result-saver.save.this': 'ÖFFNEN', 'result-saver.save.newtab': 'IN NEUEM TAB', - 'result-saver.save.anonymous': 'ANONYM ÖFFNEN' + 'result-saver.save.anonymous': 'ANONYM ÖFFNEN', + 'close-dropdowns' : 'Alle zuklappen', + 'open-dropdowns' : 'Alle aufklappen' }, 'en': { @@ -39,7 +41,9 @@ var translations = { 'result-saver.deleteAll': 'delete <span class="hidden-xs">results</span>', 'result-saver.save.this': 'OPEN', 'result-saver.save.newtab': 'IN NEW TAB', - 'result-saver.save.anonymous': 'OPEN ANONYMOUSLY' + 'result-saver.save.anonymous': 'OPEN ANONYMOUSLY', + 'close-dropdowns' : 'Collapse all', + 'open-dropdowns' : 'Expand all' }, 'es': { @@ -64,7 +68,7 @@ var translations = { function t (key, lang) { if (arguments.length == 1) { var lang = $('html').attr('lang'); - return translations[lang][key]; + return t(key, lang); } else if (arguments.length == 2 && translations[lang] && translations[lang][key]) { return translations[lang][key]; } else { diff --git a/resources/assets/less/metager/beitritt.less b/resources/assets/less/metager/beitritt.less index 02892cdbfc96135bee9d36bde81519c0d6543911..f658d4e1b425150d0f5d9436a1425675a068955c 100644 --- a/resources/assets/less/metager/beitritt.less +++ b/resources/assets/less/metager/beitritt.less @@ -1,120 +1,123 @@ /* Style für die Druckversion des Beitrittsformulars */ -#donation-form { - .beitritt-inputs { - display: flex; - flex-wrap: wrap; - >div { - width: 50%; - padding: 10px; - } - @media print { - padding: 0px; - flex-direction: column; - flex-wrap: nowrap; - } - } - label { - font-weight: normal; - } - .signature { - border-top: 1px dashed black; - width: 50%; - margin-top: 50px; +.beitritt-inputs { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + > div { + width: 50%; + padding: 10px; + @media screen and (max-width: 600px) { + width: 100%; } + } +} + +label { + font-weight: normal; +} + +.signature { + border-top: 1px dashed black; + width: 50%; + margin-top: 16px; } @media print { - .card-heavy { - border: none !important; - box-shadow: none !important; + .card-heavy { + border: none !important; + margin: 0px 0px 8px 0px !important; + padding: 0; + -webkit-box-shadow: none !important; + box-shadow: none !important; + webkit-box-shadow: none !important; + } + .beitritt-inputs { + margin: 0px !important; + padding: 0px !important; + margin-bottom: 0px !important; + } + h1 { + margin-top: 0 !important; + padding-top: 0 !important; + } + * { + font-size: 12px !important; + } + header { + display: none !important; + } + footer { + display: none !important; + } + hr { + display: none !important; + } + .help-block { + text-decoration: none; + } + input[type="text"], + input[type="email"] { + font-weight: bold; + margin: 0px !important; + padding: 0px !important; + height: initial !important; + border: 0; + } + /* Passt die Größe der Radio-Buttons an + * Skalierung für Firefox, absolut für die anderen Browser + */ + input[type="radio"] { + -webkit-transform: scale(0.5); + transform: scale(0.5); + width: 20px !important; + height: 20px !important; + margin-top: 0px !important; + padding-top: 0px !important; + } + /* Blendet die Placeholder aus */ + input::-webkit-input-placeholder { + /* WebKit browsers */ + color: transparent !important; + } + input:-moz-placeholder { + /* Mozilla Firefox 4 to 18 */ + color: transparent !important; + } + input::-moz-placeholder { + /* Mozilla Firefox 19+ */ + color: transparent !important; + } + input:-ms-input-placeholder { + /* Internet Explorer 10+ */ + color: transparent !important; + } + .container { + width: auto !important; + margin: 0px; + padding: 0px; + } + .wrapper { + padding: 0 !important; + margin: 0 !important; + } + .sign { + margin-top: 10px; + } + .donation-amount-input { + padding-top: 5px; + } + .pagebreak { + page-break-before: always; + } + #spendenaufruf { + display: none !important; + } + .beitritt-formular-info { + * { + font-size: 7pt !important; } - #donation-form { - * { - font-size: 14px !important; - } - header { - display: none !important; - } - footer { - display: none !important; - } - h1 { - margin-top: 0 !important; - padding-top: 0 !important; - font-size: 18px !important; - } - hr { - display: none !important; - } - label { - text-decoration: underline; - } - .help-block { - text-decoration: none; - } - input[type=text], - input[type=email] { - margin: 0px !important; - padding: 0px !important; - height: initial !important; - border: 0; - } - /* Passt die Größe der Radio-Buttons an - * Skalierung für Firefox, absolut für die anderen Browser - */ - input[type=radio] { - transform: scale(0.5); - width: 20px !important; - height: 20px !important; - margin-top: 0px !important; - padding-top: 0px !important; - } - /* Blendet die Placeholder aus */ - input::-webkit-input-placeholder { - /* WebKit browsers */ - color: transparent !important; - } - input:-moz-placeholder { - /* Mozilla Firefox 4 to 18 */ - color: transparent !important; - } - input::-moz-placeholder { - /* Mozilla Firefox 19+ */ - color: transparent !important; - } - input:-ms-input-placeholder { - /* Internet Explorer 10+ */ - color: transparent !important; - } - .container { - width: auto !important; - margin: 0px; - padding: 0px; - } - .wrapper { - padding-top: 0 !important; - } - * { - font-size: 12px!important; - } - .sign { - margin-top: 10px; - } - .donation-amount-input { - padding-top: 5px; - } - .pagebreak { - page-break-before: always; - } - #spendenaufruf { - display: none !important; - } - .beitritt-formular-info { - margin-top: 50px; - * { - font-size: 7pt !important; - } - } - } -} \ No newline at end of file + } +} diff --git a/resources/assets/less/metager/foki.less b/resources/assets/less/metager/foki.less index f280ae9e9423135e5b43c561b436705f75549345..53d7279892a2a4e5e7245d640d79a607b3be715f 100644 --- a/resources/assets/less/metager/foki.less +++ b/resources/assets/less/metager/foki.less @@ -12,8 +12,8 @@ display: none; position: fixed; -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; + -ms-flex-pack: center; + justify-content: center; min-height: 100%; width: 100%; background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, .7)), to(rgba(0, 0, 0, .7))); @@ -39,6 +39,13 @@ } } } + #toggle-dropdowns-label { + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } .focus-dropdown-toggle { display: none; &:not(:checked) { @@ -49,15 +56,17 @@ } &:checked { &~.focus-dropdown-label::after { - content: "🡡"; + content: " âž– "; } } } .focus-dropdown-label { + cursor: pointer; &::after { font-size: 16px; - content: "🡣"; + content: " âž• "; margin-left: 3px; + vertical-align: middle; } &~.row { -webkit-transition: max-height 0.4s ease; diff --git a/resources/assets/less/metager/searchbar.less b/resources/assets/less/metager/searchbar.less index 16e770ac7fa730018ae9f3bdad1d05f26591b5b5..f422504926f577cb540e82501fba5c59476bc161 100644 --- a/resources/assets/less/metager/searchbar.less +++ b/resources/assets/less/metager/searchbar.less @@ -147,4 +147,18 @@ header:nth-child(1) { width: 100%; max-width: 760px; height: 61px; +} + +.search-input { + position: relative; +} + +#search-delete-btn { + position: absolute; + right: 0; + bottom: 0px; + border: none; + background-color: transparent; + font-size: 25px; + font-weight: normal; } \ No newline at end of file diff --git a/resources/assets/less/metager/sidebar.less b/resources/assets/less/metager/sidebar.less index a51384c347abeb0d5e20a27072c9e2847c06731e..dec6ccb72481b0c1b94abd21dc8feb74561a6752 100644 --- a/resources/assets/less/metager/sidebar.less +++ b/resources/assets/less/metager/sidebar.less @@ -160,7 +160,6 @@ input#sideBarToggle:checked { &:hover { color: @metager-orange; } - .noprint; } @media (max-width: @screen-xs-max) { diff --git a/resources/lang/de/kontakt.php b/resources/lang/de/kontakt.php index 3b38be08a150886008a42c6572311005f5bbed13..c37849087cef39576a71548e846c9d423659ccea 100644 --- a/resources/lang/de/kontakt.php +++ b/resources/lang/de/kontakt.php @@ -17,7 +17,7 @@ Alternativ können Sie uns natürlich auch per <a href="mailto:support@suma-ev.d 'letter.1' => 'Per Brief-Post', 'letter.2' => 'Wir ziehen es vor, auf digitalem Wege kontaktiert zu werden. Wenn Sie jedoch eine postalische Kontaktaufnahme als unbedingt nötig erachten, -erreichen Sie uns unter der folgenden Addresse:', +erreichen Sie uns unter der folgenden Adresse:', 'letter.3' => 'SUMA-EV Röselerstr. 3 30159 Hannover diff --git a/resources/lang/de/result.php b/resources/lang/de/result.php index 833947b5df97e1fba0402cd0bd703ec0f3a8f163..7eec7c55cc387a1c895cb50b84d4bb708f198a06 100644 --- a/resources/lang/de/result.php +++ b/resources/lang/de/result.php @@ -7,6 +7,8 @@ return [ 'options.2' => ':host ausblenden', 'options.3' => '*.:domain ausblenden', 'options.4' => 'Partnershop', - 'options.5' => 'anonym öffnen', + 'options.5' => 'ANONYM ÖFFNEN', + 'options.6' => 'IN NEUEM TAB ÖFFNEN', + 'options.7' => 'ÖFFNEN', 'proxytext' => 'Der Link wird anonymisiert geöffnet. Ihre Daten werden nicht zum Zielserver übertragen. Möglicherweise funktionieren manche Webseiten nicht wie gewohnt.', ]; diff --git a/resources/lang/en/result.php b/resources/lang/en/result.php index 7f9b4ee0d19f9ca2b2e9bce61666c087f9f2a108..923e34995a981288887732a33df9394212630eff 100644 --- a/resources/lang/en/result.php +++ b/resources/lang/en/result.php @@ -1,12 +1,14 @@ <?php return [ - "options.headline" => "Options", - "options.savetab" => "Save result in TAB", - "options.1" => "start a new search on this domain", - "options.2" => "hide :host", - "options.3" => "hide *.:domain", - "options.4" => "partnershop", - "options.5" => "open anonymously", - "proxytext" => "Result link is opened anonymously. Your data will not be transfered to destination servers. Eventually some links will not work as usual." + 'options.headline' => 'Options', + 'options.savetab' => 'Save result in TAB', + 'options.1' => 'start a new search on this domain', + 'options.2' => 'hide :host', + 'options.3' => 'hide *.:domain', + 'options.4' => 'partnershop', + 'options.5' => 'OPEN ANONYMOUSLY', + 'options.6' => 'OPEN IN NEW TAB', + 'options.7' => 'OPEN', + 'proxytext' => 'Result link is opened anonymously. Your data will not be transfered to destination servers. Eventually some links will not work as usual.' ]; \ No newline at end of file diff --git a/resources/lang/es/result.php b/resources/lang/es/result.php index 8e67954d0f7724a0f9b1ace67748ddc6e10694c8..59b01b7125e33a36d87680f899446dbe5eda84b3 100644 --- a/resources/lang/es/result.php +++ b/resources/lang/es/result.php @@ -1,12 +1,14 @@ <?php return [ - "options.headline" => "Opciónes", - "options.savetab" => "Grabar resultado", - "options.1" => "Nueva búsqueda en este dominio", - "options.2" => "ocultar :host", - "options.3" => "ocultar *.:domain", - "options.4" => "Tienda asociada", - "options.5" => "abrir anónimo", - "proxytext" => "Abrirá el link anonimizado." + 'options.headline' => 'Opciónes', + 'options.savetab' => 'Grabar resultado', + 'options.1' => 'Nueva búsqueda en este dominio', + 'options.2' => 'ocultar :host', + 'options.3' => 'ocultar *.:domain', + 'options.4' => 'Tienda asociada', + 'options.5' => 'ABRIR ANÓNIMO', + 'options.6' => 'ABRIR NUEVA PESTAÑA', + 'options.7' => 'ABRIR', + 'proxytext' => 'Abrirá el link anonimizado.' ]; diff --git a/resources/views/captcha.blade.php b/resources/views/captcha.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..b6a26af7949b7171f848115460f3de8fd0a82d4c --- /dev/null +++ b/resources/views/captcha.blade.php @@ -0,0 +1,24 @@ +@extends('layouts.subPages') + +@section('title', $title ) + +@section('content') + <h1>Entschuldigen Sie die Störung</h1> + <p>Wir haben Grund zur Annahme, dass von Ihrem Anschluss verstärkt automatisierte Abfragen abgeschickt wurden. + Deshalb bitten wir Sie, die nachfolgende Captcha Abfrage zu beantworten.</p> + <p>Sollten Sie diese Nachricht häufiger sehen oder handelt es sich dabei um einen Irrtum, schicken Sie uns gerne eine Nachricht über unser <a href="/kontakt">Kontaktformular</a>.</p> + <p>Nennen Sie uns in diesem Fall bitte unbedingt folgende Vorgangsnummer: {{ $id }} + <p>Wir schauen uns den Vorgang dann gerne im Detail an.</p> + <form method="post"> + {{ csrf_field() }} + <input type="hidden" name="url" value="{!! $url !!}"> + <input type="hidden" name="id" value="{{ $id }}"> + <p>{!! captcha_img() !!}</p> + @if(isset($errorMessage)) + <p><font color="red">{{$errorMessage}}</font></p> + @endif + <p><input type="text" name="captcha"></p> + <p><button type="submit" name="check">OK</button></p> + </form> + <p>Hinweis: Zum Zwecke der Autorisierung wird auf dieser Seite ein Session Cookie gesetzt. +@endsection \ No newline at end of file diff --git a/resources/views/layouts/atom10ad.blade.php b/resources/views/layouts/atom10ad.blade.php index 7281cbe5b9e4a76f04bb282a58c3e5331bc4c131..d19f7ebddac8a59288ad3dccce7a3c2a9a1850ce 100644 --- a/resources/views/layouts/atom10ad.blade.php +++ b/resources/views/layouts/atom10ad.blade.php @@ -1,6 +1,6 @@ @if(isset($ad)) <ad:advertisement> - <ad:callOut type="TEXT">{!! trans('ad.von') !!} {!! $ad->gefVon !!}</ad:callOut> + <ad:callOut type="TEXT">{!! trans('ad.werbung') !!} {!! trans('ad.von') !!} {!! $ad->gefVon !!}</ad:callOut> <ad:title type="TEXT">{{ $ad->titel }}</ad:title> <ad:displayUrl type="TEXT">{{ $ad->anzeigeLink }}</ad:displayUrl> <ad:subTitle type="TEXT">{{ $ad->descr }}</ad:subTitle> diff --git a/resources/views/layouts/result.blade.php b/resources/views/layouts/result.blade.php index 02696df74b3c614e1e93485e1d73750839a198a1..0f7635b22c6b43a51e27729587894e7ebe2f2da2 100644 --- a/resources/views/layouts/result.blade.php +++ b/resources/views/layouts/result.blade.php @@ -50,13 +50,13 @@ </div> <div class="result-footer"> <a class="result-open" href="{{ $result->link }}" target="_self" rel="noopener"> - ÖFFNEN + {!! trans('result.options.7') !!} </a> <a class="result-open-newtab" href="{{ $result->link }}" target="_blank" rel="noopener"> - IN NEUEM TAB + {!! trans('result.options.6') !!} </a> <a class="result-open-proxy" onmouseover="$(this).popover('show');" onmouseout="$(this).popover('hide');" data-toggle="popover" data-placement="auto right" data-container="body" data-content="@lang('result.proxytext')" href="{{ $result->proxyLink }}" target="{{ $metager->getNewtab() }}" rel="noopener"> - ANONYM ÖFFNEN + {!! trans('result.options.5') !!} </a> <label class="open-result-options" for="result-toggle-{{$result->number}}" role="button"> MEHR diff --git a/resources/views/layouts/resultPage.blade.php b/resources/views/layouts/resultPage.blade.php index 877ae045d8a5cb9eea48325291408f3592a7b2a0..d9d0aab8678a4d1b1747bcd13e1bbc5378e68210 100644 --- a/resources/views/layouts/resultPage.blade.php +++ b/resources/views/layouts/resultPage.blade.php @@ -8,6 +8,8 @@ <meta name="p" content="{{ getmypid() }}" /> <meta name="q" content="{{ $eingabe }}" /> <meta name="l" content="{{ LaravelLocalization::getCurrentLocale() }}" /> + <meta name="mm" content="{{ Request::input('verification_id') }}" /> + <meta name="mn" content="{{ Request::input('verification_count') }}" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE" /> <meta http-equiv="language" content="{!! trans('staticPages.meta.language') !!}" /> diff --git a/resources/views/modals/create-focus-modal.blade.php b/resources/views/modals/create-focus-modal.blade.php index 52d81837c9bffede2643b4982ae441d8efdf893f..7a355a3727cb62309059720a1cc9d9811f371a40 100644 --- a/resources/views/modals/create-focus-modal.blade.php +++ b/resources/views/modals/create-focus-modal.blade.php @@ -17,6 +17,8 @@ </div> </div> <div class="modal-body"> + <input type="checkbox" class="hidden" id="toggle-dropdowns" checked> + <label id="toggle-dropdowns-label" for="toggle-dropdowns" class="js-only"></label> <form id="customSearchForm" method="GET" action="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/meta/meta.ger3 ") }}" accept-charset="UTF-8"> <input type="hidden" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif"> <input type="hidden" name="encoding" value="utf8"> diff --git a/resources/views/parts/searchbar.blade.php b/resources/views/parts/searchbar.blade.php index f4c369881eb03c1cdce9e91003ad5f88d84f2d4a..182513714a8754ebcaae4d47bf6db946608c30e2 100644 --- a/resources/views/parts/searchbar.blade.php +++ b/resources/views/parts/searchbar.blade.php @@ -6,6 +6,9 @@ <div class="search-input-submit"> <div class="search-input"> <input type="text" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif" required="" @if($class=='startpage-searchbar') autofocus="" @endif autocomplete="{{$autocomplete or 'off'}}" class="form-control" placeholder="{{ trans('index.placeholder') }}"> + <button class="hidden" id="search-delete-btn" type="button"> + × + </button> </div> <div class="search-submit" id="submit-inputgroup"> <button type="submit"> diff --git a/resources/views/plugin.blade.php b/resources/views/plugin.blade.php index 291bd6523266f209d72f2155ec4553d29dc20a47..d5d0ec5f1bbf420328deb71122b31db5a0c6c810 100644 --- a/resources/views/plugin.blade.php +++ b/resources/views/plugin.blade.php @@ -1,16 +1,20 @@ <?xml version="1.0" encoding="UTF-8" ?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"> - <ShortName>MetaGer</ShortName> - <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 }}" method="{{$request}}"> - <Param name="eingabe" value="{searchTerms}" /> - @foreach($params as $key => $value) - <Param name="{{$key}}" value="{{$value}}" /> + <ShortName>MetaGer</ShortName> + <Description>{{ trans('plugin.description') }}</Description> + <Contact>office@suma-ev.de</Contact> + <Image width="16" height="16" type="image/x-icon">{{ url('/favicon.ico') }}</Image> + @if ($request == "POST") + <Url type="text/html" template="{{ $link }}" method="{{$request}}"> + <Param name="eingabe" value="{searchTerms}" /> + @foreach($params as $key => $value) + <Param name="{{$key}}" value="{{$value}}" /> - @endforeach - - </Url> - <InputEncoding>UTF-8</InputEncoding> + @endforeach + + </Url> + @else + <Url type="text/html" template="{{ $link }}?eingabe={searchTerms}@foreach($params as $key => $value)&{{$key}}={{$value}}@endforeach" method="{{$request}}" /> + @endif + <InputEncoding>UTF-8</InputEncoding> </OpenSearchDescription> diff --git a/resources/views/spende/beitritt.blade.php b/resources/views/spende/beitritt.blade.php index 7e560370db4d794643c1fc317d6fd13a8bee1c0a..b52f39cca2dd38931bd8d1d45b0eab760719a799 100644 --- a/resources/views/spende/beitritt.blade.php +++ b/resources/views/spende/beitritt.blade.php @@ -5,91 +5,92 @@ @section('navbarFocus.donate', 'class="dropdown active"') @section('content') - <link type="text/css" rel="stylesheet" href="{{ mix('/css/beitritt.css') }}" /> + <link type="text/css" rel="stylesheet" href="{{ mix('/css/beitritt.css') }}" /> + <script src="{{ mix('js/scriptJoinPage.js') }}"></script> +<form id="donation-form"> <div class="card-heavy"> <h1>{{ trans('beitritt.heading.1') }}</h1> - <form id="donation-form"> - <div class="beitritt-inputs"> - <div> - <label for="name">{{ trans('beitritt.beitritt.1') }}</label> - <input type="text" class="form-control beitritt-input" name="name" placeholder="{{trans('beitritt.placeholder.1')}}" required> - </div> - <div> - <label for="firma">{{ trans('beitritt.beitritt.2') }}</label> - <input type="text" class="form-control beitritt-input" name="firma" placeholder="{{trans('beitritt.placeholder.2')}}"> - </div> - <div> - <label for="funktion">{{ trans('beitritt.beitritt.3') }}</label> - <input type="text" class="form-control beitritt-input" name="funktion" placeholder="{{trans('beitritt.placeholder.3')}}"> - </div> - <div> - <label for="adresse">{{ trans('beitritt.beitritt.4') }}</label> - <input type="text" class="form-control beitritt-input" name="adresse" placeholder="{{trans('beitritt.placeholder.4')}}" required> - </div> - <div> - <label for="email">{{ trans('beitritt.beitritt.5') }}</label> - <input type="email" class="form-control beitritt-input" name="email" placeholder=""> - </div> - <div> - <label for="homepage">{{ trans('beitritt.beitritt.6') }}</label> - <input type="text" class="form-control beitritt-input" name="homepage" placeholder="http://"> - </div> - <div> - <label for="telefon">{{ trans('beitritt.beitritt.7') }}</label> - <input type="text" class="form-control beitritt-input" name="telefon" placeholder="{{trans('beitritt.placeholder.7')}}"> - </div> + <div class="beitritt-inputs"> + <div> + <label for="name">{{ trans('beitritt.beitritt.1') }}</label> + <input type="text" class="form-control beitritt-input" name="name" placeholder="{{trans('beitritt.placeholder.1')}}" required> + </div> + <div> + <label for="firma">{{ trans('beitritt.beitritt.2') }}</label> + <input type="text" class="form-control beitritt-input" name="firma" placeholder="{{trans('beitritt.placeholder.2')}}"> + </div> + <div> + <label for="funktion">{{ trans('beitritt.beitritt.3') }}</label> + <input type="text" class="form-control beitritt-input" name="funktion" placeholder="{{trans('beitritt.placeholder.3')}}"> </div> <div> - <p>{{ trans('beitritt.beitritt.8') }}</p> - <input type="text" class="form-control" name="betrag" required> - <p> {{ trans('beitritt.beitritt.9') }}</p> + <label for="adresse">{{ trans('beitritt.beitritt.4') }}</label> + <input type="text" class="form-control beitritt-input" name="adresse" placeholder="{{trans('beitritt.placeholder.4')}}" required> </div> <div> - <p>{{ trans('beitritt.beitritt.10') }}</p> - <p>{{ trans('beitritt.beitritt.11') }}</p> + <label for="email">{{ trans('beitritt.beitritt.5') }}</label> + <input type="email" class="form-control beitritt-input" name="email" placeholder=""> </div> <div> - <input type="radio" name="veröffentlichung" checked> {{ trans('beitritt.beitritt.12') }} - <input type="radio" name="veröffentlichung"> {{ trans('beitritt.beitritt.13') }} + <label for="homepage">{{ trans('beitritt.beitritt.6') }}</label> + <input type="text" class="form-control beitritt-input" name="homepage" placeholder="http://"> </div> <div> - <div> - <label for="ort">{{ trans('beitritt.beitritt.14') }}</label> - <input type="text" class="form-control beitritt-input" id="ort" placeholder=""> - </div> - <p class="signature">{{ trans('beitritt.unterschrift') }}</p> + <label for="telefon">{{ trans('beitritt.beitritt.7') }}</label> + <input type="text" class="form-control beitritt-input" name="telefon" placeholder="{{trans('beitritt.placeholder.7')}}"> + </div> + </div> + <div> + <p>{{ trans('beitritt.beitritt.8') }}</p> + <input type="text" class="form-control beitritt-input" name="betrag" required> + <p> {{ trans('beitritt.beitritt.9') }}</p> + </div> + <div> + <p>{{ trans('beitritt.beitritt.10') }}</p> + <p>{{ trans('beitritt.beitritt.11') }}</p> + </div> + <div> + <input type="radio" name="veröffentlichung" checked> {{ trans('beitritt.beitritt.12') }} + <input type="radio" name="veröffentlichung"> {{ trans('beitritt.beitritt.13') }} + </div> + <div> + <div> + <label for="ort">{{ trans('beitritt.beitritt.14') }}</label> + <input type="text" class="form-control beitritt-input" id="ort" placeholder=""> </div> + <br> + <p class="signature">{{ trans('beitritt.unterschrift') }}</p> </div> - <div class="card-heavy"> - <div class="newpage"></div> - <h1>{{ trans('beitritt.abbuchung.2') }}</h1> - <p>{{ trans('beitritt.abbuchung.3') }}</p> - <div class="beitritt-inputs"> - <div> - <label for="kontoname">{{ trans('beitritt.abbuchung.4') }}</label> - <input type="text" class="form-control" name="kontoname" placeholder=""> - </div> - <div> - <label for="bankverbindung">{{ trans('beitritt.abbuchung.5') }}</label> - <input type="text" class="form-control" name="bankverbindung" placeholder=""> - </div> - <div> - <label for="iban">{{ trans('beitritt.abbuchung.6') }}</label> - <input type="text" class="form-control" name="iban" maxlength="22" placeholder=""> - </div> - <div> - <label for="bic">{{ trans('beitritt.abbuchung.7') }}</label> - <input type="text" class="form-control" name="bic" placeholder=""> - </div> + </div> + <div class="card-heavy"> + <div class="newpage noprint"></div> + <h1>{{ trans('beitritt.abbuchung.2') }}</h1> + <p>{{ trans('beitritt.abbuchung.3') }}</p> + <div class="beitritt-inputs"> + <div> + <label for="kontoname">{{ trans('beitritt.abbuchung.4') }}</label> + <input type="text" class="form-control beitritt-input" name="kontoname" placeholder=""> + </div> + <div> + <label for="bankverbindung">{{ trans('beitritt.abbuchung.5') }}</label> + <input type="text" class="form-control beitritt-input" name="bankverbindung" placeholder=""> + </div> + <div> + <label for="iban">{{ trans('beitritt.abbuchung.6') }}</label> + <input type="text" class="form-control beitritt-input" name="iban" maxlength="22" placeholder=""> </div> <div> - <div> - <label for="ort2">{{ trans('beitritt.abbuchung.8') }}</label> - <input type="text" class="form-control beitritt-input" id="ort2" placeholder=""> - </div> - <p class="signature">{{ trans('beitritt.unterschrift') }}</p> + <label for="bic">{{ trans('beitritt.abbuchung.7') }}</label> + <input type="text" class="form-control beitritt-input" name="bic" placeholder=""> </div> - </form> + </div> + <div> + <label for="ort2">{{ trans('beitritt.abbuchung.8') }}</label> + <input type="text" class="form-control beitritt-input" id="ort2" placeholder=""> + <br> + <p class="signature">{{ trans('beitritt.unterschrift') }}</p> + </div> + <hr> <div class="beitritt-formular-info"> <p>{{ trans('beitritt.anweisung.1') }}</p> <ul class="dotlist"> @@ -101,6 +102,6 @@ <p>{{ trans('beitritt.anweisung.6') }}</p> </div> </div> +</form> <button type="button" class="noprint js-only btn btn-lg btn-primary" onclick="window.print();">{{ trans('beitritt.anweisung.7') }}</button> - <!-- <script src="{{ mix('js/scriptJoinPage.js') }}"></script> --> @endsection diff --git a/routes/session.php b/routes/session.php new file mode 100644 index 0000000000000000000000000000000000000000..fc776d36b8f302ab40982233e822d371809f5fbe --- /dev/null +++ b/routes/session.php @@ -0,0 +1,7 @@ +<?php +# In this File we collect all routes which require a session or other cookies to be active + + +Route::get('captcha/api/{config?}', '\Mews\Captcha\CaptchaController@getCaptchaApi')->middleware('session'); +Route::get('captcha/{config?}', '\Mews\Captcha\CaptchaController@getCaptcha')->middleware('session'); +Route::match(['get', 'post'], 'meta/verification/{id}/{url}', 'HumanVerification@captcha'); \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 7cf901bc957a72911c664c76387ba78988d2a39d..20035702612027348ab579505a2123ebe66d093e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -10,7 +10,6 @@ | to using a Closure or controller method. Build something great! | */ - Route::group( [ 'prefix' => LaravelLocalization::setLocale(), /*, @@ -140,7 +139,10 @@ Route::group( Route::get('settings', 'StartpageController@loadSettings'); - Route::match(['get', 'post'], 'meta/meta.ger3', 'MetaGerSearch@search'); + 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']); + Route::get('meta/picture', 'Pictureproxy@get'); Route::get('clickstats', 'LogController@clicklog'); Route::get('pluginClose', 'LogController@pluginClose'); diff --git a/storage/app/.gitignore b/storage/app/.gitignore old mode 100644 new mode 100755 diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore old mode 100644 new mode 100755 diff --git a/storage/app/public/MetaGer-release.apk b/storage/app/public/MetaGer-release.apk old mode 100644 new mode 100755 diff --git a/storage/app/public/zitate.txt b/storage/app/public/zitate.txt old mode 100644 new mode 100755 diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore old mode 100644 new mode 100755 diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore old mode 100644 new mode 100755 diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore old mode 100644 new mode 100755 diff --git a/webpack.mix.js b/webpack.mix.js index e3db260c48596fea29ff8997ca70b32acc3677c0..0f157f89bedac90d1939c3e0c0d324df9e6b55a5 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -32,5 +32,6 @@ mix .babel('resources/assets/js/focus-creator.js', 'public/js/focus-creator.js') // utility .babel(['resources/assets/js/utility.js', 'resources/assets/js/translations.js'], 'public/js/utility.js') + .babel('resources/assets/js/scriptJoinPage.js', 'public/js/scriptJoinPage.js') .sourceMaps(false, 'inline-source-map') .version(); \ No newline at end of file