diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index b3351a3..ab51919 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -11,6 +11,8 @@ use Illuminate\Support\Facades\Response; use JeroenDesloovere\VCard\VCard; use Illuminate\Validation\Rule; use Illuminate\Support\Facades\Validator; +use Illuminate\Support\Facades\Mail; +use App\Mail\ReportSubmissionMail; use Auth; use DB; @@ -1160,6 +1162,20 @@ class UserController extends Controller } + // Hanle reports + function report(Request $request) + { + $formData = $request->all(); + + try { + Mail::to(env('ADMIN_EMAIL'))->send(new ReportSubmissionMail($formData)); + + return redirect('report')->with('success', __('messages.report_success')); + } catch (\Exception $e) { + return redirect()->back()->with('error', __('messages.report_error')); + } + } + //Edit/save page icons public function editIcons(request $request) { diff --git a/app/Mail/ReportSubmissionMail.php b/app/Mail/ReportSubmissionMail.php new file mode 100644 index 0000000..d2c67e3 --- /dev/null +++ b/app/Mail/ReportSubmissionMail.php @@ -0,0 +1,28 @@ +formData = $formData; + } + + public function build() + { + return $this->view('layouts.send-report') + ->subject(__('messages.report_mail_admin_subject')); + } +} \ No newline at end of file diff --git a/resources/lang/en/messages.php b/resources/lang/en/messages.php index 1b40b89..3da9fd8 100644 --- a/resources/lang/en/messages.php +++ b/resources/lang/en/messages.php @@ -1039,6 +1039,53 @@ return [ 'footer.Contact' => 'Contact', + /* + |-------------------------------------------------------------------------- + | Report Page + |-------------------------------------------------------------------------- + | + */ + + 'report_violation' => 'Report a Violation', + 'url_label' => 'URL of the site you are reporting', + 'report_type_label' => 'Type of report', + 'hate_speech' => 'Hate Speech or Harassment', + 'violence_threats' => 'Violence or Threats', + 'illegal_activities' => 'Illegal Activities', + 'copyright_infringement' => 'Copyright Infringement', + 'misinformation_fake_news' => 'Misinformation or Fake News', + 'identity_theft' => 'Identity Theft', + 'drug_related_content' => 'Drug-related Content', + 'weapons_harmful_objects' => 'Weapons or Harmful Objects', + 'child_exploitation' => 'Child Exploitation', + 'fraud_scams' => 'Fraud or Scams', + 'privacy_violation' => 'Privacy Violation', + 'impersonation' => 'Impersonation', + 'other_specify' => 'Other (Specify)', + 'additional_comments_label' => 'Additional comments', + 'submit_button' => 'Submit', + + + 'report_mail_admin_subject' => 'Profile Report', + 'report_mail_admin_report' => 'A Profile has been reported', + + 'report_mail_reported_profile' => 'Reported Profile', + 'report_mail_reported_url' => 'Reported URL', + 'report_mail_type' => 'Type', + 'report_mail_message' => 'Message', + + 'report_mail_report_submitted_by' => 'Report submitted by', + 'report_mail_reported_by' => 'Reported by', + 'report_mail_profile' => 'Profile', + + 'report_mail_button_profile' => 'View on Users Page', + 'report_mail_button_delete' => 'Delete Reported User', + + + 'report_error' => 'Profile could not be reported', + 'report_success' => 'Profile has been reported successfully', + + #=============================================================================# # Laravel internal translations # #=============================================================================# diff --git a/resources/views/layouts/send-report.blade.php b/resources/views/layouts/send-report.blade.php new file mode 100644 index 0000000..a8428e0 --- /dev/null +++ b/resources/views/layouts/send-report.blade.php @@ -0,0 +1,76 @@ + + + + + + + + + +
+

{{ __('messages.report_mail_admin_report') }}

+ +
+

{{ __('messages.report_mail_reported_profile') }}

+ {{ __('messages.report_mail_reported_url') }}: {{ $formData['url'] }}
+ {{ __('messages.report_mail_type') }}: {{ $formData['report-type'] }}
+ {{ __('messages.report_mail_message') }}: {{ $formData['message'] }} +
+ + @if(auth()->check()) +
+

{{ __('messages.report_mail_report_submitted_by') }}

+ {{ __('messages.report_mail_reported_by') }}: {{ auth()->user()->email }}
+ {{ __('messages.report_mail_profile') }}: {{ url('u') . "/" . auth()->user()->id }} +
+ @endif + +
+ {{ __('messages.report_mail_button_profile') }} + {{ __('messages.report_mail_button_delete') }} +
+
+ + diff --git a/resources/views/report.blade.php b/resources/views/report.blade.php new file mode 100644 index 0000000..90f0e19 --- /dev/null +++ b/resources/views/report.blade.php @@ -0,0 +1,180 @@ + + + + +@include('layouts.lang') + + + @php $GLOBALS['themeName'] = config('advanced-config.home_theme'); @endphp + + @if(env('CUSTOM_META_TAGS') == 'true' and config('advanced-config.title') != '') + {{ config('advanced-config.title') }} + @else + {{ config('app.name') }} + @endif + + + @if(file_exists(base_path("assets/linkstack/images/").findFile('favicon'))) + + @else + + @endif + + + + + + + + + + @include('layouts.fonts') + + + + + + + + + + + + @if(file_exists(base_path("assets/dashboard-themes/dashboard.css"))) + + @else + + @endif + + + + + + + +@php + +if ($_SERVER['QUERY_STRING'] != '') { + + try { + + $id = $_SERVER['QUERY_STRING']; + $user = \App\Models\User::where('id', $id)->first(); + $name = $user->littlelink_name; + if ($name != null)$url = url('') . '/@' . $name; + + } catch (\Exception $e) {} + +} + +@endphp + + +
+
+
+
+
+

{{ __('messages.report_violation') }}

+ + @if(session('success')) + + @endif + + @if(session('error')) + + @endif + +
+ @csrf + + +
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 66d267d..9c1198f 100755 --- a/routes/web.php +++ b/routes/web.php @@ -96,6 +96,9 @@ Route::get('/theme/@{littlelink}', [UserController::class, 'theme'])->name('them Route::get('/vcard/{id?}', [UserController::class, 'vcard'])->name('vcard'); Route::get('/u/{id?}', [UserController::class, 'userRedirect'])->name('userRedirect'); +Route::get('/report', function () {return view('report');}); +Route::post('/report', [UserController::class, 'report'])->name('report'); + Route::get('/demo-page', [App\Http\Controllers\HomeController::class, 'demo'])->name('demo'); }