diff --git a/app/Http/Controllers/Frontend/UserController.php b/app/Http/Controllers/Frontend/UserController.php index 4c22f87f8..e7029de9e 100644 --- a/app/Http/Controllers/Frontend/UserController.php +++ b/app/Http/Controllers/Frontend/UserController.php @@ -138,7 +138,7 @@ public function profileEdit($id) } if ($id != auth()->user()->id) { - return redirect()->route('frontend.users.profile', $id); + return redirect()->route('frontend.users.profile', encode_id($id)); } $$module_name_singular = $module_model::findOrFail($id); @@ -160,6 +160,7 @@ public function profileEdit($id) */ public function profileUpdate(Request $request, $id) { + $id = decode_id($id); $module_title = $this->module_title; $module_name = $this->module_name; $module_path = $this->module_path; @@ -167,9 +168,8 @@ public function profileUpdate(Request $request, $id) $module_model = $this->module_model; $module_name_singular = Str::singular($module_name); $module_action = 'Profile Update'; - if ($id != auth()->user()->id) { - return redirect()->route('frontend.users.profile', $id); + return redirect()->route('frontend.users.profile', encode_id($id)); } $this->validate($request, [ @@ -210,7 +210,7 @@ public function profileUpdate(Request $request, $id) event(new UserProfileUpdated($user_profile)); - return redirect()->route('frontend.users.profile', $$module_name_singular->id)->with('flash_success', 'Update successful!'); + return redirect()->route('frontend.users.profile', encode_id($$module_name_singular->id))->with('flash_success', 'Update successful!'); } /** @@ -221,6 +221,8 @@ public function profileUpdate(Request $request, $id) */ public function changePassword($id) { + $id = decode_id($id); + $module_title = $this->module_title; $module_name = $this->module_name; $module_path = $this->module_path; @@ -232,7 +234,7 @@ public function changePassword($id) $body_class = 'profile-page'; if ($id != auth()->user()->id) { - return redirect()->route('frontend.users.profile', $id); + return redirect()->route('frontend.users.profile', encode_id($id)); } $id = auth()->user()->id; @@ -290,7 +292,7 @@ public function edit($id) $module_action = 'Edit'; if ($id != auth()->user()->id) { - return redirect()->route('frontend.users.profile', $id); + return redirect()->route('frontend.users.profile', encode_id($id)); } $roles = Role::get(); @@ -318,7 +320,7 @@ public function update(Request $request, $id) $module_name_singular = Str::singular($this->module_name); if ($id != auth()->user()->id) { - return redirect()->route('frontend.users.profile', $id); + return redirect()->route('frontend.users.profile', encode_id($id)); } $$module_name_singular = User::findOrFail($id); @@ -393,6 +395,8 @@ public function userProviderDestroy(Request $request) */ public function emailConfirmationResend($id) { + $id = decode_id($id); + if ($id != auth()->user()->id) { if (auth()->user()->hasAnyRole(['administrator', 'super admin'])) { Log::info(auth()->user()->name.' ('.auth()->user()->id.') - User Requested for Email Verification.'); diff --git a/resources/views/frontend/users/changePassword.blade.php b/resources/views/frontend/users/changePassword.blade.php index 8d2e39dba..b11f941ca 100644 --- a/resources/views/frontend/users/changePassword.blade.php +++ b/resources/views/frontend/users/changePassword.blade.php @@ -13,7 +13,7 @@ @auth @if(auth()->user()->id == $$module_name_singular->id) - Show + Show @endif @endauth @@ -23,7 +23,7 @@

@if ($$module_name_singular->email_verified_at == null)

- Confirm Email + Confirm Email

@endif