diff --git a/app/Console/Commands/SeedFollows.php b/app/Console/Commands/SeedFollows.php index 81f23fabb..d11685648 100644 --- a/app/Console/Commands/SeedFollows.php +++ b/app/Console/Commands/SeedFollows.php @@ -41,10 +41,10 @@ class SeedFollows extends Command { $limit = 10000; - for ($i=0; $i < $limit; $i++) { + for ($i=0; $i < $limit; $i++) { try { - $actor = Profile::orderByRaw('rand()')->firstOrFail(); - $target = Profile::orderByRaw('rand()')->firstOrFail(); + $actor = Profile::inRandomOrder()->firstOrFail(); + $target = Profile::inRandomOrder()->firstOrFail(); $follow = new Follower; $follow->profile_id = $actor->id; diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index b2ea669a0..83f844da6 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -36,4 +36,24 @@ class LoginController extends Controller { $this->middleware('guest')->except('logout'); } + + /** + * Validate the user login request. + * + * @param \Illuminate\Http\Request $request + * @return void + */ + public function validateLogin($request) + { + $rules = [ + $this->username() => 'required|string', + 'password' => 'required|string', + ]; + + if(config('pixelfed.recaptcha')) { + $rules['g-recaptcha-response'] = 'required|recaptcha'; + } + + $this->validate($request, $rules); + } } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index a2c36356f..1b9de0513 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -52,12 +52,19 @@ class RegisterController extends Controller { $this->validateUsername($data['username']); - return Validator::make($data, [ + + $rules = [ 'name' => 'required|string|max:255', 'username' => 'required|alpha_dash|min:2|max:15|unique:users', 'email' => 'required|string|email|max:255|unique:users', 'password' => 'required|string|min:6|confirmed', - ]); + ]; + + if(config('pixelfed.recaptcha')) { + $rules['g-recaptcha-response'] = 'required|recaptcha'; + } + + return Validator::make($data, $rules); } /** diff --git a/app/Http/Controllers/CommentController.php b/app/Http/Controllers/CommentController.php index 790b22142..565ceec5d 100644 --- a/app/Http/Controllers/CommentController.php +++ b/app/Http/Controllers/CommentController.php @@ -26,7 +26,7 @@ class CommentController extends Controller $reply = new Status(); $reply->profile_id = $profile->id; $reply->caption = $comment; - $reply->rendered = $comment; + $reply->rendered = e($comment); $reply->in_reply_to_id = $status->id; $reply->in_reply_to_profile_id = $status->profile_id; $reply->save(); diff --git a/app/Http/Controllers/DiscoverController.php b/app/Http/Controllers/DiscoverController.php index a8459b370..8a64c9379 100644 --- a/app/Http/Controllers/DiscoverController.php +++ b/app/Http/Controllers/DiscoverController.php @@ -16,8 +16,8 @@ class DiscoverController extends Controller public function home() { $following = Follower::whereProfileId(Auth::user()->profile->id)->pluck('following_id'); - $people = Profile::whereNotIn('id', $following)->orderByRaw('rand()')->take(3)->get(); - $posts = Status::whereHas('media')->whereNotIn('profile_id', $following)->orderBy('created_at', 'desc')->take('21')->get(); + $people = Profile::inRandomOrder()->where('id', '!=', Auth::user()->profile->id)->whereNotIn('id', $following)->take(3)->get(); + $posts = Status::whereHas('media')->where('profile_id', '!=', Auth::user()->profile->id)->whereNotIn('profile_id', $following)->orderBy('created_at', 'desc')->take('21')->get(); return view('discover.home', compact('people', 'posts')); } diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index b1a17700b..4beb45418 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -22,7 +22,7 @@ class SettingsController extends Controller { $this->validate($request, [ 'name' => 'required|string|max:30', - 'bio' => 'string|max:125' + 'bio' => 'nullable|string|max:125' ]); $changes = false; diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php index 3ad994eed..0220b6d0f 100644 --- a/app/Http/Controllers/StatusController.php +++ b/app/Http/Controllers/StatusController.php @@ -3,7 +3,7 @@ namespace App\Http\Controllers; use Auth, Cache; -use App\Jobs\StatusPipeline\NewStatusPipeline; +use App\Jobs\StatusPipeline\{NewStatusPipeline, StatusDelete}; use Illuminate\Http\Request; use App\{Media, Profile, Status, User}; use Vinkla\Hashids\Facades\Hashids; @@ -60,4 +60,24 @@ class StatusController extends Controller return redirect($status->url()); } + + public function delete(Request $request) + { + if(!Auth::check()) { + abort(403); + } + + $this->validate($request, [ + 'type' => 'required|string', + 'item' => 'required|integer|min:1' + ]); + + $status = Status::findOrFail($request->input('item')); + + if($status->profile_id === Auth::user()->profile->id || Auth::user()->is_admin == true) { + StatusDelete::dispatch($status); + } + + return redirect(Auth::user()->url()); + } } diff --git a/app/Jobs/StatusPipeline/StatusDelete.php b/app/Jobs/StatusPipeline/StatusDelete.php new file mode 100644 index 000000000..571b41a55 --- /dev/null +++ b/app/Jobs/StatusPipeline/StatusDelete.php @@ -0,0 +1,68 @@ +status = $status; + } + + /** + * Execute the job. + * + * @return void + */ + public function handle() + { + $status = $this->status; + $this->unlinkRemoveMedia($status); + } + + public function unlinkRemoveMedia($status) + { + if($status->media()->count() == 0) { + return; + } + + foreach($status->media as $media) { + $thumbnail = storage_path("app/{$media->thumbnail_path}"); + $photo = storage_path("app/{$media->media_path}"); + + try { + if(is_file($thumbnail)) { + unlink($thumbnail); + } + if(is_file($photo)) { + unlink($photo); + } + $media->delete(); + } catch (Exception $e) { + + } + } + + $status->likes()->delete(); + StatusHashtag::whereStatusId($status->id)->delete(); + $status->delete(); + + return true; + } +} diff --git a/app/Jobs/StatusPipeline/StatusEntityLexer.php b/app/Jobs/StatusPipeline/StatusEntityLexer.php index ebbf4ad44..c1d09ccb7 100644 --- a/app/Jobs/StatusPipeline/StatusEntityLexer.php +++ b/app/Jobs/StatusPipeline/StatusEntityLexer.php @@ -45,7 +45,7 @@ class StatusEntityLexer implements ShouldQueue public function parseHashtags() { $status = $this->status; - $text = $status->caption; + $text = e($status->caption); $tags = HashtagLexer::getHashtags($text); $rendered = $text; if(count($tags) > 0) { diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index adeb8fbe8..60c2aec65 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -6,6 +6,7 @@ use App\User; use Auth, Horizon; use App\Observers\UserObserver; use Illuminate\Support\Facades\Blade; +use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -17,6 +18,8 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { + Schema::defaultStringLength(191); + User::observe(UserObserver::class); Horizon::auth(function ($request) { diff --git a/app/Util/Lexer/RestrictedNames.php b/app/Util/Lexer/RestrictedNames.php index 698b31cd2..8f9680920 100644 --- a/app/Util/Lexer/RestrictedNames.php +++ b/app/Util/Lexer/RestrictedNames.php @@ -55,8 +55,6 @@ class RestrictedNames { "js", "localdomain", "localhost", - "login", - "logout", "mail", "mailer-daemon", "mailerdaemon", @@ -108,8 +106,6 @@ class RestrictedNames { "tutorial", "tutorials", "usenet", - "user", - "users", "uucp", "webmaster", "wpad", @@ -126,8 +122,23 @@ class RestrictedNames { // Laravel Horizon "horizon", - // Reserved route + // Reserved routes + "account", + "api", + "auth", "i", + "discover", + "home", + "login", + "logout", + "p", + "password", + "search", + "settings", + "site", + "timeline", + "user", + "users", ]; public static function get() diff --git a/composer.json b/composer.json index 2290917a5..17f6b01d6 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "99designs/http-signatures-guzzlehttp": "^2.0", "bitverse/identicon": "^1.1", "fideloper/proxy": "^4.0", + "greggilbert/recaptcha": "dev-master", "intervention/image": "^2.4", "kitetail/zttp": "^0.3.0", "laravel/framework": "5.6.*", diff --git a/composer.lock b/composer.lock index 217cadc29..879680005 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "97f3eec3dc712904b69a71f92d0e3a3f", + "content-hash": "7be7e27683f56b7ec28eeef962cf2437", "packages": [ { "name": "99designs/http-signatures", @@ -571,6 +571,58 @@ ], "time": "2018-02-07T20:20:57+00:00" }, + { + "name": "greggilbert/recaptcha", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/greggilbert/recaptcha.git", + "reference": "c2ed383785a4fe20467ce470c97c303e5c5b85de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/greggilbert/recaptcha/zipball/c2ed383785a4fe20467ce470c97c303e5c5b85de", + "reference": "c2ed383785a4fe20467ce470c97c303e5c5b85de", + "shasum": "" + }, + "require": { + "illuminate/support": "~5.1", + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/migrations" + ], + "psr-4": { + "Greggilbert\\Recaptcha\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Gilbert", + "email": "greg@greg-gilbert.com" + } + ], + "description": "reCAPTCHA Validator for Laravel 5", + "homepage": "http://github.com/greggilbert/recaptcha", + "keywords": [ + "captcha", + "laravel", + "laravel5", + "recaptcha" + ], + "time": "2017-08-31T03:39:47+00:00" + }, { "name": "guzzlehttp/guzzle", "version": "6.3.3", @@ -754,16 +806,16 @@ }, { "name": "intervention/image", - "version": "2.4.1", + "version": "2.4.2", "source": { "type": "git", "url": "https://github.com/Intervention/image.git", - "reference": "3603dbcc9a17d307533473246a6c58c31cf17919" + "reference": "e82d274f786e3d4b866a59b173f42e716f0783eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/3603dbcc9a17d307533473246a6c58c31cf17919", - "reference": "3603dbcc9a17d307533473246a6c58c31cf17919", + "url": "https://api.github.com/repos/Intervention/image/zipball/e82d274f786e3d4b866a59b173f42e716f0783eb", + "reference": "e82d274f786e3d4b866a59b173f42e716f0783eb", "shasum": "" }, "require": { @@ -783,7 +835,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" }, "laravel": { "providers": [ @@ -820,7 +872,7 @@ "thumbnail", "watermark" ], - "time": "2017-09-21T16:29:17+00:00" + "time": "2018-05-29T14:19:03+00:00" }, { "name": "jakub-onderka/php-console-color", @@ -2315,16 +2367,16 @@ }, { "name": "symfony/console", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "058f120b8e06ebcd7b211de5ffae07b2db00fbdd" + "reference": "2d5d973bf9933d46802b01010bd25c800c87c242" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/058f120b8e06ebcd7b211de5ffae07b2db00fbdd", - "reference": "058f120b8e06ebcd7b211de5ffae07b2db00fbdd", + "url": "https://api.github.com/repos/symfony/console/zipball/2d5d973bf9933d46802b01010bd25c800c87c242", + "reference": "2d5d973bf9933d46802b01010bd25c800c87c242", "shasum": "" }, "require": { @@ -2352,7 +2404,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2379,20 +2431,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-16T09:05:32+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/css-selector", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "0383a1a4eb1ffcac28719975d3e01bfa14be8ab3" + "reference": "03ac71606ecb0b0ce792faa17d74cc32c2949ef4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/0383a1a4eb1ffcac28719975d3e01bfa14be8ab3", - "reference": "0383a1a4eb1ffcac28719975d3e01bfa14be8ab3", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/03ac71606ecb0b0ce792faa17d74cc32c2949ef4", + "reference": "03ac71606ecb0b0ce792faa17d74cc32c2949ef4", "shasum": "" }, "require": { @@ -2401,7 +2453,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2432,20 +2484,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-05-11T15:58:37+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/debug", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "4e7c98de67cc4171d4c986554e09a511da40f3d8" + "reference": "449f8b00b28ab6e6912c3e6b920406143b27193b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/4e7c98de67cc4171d4c986554e09a511da40f3d8", - "reference": "4e7c98de67cc4171d4c986554e09a511da40f3d8", + "url": "https://api.github.com/repos/symfony/debug/zipball/449f8b00b28ab6e6912c3e6b920406143b27193b", + "reference": "449f8b00b28ab6e6912c3e6b920406143b27193b", "shasum": "" }, "require": { @@ -2461,7 +2513,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2488,20 +2540,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-05-16T09:05:32+00:00" + "time": "2018-05-16T14:33:22+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "63353a71073faf08f62caab4e6889b06a787f07b" + "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/63353a71073faf08f62caab4e6889b06a787f07b", - "reference": "63353a71073faf08f62caab4e6889b06a787f07b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2391ed210a239868e7256eb6921b1bd83f3087b5", + "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5", "shasum": "" }, "require": { @@ -2524,7 +2576,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2551,20 +2603,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:43+00:00" + "time": "2018-04-06T07:35:57+00:00" }, { "name": "symfony/finder", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8c633f5a815903a1fe6e3fc135f207267a8a79af" + "reference": "087e2ee0d74464a4c6baac4e90417db7477dc238" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8c633f5a815903a1fe6e3fc135f207267a8a79af", - "reference": "8c633f5a815903a1fe6e3fc135f207267a8a79af", + "url": "https://api.github.com/repos/symfony/finder/zipball/087e2ee0d74464a4c6baac4e90417db7477dc238", + "reference": "087e2ee0d74464a4c6baac4e90417db7477dc238", "shasum": "" }, "require": { @@ -2573,7 +2625,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2600,20 +2652,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-05-16T09:05:32+00:00" + "time": "2018-05-16T14:33:22+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "277b757a2d3960170d99d372e171a8a18916467a" + "reference": "a916c88390fb861ee21f12a92b107d51bb68af99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/277b757a2d3960170d99d372e171a8a18916467a", - "reference": "277b757a2d3960170d99d372e171a8a18916467a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a916c88390fb861ee21f12a92b107d51bb68af99", + "reference": "a916c88390fb861ee21f12a92b107d51bb68af99", "shasum": "" }, "require": { @@ -2621,12 +2673,13 @@ "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { + "predis/predis": "~1.0", "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2653,34 +2706,34 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-05-25T11:08:56+00:00" + "time": "2018-05-25T14:55:38+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "450a1bda817f2dce25a9e13f0f011336743f2a48" + "reference": "b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/450a1bda817f2dce25a9e13f0f011336743f2a48", - "reference": "450a1bda817f2dce25a9e13f0f011336743f2a48", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90", + "reference": "b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90", "shasum": "" }, "require": { "php": "^7.1.3", "psr/log": "~1.0", "symfony/debug": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/http-foundation": "~3.4.4|~4.0.4", + "symfony/event-dispatcher": "~4.1", + "symfony/http-foundation": "~4.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4.5|<4.0.5,>=4", - "symfony/var-dumper": "<3.4", + "symfony/dependency-injection": "<4.1", + "symfony/var-dumper": "<4.1", "twig/twig": "<1.34|<2.4,>=2" }, "provide": { @@ -2692,7 +2745,7 @@ "symfony/config": "~3.4|~4.0", "symfony/console": "~3.4|~4.0", "symfony/css-selector": "~3.4|~4.0", - "symfony/dependency-injection": "^3.4.5|^4.0.5", + "symfony/dependency-injection": "^4.1", "symfony/dom-crawler": "~3.4|~4.0", "symfony/expression-language": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", @@ -2701,7 +2754,7 @@ "symfony/stopwatch": "~3.4|~4.0", "symfony/templating": "~3.4|~4.0", "symfony/translation": "~3.4|~4.0", - "symfony/var-dumper": "~3.4|~4.0" + "symfony/var-dumper": "~4.1" }, "suggest": { "symfony/browser-kit": "", @@ -2713,7 +2766,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2740,7 +2793,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-05-25T13:32:52+00:00" + "time": "2018-05-30T12:52:34+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2913,16 +2966,16 @@ }, { "name": "symfony/process", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3621fa74d0576a6f89d63bc44fabd376711bd0b0" + "reference": "73445bd33b0d337c060eef9652b94df72b6b3434" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3621fa74d0576a6f89d63bc44fabd376711bd0b0", - "reference": "3621fa74d0576a6f89d63bc44fabd376711bd0b0", + "url": "https://api.github.com/repos/symfony/process/zipball/73445bd33b0d337c060eef9652b94df72b6b3434", + "reference": "73445bd33b0d337c060eef9652b94df72b6b3434", "shasum": "" }, "require": { @@ -2931,7 +2984,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2958,20 +3011,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-16T09:05:32+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/routing", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "e8833b64b139926cbe1610d53722185e55c18e44" + "reference": "180b51c66d10f09e562c9ebc395b39aacb2cf8a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/e8833b64b139926cbe1610d53722185e55c18e44", - "reference": "e8833b64b139926cbe1610d53722185e55c18e44", + "url": "https://api.github.com/repos/symfony/routing/zipball/180b51c66d10f09e562c9ebc395b39aacb2cf8a2", + "reference": "180b51c66d10f09e562c9ebc395b39aacb2cf8a2", "shasum": "" }, "require": { @@ -3003,7 +3056,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3036,20 +3089,20 @@ "uri", "url" ], - "time": "2018-05-16T14:21:07+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/translation", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "e1f5863d0a9e79cfec7f031421ced3fe1d403e66" + "reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/e1f5863d0a9e79cfec7f031421ced3fe1d403e66", - "reference": "e1f5863d0a9e79cfec7f031421ced3fe1d403e66", + "url": "https://api.github.com/repos/symfony/translation/zipball/16328f5b217cebc8dd4adfe4aeeaa8c377581f5a", + "reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a", "shasum": "" }, "require": { @@ -3064,6 +3117,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/config": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", "symfony/intl": "~3.4|~4.0", @@ -3077,7 +3131,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3104,20 +3158,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-05-21T10:09:47+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.0.11", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3c34cf3f4bbac9e003d9325225e9ef1a49180a18" + "reference": "bc88ad53e825ebacc7b190bbd360781fce381c64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3c34cf3f4bbac9e003d9325225e9ef1a49180a18", - "reference": "3c34cf3f4bbac9e003d9325225e9ef1a49180a18", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/bc88ad53e825ebacc7b190bbd360781fce381c64", + "reference": "bc88ad53e825ebacc7b190bbd360781fce381c64", "shasum": "" }, "require": { @@ -3126,20 +3180,26 @@ "symfony/polyfill-php72": "~1.5" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" }, "require-dev": { "ext-iconv": "*", + "symfony/process": "~3.4|~4.0", "twig/twig": "~1.34|~2.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump" + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, + "bin": [ + "Resources/bin/var-dump-server" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3173,7 +3233,7 @@ "debug", "dump" ], - "time": "2018-04-26T16:12:06+00:00" + "time": "2018-04-29T07:56:09+00:00" }, { "name": "tightenco/collect", @@ -3734,25 +3794,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/478465659fd987669df0bd8a9bf22a8710e5f1b6", + "reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -3775,7 +3838,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-05-29T17:25:09+00:00" }, { "name": "nunomaduro/collision", @@ -4158,23 +4221,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "6.0.4", + "version": "6.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "52187754b0eed0b8159f62a6fa30073327e8c2ca" + "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/52187754b0eed0b8159f62a6fa30073327e8c2ca", - "reference": "52187754b0eed0b8159f62a6fa30073327e8c2ca", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", + "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", "php": "^7.1", - "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", @@ -4217,29 +4280,29 @@ "testing", "xunit" ], - "time": "2018-04-29T14:59:09+00:00" + "time": "2018-06-01T07:51:50+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "e20525b0c2945c7c317fff95660698cb3d2a53bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/e20525b0c2945c7c317fff95660698cb3d2a53bc", + "reference": "e20525b0c2945c7c317fff95660698cb3d2a53bc", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -4254,7 +4317,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -4264,7 +4327,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-05-28T12:13:49+00:00" }, { "name": "phpunit/php-text-template", @@ -4407,34 +4470,34 @@ }, { "name": "phpunit/phpunit", - "version": "7.1.5", + "version": "7.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ca64dba53b88aba6af32aebc6b388068db95c435" + "reference": "3cf0836680bf5c365c627e8566d46c9e1f544db9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ca64dba53b88aba6af32aebc6b388068db95c435", - "reference": "ca64dba53b88aba6af32aebc6b388068db95c435", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3cf0836680bf5c365c627e8566d46c9e1f544db9", + "reference": "3cf0836680bf5c365c627e8566d46c9e1f544db9", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", + "myclabs/deep-copy": "^1.7", "phar-io/manifest": "^1.0.1", "phar-io/version": "^1.0", "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.1", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.0", - "phpunit/phpunit-mock-objects": "^6.1.1", "sebastian/comparator": "^3.0", "sebastian/diff": "^3.0", "sebastian/environment": "^3.1", @@ -4444,10 +4507,14 @@ "sebastian/resource-operations": "^1.0", "sebastian/version": "^2.0.1" }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", "phpunit/php-invoker": "^2.0" }, @@ -4457,7 +4524,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.1-dev" + "dev-master": "7.2-dev" } }, "autoload": { @@ -4483,63 +4550,7 @@ "testing", "xunit" ], - "time": "2018-04-29T15:09:19+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "6.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/70c740bde8fd9ea9ea295be1cd875dd7b267e157", - "reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.1", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2018-04-11T04:50:36+00:00" + "time": "2018-06-01T07:54:27+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -5197,7 +5208,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "greggilbert/recaptcha": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/config/app.php b/config/app.php index b16e7f77e..99e219a52 100644 --- a/config/app.php +++ b/config/app.php @@ -150,6 +150,7 @@ return [ /* * Package Service Providers... */ + Greggilbert\Recaptcha\RecaptchaServiceProvider::class, /* * Application Service Providers... @@ -209,6 +210,7 @@ return [ 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, + 'Recaptcha' => Greggilbert\Recaptcha\Facades\Recaptcha::class, ], ]; diff --git a/config/pixelfed.php b/config/pixelfed.php index 69a8f3dfb..9c33a56cf 100644 --- a/config/pixelfed.php +++ b/config/pixelfed.php @@ -71,6 +71,7 @@ return [ | */ 'open_registration' => env('OPEN_REGISTRATION', true), + 'recaptcha' => env('RECAPTCHA_ENABLED', false), 'remote_follow_enabled' => env('REMOTE_FOLLOW', false), diff --git a/config/recaptcha.php b/config/recaptcha.php new file mode 100644 index 000000000..5caa2c413 --- /dev/null +++ b/config/recaptcha.php @@ -0,0 +1,66 @@ + env('RECAPTCHA_PUBLIC_KEY', ''), + 'private_key' => env('RECAPTCHA_PRIVATE_KEY', ''), + + /* + |-------------------------------------------------------------------------- + | Template + |-------------------------------------------------------------------------- + | + | Set a template to use if you don't want to use the standard one. + | + */ + 'template' => '', + + /* + |-------------------------------------------------------------------------- + | Driver + |-------------------------------------------------------------------------- + | + | Determine how to call out to get response; values are 'curl' or 'native'. + | Only applies to v2. + | + */ + 'driver' => 'curl', + + /* + |-------------------------------------------------------------------------- + | Options + |-------------------------------------------------------------------------- + | + | Various options for the driver + | + */ + 'options' => [ + + 'curl_timeout' => 1, + 'curl_verify' => true, + + ], + + /* + |-------------------------------------------------------------------------- + | Version + |-------------------------------------------------------------------------- + | + | Set which version of ReCaptcha to use. + | + */ + + 'version' => 2, + +]; diff --git a/public/css/app.css b/public/css/app.css index d56db8db3..86c947d07 100644 Binary files a/public/css/app.css and b/public/css/app.css differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 0ec3eadf7..eb8b18576 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/sass/custom.scss b/resources/assets/sass/custom.scss index 55f0b464c..e84a5dac5 100644 --- a/resources/assets/sass/custom.scss +++ b/resources/assets/sass/custom.scss @@ -51,15 +51,15 @@ body, button, input, textarea { .card.status-container { } +.card-img-top { + height: auto; +} + .card.status-container .status-photo { display: -webkit-box !important; display: -ms-flexbox !important; display: flex !important; - -webkit-box-align: center !important; - -ms-flex-align: center !important; - align-items: center !important; - padding: 0; - background-color: #fff; + margin: auto !important; } .card.status-container .status-comments { @@ -104,4 +104,4 @@ body, button, input, textarea { .notification-page .list-group-item:first-child { border-top: none; -} \ No newline at end of file +} diff --git a/resources/lang/es/notification.php b/resources/lang/es/notification.php index cd62c2897..96b07e5f4 100644 --- a/resources/lang/es/notification.php +++ b/resources/lang/es/notification.php @@ -2,6 +2,7 @@ return [ - 'likedPhoto' => 'le gustó tu foto.', + 'likedPhoto' => 'le gustó tu foto.', + 'startedFollowingYou' => 'empezó a seguirte.', ]; diff --git a/resources/lang/es/passwords.php b/resources/lang/es/passwords.php index 5abf74146..f2b66f57f 100644 --- a/resources/lang/es/passwords.php +++ b/resources/lang/es/passwords.php @@ -14,9 +14,9 @@ return [ */ 'password' => 'La contraseña debe tener al menos seis caracteres y coincidir con la de confirmación.', - 'reset' => '¡Tu password se ha cambiado!', + 'reset' => '¡Tu contraseña se ha cambiado!', 'sent' => 'Te hemos enviado a tu correo un enlace para cambiar tu contraseña.', - 'token' => 'El token para canbiar la contraseña no es válido.', + 'token' => 'El "token" para canbiar la contraseña no es válido.', 'user' => "No hemos podido encontrar a ningún usuario con esa contraseña.", ]; diff --git a/resources/lang/es/profile.php b/resources/lang/es/profile.php index c62bcf3f6..88105ced9 100644 --- a/resources/lang/es/profile.php +++ b/resources/lang/es/profile.php @@ -1,5 +1,8 @@ 'Este usuario todavía no ha publicado nada.', + 'emptyTimeline' => '¡Este usuario todavía no ha publicado nada!', + 'emptyFollowers' => '¡Este usuario todavía no tiene seguidores!', + 'emptyFollowing' => '¡Este usuario todavía no está siguiendo a nadie!', + 'savedWarning' => 'Solamente tú puedes ver lo que has guardado', ]; diff --git a/resources/lang/es/timeline.php b/resources/lang/es/timeline.php new file mode 100644 index 000000000..877b37062 --- /dev/null +++ b/resources/lang/es/timeline.php @@ -0,0 +1,7 @@ ++ 'Tu línea temporal está vacía.' ++ ++]; diff --git a/resources/lang/gl/README.md b/resources/lang/gl/README.md new file mode 100644 index 000000000..5e2ecfc95 --- /dev/null +++ b/resources/lang/gl/README.md @@ -0,0 +1,14 @@ +# Tradución ao galego (gl) PIXELFED + +## Notas + +_v 1_ + +traducindo a versión beta +_usuaria_ = persoa usuaria +e así todo + + +en _validator.php_ o uso do artigo _The_ é confuso no medio de tanta variable sin coñecer +o contexto, así que unha vez se inclúa a tradución haberá que melloralo. +En moitos casos quiteino cando o contido da variable (semella) actuar como nome. diff --git a/resources/lang/gl/auth.php b/resources/lang/gl/auth.php new file mode 100644 index 000000000..ee784a1cc --- /dev/null +++ b/resources/lang/gl/auth.php @@ -0,0 +1,19 @@ + 'As credenciais non constan nos nosos rexistros.', + 'throttle' => 'Demasiados intentos de conexión. Por favor, inténteo de novo en :seconds seconds.', + +]; diff --git a/resources/lang/gl/notification.php b/resources/lang/gl/notification.php new file mode 100644 index 000000000..f4d1e51fb --- /dev/null +++ b/resources/lang/gl/notification.php @@ -0,0 +1,8 @@ + 'gustoulle a súa foto.', + 'startedFollowingYou' => 'comezou a seguila.', + +]; diff --git a/resources/lang/gl/pagination.php b/resources/lang/gl/pagination.php new file mode 100644 index 000000000..afe74398c --- /dev/null +++ b/resources/lang/gl/pagination.php @@ -0,0 +1,19 @@ + '« Anterior', + 'next' => 'Seguinte »', + +]; diff --git a/resources/lang/gl/passwords.php b/resources/lang/gl/passwords.php new file mode 100644 index 000000000..236daa688 --- /dev/null +++ b/resources/lang/gl/passwords.php @@ -0,0 +1,22 @@ + 'Os contrasinais deben ser ao menos de seis caracteres e concordar na confirmación.', + 'reset' => 'Restableceuse o seu contrasinal!', + 'sent' => 'Acabamos de enviarlle unha ligazón para restablecer o contrasinal!', + 'token' => 'Este testemuño de restablecemento de contrasinal non é válido.', + 'user' => "Non atopamos unha usuaria con ese enderezo de correo.", + +]; diff --git a/resources/lang/gl/profile.php b/resources/lang/gl/profile.php new file mode 100644 index 000000000..321682294 --- /dev/null +++ b/resources/lang/gl/profile.php @@ -0,0 +1,8 @@ + 'Esta usuaria aínda non publicou!', + 'emptyFollowers' => 'Esta usuaria aínda non ten seguidoras!', + 'emptyFollowing' => 'Esta usuaria aínda non segue a ninguén!', + 'savedWarning' => 'Só vostede pode ver o que gardou', +]; diff --git a/resources/lang/gl/timeline.php b/resources/lang/gl/timeline.php new file mode 100644 index 000000000..2024b2029 --- /dev/null +++ b/resources/lang/gl/timeline.php @@ -0,0 +1,7 @@ + 'A súa liña temporal está baldeira.' + +]; diff --git a/resources/lang/gl/validation.php b/resources/lang/gl/validation.php new file mode 100644 index 000000000..caa7d2453 --- /dev/null +++ b/resources/lang/gl/validation.php @@ -0,0 +1,122 @@ + 'O :attribute debe aceptarse.', + 'active_url' => 'O :attribute non é un URL válido.', + 'after' => 'A :attribute debe ser unha data posterior :date.', + 'after_or_equal' => 'A :attribute debe ser unha data posterior ou igual a must be a date after or equal to :date.', + 'alpha' => 'O :attribute só pode conter letras.', + 'alpha_dash' => 'O :attribute podería conter só letras, números e guións.', + 'alpha_num' => 'O :attribute podería conter só letras e números.', + 'array' => 'A :attribute debe ser unha cadea.', + 'before' => 'A :attribute debe ser unha data anterior a :date.', + 'before_or_equal' => 'A :attribute debe ser unha data anterior ou igual a :date.', + 'between' => [ + 'numeric' => ' :attribute debe estar entre :min e :max.', + 'file' => 'O :attribute debe estar entre :min e :max kilobytes.', + 'string' => 'O :attribute debe ter entre :min e :max caracteres.', + 'array' => 'O :attribute debe ter entre :min e :max elementos.', + ], + 'boolean' => 'O campo :attribute debe ser verdadeiro ou falso.', + 'confirmed' => 'O :attribute de confirmación non coincide.', + 'date' => 'A :attribute non é unha data válida.', + 'date_format' => 'O :attribute non segue o formato :format.', + 'different' => ' :attribute e :other deben ser diferentes.', + 'digits' => ' :attribute deben ser :digits díxitos.', + 'digits_between' => ' :attribute debe ter entre :min e :max díxitos.', + 'dimensions' => 'The :attribute ten unhas dimensións de imaxe non válidas.', + 'distinct' => 'O campo :attribute ten un valor duplo.', + 'email' => 'The :attribute debe ser un enderezo de correo válido.', + 'exists' => 'O :attribute escollido non é válido.', + 'file' => ' :attribute debe ser un ficheiro.', + 'filled' => 'O campo :attribute debe ter un valor.', + 'image' => ' :attribute ten que ser unha imaxe.', + 'in' => ' :attribute escollido non é válido.', + 'in_array' => 'O campo :attribute non existe en :other.', + 'integer' => ' :attribute debe ser un enteiro.', + 'ip' => ' :attribute ten que ser un enderezo IP válido.', + 'ipv4' => ' :attribute ten que ser un enderezo IPv4 válido.', + 'ipv6' => ' :attribute ten que ser un enderezo IPv6 válido.', + 'json' => ' :attribute debe ser unha cadea JSON válida.', + 'max' => [ + 'numeric' => ' :attribute non pode ser maior de :max.', + 'file' => ' :attribute non pode ser maior de :max kilobytes.', + 'string' => ' :attribute non pode ser maior de :max caracteres.', + 'array' => 'O :attribute non pode ter máis de :max elementos.', + ], + 'mimes' => ' :attribute debe ser un ficheiro de tipo: :values.', + 'mimetypes' => ' :attribute debe ser un ficheiro de tipo: :values.', + 'min' => [ + 'numeric' => ' :attribute debe ser como mínimo :min.', + 'file' => ' :attribute debe ser como mínimo :min kilobytes.', + 'string' => ' :attribute debe ser como mínimo :min characters.', + 'array' => ' :attribute debe ter ao menos :min elementos.', + ], + 'not_in' => 'O :attribute escollido non é válido.', + 'not_regex' => 'O formato de :attribute non é válido', + 'numeric' => ' :attribute debe ser un número.', + 'present' => 'O campo :attribute debe estar presente.', + 'regex' => 'O formato de :attribute non é válido.', + 'required' => 'O campo :attribute é requerido.', + 'required_if' => 'O campo :attribute é requerido cando :other é :value.', + 'required_unless' => 'O campo :attribute é requerido a non ser que :other esté en :values.', + 'required_with' => 'O campo :attribute é requerido cando :values é presente.', + 'required_with_all' => 'O campo :attribute é requerido cando :values é presente.', + 'required_without' => 'O campo :attribute é requerido cando :values non está presente.', + 'required_without_all' => 'O campo :attribute é requerido cando non está presente :values.', + 'same' => ' :attribute e :other deben coincidir.', + 'size' => [ + 'numeric' => ' :attribute debe ser :size.', + 'file' => ' :attribute debe ser :size kilobytes.', + 'string' => ' :attribute debe ser :size caracteres.', + 'array' => ' :attribute debe conter :size elementos.', + ], + 'string' => ' :attribute debe ser unha cadea.', + 'timezone' => ' :attribute debe ser unha zona válida.', + 'unique' => 'O nome :attribute xa está collido.', + 'uploaded' => ' :attribute fallou ao subir.', + 'url' => 'O formato de :attribute non é válido.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +]; diff --git a/resources/lang/he/profile.php b/resources/lang/he/profile.php index ff1674f34..5c76cbd91 100644 --- a/resources/lang/he/profile.php +++ b/resources/lang/he/profile.php @@ -1,5 +1,8 @@ 'למשתמש זה עדיין אין פוסטים!', + 'emptyTimeline' => 'למשתמש זה עדיין אין פוסטים!', + 'emptyFollowers' => 'למשתמש זה עדיין אין עוקבים!', + 'emptyFollowing' => 'משתמש זה עדיין אינו עוקב אחרי אף אחד!', + 'savedWarning' => 'רק אתם יכולים לראות את מה ששמרתם', ]; diff --git a/resources/lang/he/timeline.php b/resources/lang/he/timeline.php new file mode 100644 index 000000000..2a60fb7b5 --- /dev/null +++ b/resources/lang/he/timeline.php @@ -0,0 +1,7 @@ + 'ציר הזמן שלך ריק.' + +]; diff --git a/resources/lang/ja/auth.php b/resources/lang/ja/auth.php new file mode 100644 index 000000000..c3ad779e5 --- /dev/null +++ b/resources/lang/ja/auth.php @@ -0,0 +1,19 @@ + 'これらの認証情報は正しくありません。', + 'throttle' => 'ログイン試行回数が多すぎます。 :seconds 秒後にもう一度お試しください。', + +]; diff --git a/resources/lang/ja/notification.php b/resources/lang/ja/notification.php new file mode 100644 index 000000000..2195ca8c7 --- /dev/null +++ b/resources/lang/ja/notification.php @@ -0,0 +1,8 @@ + '写真がお気に入りされました。', + 'startedFollowingYou' => 'フォローされました。', + +]; diff --git a/resources/lang/ja/pagination.php b/resources/lang/ja/pagination.php new file mode 100644 index 000000000..c6265c94f --- /dev/null +++ b/resources/lang/ja/pagination.php @@ -0,0 +1,19 @@ + '« 戻る', + 'next' => '次へ »', + +]; diff --git a/resources/lang/ja/passwords.php b/resources/lang/ja/passwords.php new file mode 100644 index 000000000..70cddcd37 --- /dev/null +++ b/resources/lang/ja/passwords.php @@ -0,0 +1,22 @@ + 'パスワードは6文字以上で、確認と一致している必要があります。', + 'reset' => 'パスワードをリセットしました!', + 'sent' => 'パスワードリセットのためのリンクをメールで送信しました!', + 'token' => 'このパスワードリセットトークンは無効です。', + 'user' => "このメールアドレスと一致するユーザーを見つけることが出来ません。", + +]; diff --git a/resources/lang/ja/profile.php b/resources/lang/ja/profile.php new file mode 100644 index 000000000..4d9192259 --- /dev/null +++ b/resources/lang/ja/profile.php @@ -0,0 +1,8 @@ + 'このユーザーはまだ何も投稿していません!', + 'emptyFollowers' => 'このユーザーにはまだフォロワーがいません!', + 'emptyFollowing' => 'このユーザーはまだ誰もフォローしていません!', + 'savedWarning' => 'あなたが保存したものはあなただけが見ることが出来ます。', +]; diff --git a/resources/lang/ja/timeline.php b/resources/lang/ja/timeline.php new file mode 100644 index 000000000..c3fee3c9f --- /dev/null +++ b/resources/lang/ja/timeline.php @@ -0,0 +1,7 @@ + 'あなたのタイムラインには何もありません。' + +]; diff --git a/resources/lang/ja/validation.php b/resources/lang/ja/validation.php new file mode 100644 index 000000000..f0a5a3668 --- /dev/null +++ b/resources/lang/ja/validation.php @@ -0,0 +1,122 @@ + ':attribute を受け入れる必要があります。', + 'active_url' => ':attribute は有効なURLではありません。', + 'after' => ':attribute は :date 以降の日付である必要があります。', + 'after_or_equal' => ':attribute は :date と同じかそれ以降の日付である必要があります。', + 'alpha' => ':attribute には文字を含めることが出来ます。', + 'alpha_dash' => ':attribute には文字、数字、ダッシュを含めることが出来ます。', + 'alpha_num' => ':attribute には文字、または数字を含めることが出来ます。', + 'array' => ':attribute は配列である必要があります。', + 'before' => ':attribute は :date 以前の日付である必要があります。', + 'before_or_equal' => ':attribute は :date と同じかそれ以前の日付である必要があります。', + 'between' => [ + 'numeric' => ':attribute は :min から :max の間である必要があります。', + 'file' => ':attribute は :min から :max キロバイトの間である必要があります。', + 'string' => ':attribute は :min から :max 文字の間である必要があります。', + 'array' => ':attribute は :min アイテムから :max アイテムの間である必要があります。', + ], + 'boolean' => ':attribute フィールドは true か false である必要があります。', + 'confirmed' => ':attribute の確認が一致しません。', + 'date' => ':attribute は有効な日付ではありません。', + 'date_format' => ':attribute は :format と一致しません。', + 'different' => ':attribute と :other は異なる必要があります。', + 'digits' => ':attribute は :digits である必要があります。', + 'digits_between' => ':attribute は :min から :max 間の数字である必要があります。', + 'dimensions' => ':attribute は無効な画像サイズです。', + 'distinct' => ':attribute フィールドに重複した値があります。', + 'email' => ':attribute は有効なメールアドレスである必要があります。', + 'exists' => '選択された :attribute は無効です。', + 'file' => ':attribute はファイルである必要があります。', + 'filled' => ':attribute フィールドには値が必要です。', + 'image' => ':attribute は画像である必要があります。', + 'in' => '選択された :attribute は無効です。', + 'in_array' => ':attribute フィールドは :other には存在しません。', + 'integer' => ':attribute は整数である必要があります。', + 'ip' => ':attribute は有効なIPアドレスである必要があります。', + 'ipv4' => ':attribute は有効なIPv4アドレスである必要があります。', + 'ipv6' => ':attribute は有効なIPv6アドレスである必要があります。', + 'json' => ':attribute は有効なJSON文字列である必要があります。', + 'max' => [ + 'numeric' => ':attribute は :max 以下である必要があります。', + 'file' => ':attribute は :max キロバイト以下である必要があります。', + 'string' => ':attribute の文字数は :max 以下である必要があります。', + 'array' => ':attribute は :max 以上のアイテム数を持つことは出来ません。', + ], + 'mimes' => ':attribute は :values タイプのファイルである必要があります。', + 'mimetypes' => ':attribute は :values タイプのファイルである必要があります。', + 'min' => [ + 'numeric' => ':attribute は最低でも :min 以上である必要があります。', + 'file' => ':attribute は最低でも :min キロバイト以上である必要があります。', + 'string' => ':attribute の文字数は最低でも :min 以上である必要があります。', + 'array' => ':attribute は最低でも :min アイテム以上である必要があります。', + ], + 'not_in' => '選択された :attribute は無効です。', + 'not_regex' => ':attribute は無効なフォーマットです。', + 'numeric' => ':attribute は数字である必要があります。', + 'present' => ':attribute フィールドは存在する必要があります。', + 'regex' => ':attribute は無効なフォーマットです。', + 'required' => ':attribute フィールドは必要です。', + 'required_if' => ':other が :value の場合、 :attribute は必要です。', + 'required_unless' => ':other が :values にない場合、 :attribute フィールドは必要です。', + 'required_with' => ':values が存在する場合、 :attribute は必要です。', + 'required_with_all' => ':values が存在する場合、 :attribute は必要です。', + 'required_without' => ':values が存在しない場合、 :attribute は必要です。', + 'required_without_all' => ':values が一つも存在しない場合、 :attribute は必要です。', + 'same' => ':attribute と :other は一致する必要があります。', + 'size' => [ + 'numeric' => ':attribute は :size である必要があります。', + 'file' => ':attribute は :size キロバイトである必要があります。', + 'string' => ':attribute の文字数は :size である必要があります。', + 'array' => ':attribute には :size のアイテムが含まれている必要があります。', + ], + 'string' => ':attribute は文字列である必要があります。', + 'timezone' => ':attribute は有効なゾーンである必要があります。', + 'unique' => ':attribute は既に使用されています。', + 'uploaded' => ':attribute のアップロードに失敗しました。', + 'url' => ':attribute は無効なフォーマットです。', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +]; diff --git a/resources/lang/oc/notification.php b/resources/lang/oc/notification.php new file mode 100644 index 000000000..38676b253 --- /dev/null +++ b/resources/lang/oc/notification.php @@ -0,0 +1,8 @@ + 'a aimat vòstra fòto.', + 'startedFollowingYou' => 'a començat de vos seguir.', + +]; diff --git a/resources/lang/oc/profile.php b/resources/lang/oc/profile.php new file mode 100644 index 000000000..ee70a7b00 --- /dev/null +++ b/resources/lang/oc/profile.php @@ -0,0 +1,5 @@ + 'Aqueste utilizaire a pas encara de publicacion !', +]; diff --git a/resources/lang/pl/notification.php b/resources/lang/pl/notification.php new file mode 100644 index 000000000..d9d2e412f --- /dev/null +++ b/resources/lang/pl/notification.php @@ -0,0 +1,8 @@ + 'polubił Twoje zdjęcie.', + 'startedFollowingYou' => 'zaczął Cię obserwować.', + +]; diff --git a/resources/lang/pl/profile.php b/resources/lang/pl/profile.php new file mode 100644 index 000000000..cdd0d56ae --- /dev/null +++ b/resources/lang/pl/profile.php @@ -0,0 +1,8 @@ + 'Ten użytkownik nie opublikował jeszcze niczego!', + 'emptyFollowers' => 'Nikt nie obserwuje tego użytkownika!', + 'emptyFollowing' => 'Ten użytkownik nie obserwuje nikogo!', + 'savedWarning' => 'Tylko Ty widzisz to, co zapisałeś', +]; diff --git a/resources/lang/pl/timeline.php b/resources/lang/pl/timeline.php new file mode 100644 index 000000000..2d4897cf0 --- /dev/null +++ b/resources/lang/pl/timeline.php @@ -0,0 +1,7 @@ + 'Twoja oś czasu jest pusta.' + +]; diff --git a/resources/lang/sv/auth.php b/resources/lang/sv/auth.php index 073fc9141..058317d63 100644 --- a/resources/lang/sv/auth.php +++ b/resources/lang/sv/auth.php @@ -13,7 +13,7 @@ return [ | */ - 'failed' => 'Dessa autentiseringsuppgifter matchar inte de i vårat register.', + 'failed' => 'Dessa autentiseringsuppgifter matchar inte de i vårt register.', 'throttle' => 'För många inloggningsförsök. Var god försök igen om :seconds sekunder.', ]; diff --git a/resources/lang/sv/notification.php b/resources/lang/sv/notification.php new file mode 100644 index 000000000..bbd658bce --- /dev/null +++ b/resources/lang/sv/notification.php @@ -0,0 +1,8 @@ + 'gillade ditt foto.', + 'startedFollowingYou' => 'började följa dig.', + +]; diff --git a/resources/lang/sv/profile.php b/resources/lang/sv/profile.php new file mode 100644 index 000000000..c7dda1d4d --- /dev/null +++ b/resources/lang/sv/profile.php @@ -0,0 +1,8 @@ + 'Den här användaren har inga inlägg än!', + 'emptyFollowers' => 'Den här användaren har inga följare än!', + 'emptyFollowing' => 'Den här användaren följer inte någon än!', + 'savedWarning' => 'Du är den enda som kan se vad du har sparat', +]; diff --git a/resources/lang/sv/timeline.php b/resources/lang/sv/timeline.php new file mode 100644 index 000000000..9c1c8bae8 --- /dev/null +++ b/resources/lang/sv/timeline.php @@ -0,0 +1,7 @@ + 'Din tidslinje är tom.' + +]; diff --git a/resources/views/account/activity.blade.php b/resources/views/account/activity.blade.php index 26165be84..241d46f8a 100644 --- a/resources/views/account/activity.blade.php +++ b/resources/views/account/activity.blade.php @@ -28,6 +28,7 @@ {!! $notification->rendered !!} {{$notification->created_at->diffForHumans(null, true, true, true)}} + @if($notification->actor->followedBy(Auth::user()->profile) == false)
@csrf @@ -35,6 +36,7 @@
+ @endif @break @endswitch @@ -42,4 +44,4 @@ -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index c09b128f2..66d0cfa53 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -47,6 +47,12 @@ + @if(config('pixelfed.recaptcha')) +
+ {!! Recaptcha::render() !!} +
+ @endif +
+ @if(config('pixelfed.recaptcha')) +
+ {!! Recaptcha::render() !!} +
+ @endif +
+ + + @else + + + + @endif + @endif @endforeach @@ -75,4 +94,4 @@
-@endsection \ No newline at end of file +@endsection diff --git a/resources/views/profile/following.blade.php b/resources/views/profile/following.blade.php index 6e88262b5..56a372963 100644 --- a/resources/views/profile/following.blade.php +++ b/resources/views/profile/following.blade.php @@ -56,6 +56,25 @@ {{$user->name}} + @if(Auth::check() && Auth::id() != $user->user_id) + @if ($user->followedBy(Auth::user()->profile) == true) + +
+ @csrf + + +
+
+ @else + +
+ @csrf + + +
+
+ @endif + @endif @endforeach @@ -75,4 +94,4 @@ -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/status/show.blade.php b/resources/views/status/show.blade.php index 667eabc05..7c882def9 100644 --- a/resources/views/status/show.blade.php +++ b/resources/views/status/show.blade.php @@ -44,9 +44,23 @@ - + + @if(Auth::check()) + @if(Auth::user()->profile->id === $status->profile->id || Auth::user()->is_admin == true) +
+ @csrf + + + +
+ @endif + @endif - +
+ @csrf + + +
diff --git a/resources/views/status/template.blade.php b/resources/views/status/template.blade.php index b0019e989..271d98592 100644 --- a/resources/views/status/template.blade.php +++ b/resources/views/status/template.blade.php @@ -13,6 +13,17 @@ Go to post Report Inappropriate Embed + @if(Auth::check()) + @if(Auth::user()->profile->id === $item->profile->id || Auth::user()->is_admin == true) +
+ @csrf + + + +
+ @endif + @endif +
@@ -55,8 +66,17 @@
@if(isset($showSingleComment) && $showSingleComment === true)

- {{$status->profile->username}} - {!!$status->rendered!!}{{$status->created_at->diffForHumans(null, true, true, true)}} + + + {{$status->profile->username}} + + + {!!$status->rendered!!} + + + {{$status->created_at->diffForHumans(null, true, true, true)}} + +

@else @foreach($item->comments->reverse()->take(3) as $comment) diff --git a/resources/views/timeline/personal.blade.php b/resources/views/timeline/personal.blade.php index e7a112d2b..f1e5a48f8 100644 --- a/resources/views/timeline/personal.blade.php +++ b/resources/views/timeline/personal.blade.php @@ -34,7 +34,7 @@ @csrf
- +
diff --git a/resources/views/timeline/public.blade.php b/resources/views/timeline/public.blade.php index 0415d3cdb..e3a169411 100644 --- a/resources/views/timeline/public.blade.php +++ b/resources/views/timeline/public.blade.php @@ -34,7 +34,7 @@ @csrf
- +
diff --git a/routes/web.php b/routes/web.php index 7b9e1f8f5..3cc8d559c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -56,6 +56,7 @@ Route::domain(config('pixelfed.domain.app'))->group(function() { Route::get('remote-follow', 'FederationController@remoteFollow')->name('remotefollow'); Route::post('remote-follow', 'FederationController@remoteFollowStore'); Route::post('comment', 'CommentController@store'); + Route::post('delete', 'StatusController@delete'); Route::post('like', 'LikeController@store'); Route::post('follow', 'FollowerController@store'); Route::post('bookmark', 'BookmarkController@store');