Fix poll admin password checking
This commit is contained in:
parent
f0e5edee21
commit
e54925060b
|
@ -273,6 +273,10 @@ class PollController extends Controller
|
|||
|
||||
public function edit(Request $request, Poll $poll)
|
||||
{
|
||||
if($poll->admin_password == null || $request->query('password') != $poll->admin_password) {
|
||||
return redirect()->action('PollController@viewResults', ['poll' => $poll]);
|
||||
}
|
||||
|
||||
if($request->has('extra_codes')) {
|
||||
if($poll->duplicate_vote_checking != 'codes') {
|
||||
return redirect()->action('PollController@view', ['poll' => $poll]);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
<section class="grid grid--large">
|
||||
<div class="some-top-margin">
|
||||
<form action="{{ action('PollController@edit', ['poll' => $poll, 'password' => $poll->password]) }}" method="post">
|
||||
<form action="{{ action('PollController@edit', ['poll' => $poll, 'password' => $poll->admin_password]) }}" method="post">
|
||||
@method('PATCH')
|
||||
|
||||
@csrf
|
||||
|
@ -58,7 +58,7 @@
|
|||
|
||||
@if ($poll->duplicate_vote_checking == 'codes')
|
||||
<div class="some-top-margin">
|
||||
<form action="{{ action('PollController@edit', ['poll' => $poll, 'password' => $poll->password]) }}" method="post">
|
||||
<form action="{{ action('PollController@edit', ['poll' => $poll, 'password' => $poll->admin_password]) }}" method="post">
|
||||
@method('PATCH')
|
||||
|
||||
@csrf
|
||||
|
@ -82,7 +82,7 @@
|
|||
<div class="text-browser"><br></div>
|
||||
|
||||
<section>
|
||||
<form action="{{ action('PollController@edit', ['poll' => $poll, 'password' => $poll->password]) }}" method="post">
|
||||
<form action="{{ action('PollController@edit', ['poll' => $poll, 'password' => $poll->admin_password]) }}" method="post">
|
||||
@method('PATCH')
|
||||
|
||||
@csrf
|
||||
|
|
Loading…
Reference in New Issue