File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,6 @@ public function getProfile($userName)
3030 {
3131 $ user = $ this ->users ->requireByName ($ userName );
3232
33- // Make sure that the user which is updated is the one who is currently logged in.
34- if (Auth::user ()->id !== $ user ->id ) {
35- App::abort (403 );
36- }
37-
3833 $ threads = $ user ->getLatestThreadsPaginated (5 );
3934 $ replies = $ user ->getLatestRepliesPaginated (5 );
4035
@@ -45,13 +40,23 @@ public function getSettings($userName)
4540 {
4641 $ user = $ this ->users ->requireByName ($ userName );
4742
43+ // Make sure that the user which is updated is the one who is currently logged in.
44+ if (Auth::user ()->id !== $ user ->id ) {
45+ App::abort (403 );
46+ }
47+
4848 $ this ->view ('users.settings ' , compact ('user ' ));
4949 }
5050
5151 public function putSettings ($ userName )
5252 {
5353 $ user = $ this ->users ->requireByName ($ userName );
5454
55+ // Make sure that the user which is updated is the one who is currently logged in.
56+ if (Auth::user ()->id !== $ user ->id ) {
57+ App::abort (403 );
58+ }
59+
5560 return $ this ->updater ->update ($ this , $ user , Input::only ('email ' ));
5661 }
5762
Original file line number Diff line number Diff line change 77 <h1 >{{ $user -> name } } </h1 >
88 <p ><a class =" button" target =" _blank" href =" {{ $user -> github_url } }" >Visit GitHub Profile</a ></p >
99
10- @if (Auth:: check () )
10+ @if (Auth:: check () && Auth :: user () -> email === $user -> email )
1111 <p ><a class =" button" href =" {{ route (' user.settings' , $user -> name ) } }" >Edit Account Settings</a ></p >
1212 @endif
1313</div >
You can’t perform that action at this time.
0 commit comments