Commit a38568f2 authored by Shahzod's avatar Shahzod

Fucking Caotcha...

parent fde644ec
...@@ -3,12 +3,10 @@ ...@@ -3,12 +3,10 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="45142ad9-1f6f-4356-8738-3011f539d65e" name="Default Changelist" comment=""> <list default="true" id="45142ad9-1f6f-4356-8738-3011f539d65e" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Auth/LoginController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Auth/LoginController.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/Http/Controllers/FeedbackController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/FeedbackController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/HomeController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/HomeController.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/Http/Controllers/HomeController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/HomeController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/composer.lock" beforeDir="false" afterPath="$PROJECT_DIR$/composer.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/captcha.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/captcha.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/config/captcha.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/captcha.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/main.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/main.blade.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/resources/views/contacts.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/contacts.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/pages/terms.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/pages/terms.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/routes/web.php" beforeDir="false" afterPath="$PROJECT_DIR$/routes/web.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/routes/web.php" beforeDir="false" afterPath="$PROJECT_DIR$/routes/web.php" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
...@@ -39,6 +37,7 @@ ...@@ -39,6 +37,7 @@
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
<option name="UPDATE_TYPE" value="MERGE" />
</component> </component>
<component name="PhpWorkspaceProjectConfiguration"> <component name="PhpWorkspaceProjectConfiguration">
<include_path> <include_path>
...@@ -239,7 +238,7 @@ ...@@ -239,7 +238,7 @@
<workItem from="1571336316933" duration="11634000" /> <workItem from="1571336316933" duration="11634000" />
<workItem from="1571458855290" duration="49658000" /> <workItem from="1571458855290" duration="49658000" />
<workItem from="1572018556391" duration="40349000" /> <workItem from="1572018556391" duration="40349000" />
<workItem from="1573827723198" duration="5980000" /> <workItem from="1573827723198" duration="9495000" />
</task> </task>
<task id="LOCAL-00001" summary="first commit (10/07/2019//11/;58)"> <task id="LOCAL-00001" summary="first commit (10/07/2019//11/;58)">
<created>1570475345391</created> <created>1570475345391</created>
...@@ -472,7 +471,21 @@ ...@@ -472,7 +471,21 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1572210547463</updated> <updated>1572210547463</updated>
</task> </task>
<option name="localTasksCounter" value="34" /> <task id="LOCAL-00034" summary="CaptchaPer">
<created>1573833813364</created>
<option name="number" value="00034" />
<option name="presentableId" value="LOCAL-00034" />
<option name="project" value="LOCAL" />
<updated>1573833813364</updated>
</task>
<task id="LOCAL-00035" summary="CaptchaPer">
<created>1573835763654</created>
<option name="number" value="00035" />
<option name="presentableId" value="LOCAL-00035" />
<option name="project" value="LOCAL" />
<updated>1573835763654</updated>
</task>
<option name="localTasksCounter" value="36" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
...@@ -522,7 +535,8 @@ ...@@ -522,7 +535,8 @@
<MESSAGE value="fix bugs" /> <MESSAGE value="fix bugs" />
<MESSAGE value="video" /> <MESSAGE value="video" />
<MESSAGE value="Release 28.10.2019" /> <MESSAGE value="Release 28.10.2019" />
<option name="LAST_COMMIT_MESSAGE" value="Release 28.10.2019" /> <MESSAGE value="CaptchaPer" />
<option name="LAST_COMMIT_MESSAGE" value="CaptchaPer" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
......
...@@ -21,6 +21,9 @@ class FeedbackController extends Controller ...@@ -21,6 +21,9 @@ class FeedbackController extends Controller
*/ */
public function addGuest(Request $request) public function addGuest(Request $request)
{ {
$request->validate([
'captcha' => 'required|captcha',
], ['captcha.captcha' => 'Неверный защитный код...']);
try { try {
$feedback = new Feedback(); $feedback = new Feedback();
$feedback->name = $request->input('name').' '.$request->input('last-name'); $feedback->name = $request->input('name').' '.$request->input('last-name');
...@@ -36,4 +39,8 @@ class FeedbackController extends Controller ...@@ -36,4 +39,8 @@ class FeedbackController extends Controller
return redirect()->back()->with('flash_success', 'Сообщение отправлено успешно.'); return redirect()->back()->with('flash_success', 'Сообщение отправлено успешно.');
} }
public function addGuestCaptcha()
{
return captcha_img();
}
} }
...@@ -5,7 +5,9 @@ namespace App\Http\Controllers; ...@@ -5,7 +5,9 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use Illuminate\Validation\Validator; //use Illuminate\Validation\Validator;
use Validator;
//use Illuminate\Support\Facades\Validator;
class HomeController extends Controller class HomeController extends Controller
{ {
...@@ -48,11 +50,12 @@ class HomeController extends Controller ...@@ -48,11 +50,12 @@ class HomeController extends Controller
public function sendMail(Request $request) public function sendMail(Request $request)
{ {
// $request->validate([ //dd($request->all());
// 'captcha' => 'require|captcha', $request->validate([
// ], ['captcha.captcha' => 'Неверный защитный код...']); 'captcha' => 'required|captcha',
// ], ['captcha.captcha' => 'Неверный защитный код...']);
// dd($request->all());
$name = $request->get('name'); $name = $request->get('name');
$lastname = $request->get('lastname'); $lastname = $request->get('lastname');
......
...@@ -5,7 +5,7 @@ return [ ...@@ -5,7 +5,7 @@ return [
'default' => [ 'default' => [
'length' => 6, 'length' => 6,
'width' => 150, 'width' => 150,
'height' => 56, 'height' => 70,
'quality' => 90, 'quality' => 90,
'math' => false, 'math' => false,
], ],
......
...@@ -9,9 +9,8 @@ ...@@ -9,9 +9,8 @@
<div class="col-xs-12 col-md-9 col-lg-6 col-md-offset-2 col-lg-offset-3"> <div class="col-xs-12 col-md-9 col-lg-6 col-md-offset-2 col-lg-offset-3">
<!--p.fw-l.h5.text-transform-none Enter your email address to receive all company news, special offers and other discount information.--> <!--p.fw-l.h5.text-transform-none Enter your email address to receive all company news, special offers and other discount information.-->
<!-- RD Mailform--> <!-- RD Mailform-->
<form class="rd-mailform text-left" data-form-output="form-output-global" <form method="post"
data-form-type="forms" method="post" action="{{ route('send.mail') }}">
action="{{ url('/feedback/add') }}">
@csrf @csrf
<div class="row row-10"> <div class="row row-10">
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
...@@ -48,8 +47,23 @@ ...@@ -48,8 +47,23 @@
<textarea class="form-input" id="forms-message" name="message" <textarea class="form-input" id="forms-message" name="message"
data-constraints="@Required"></textarea> data-constraints="@Required"></textarea>
</div> </div>
</div>
<div class="col-xs-3 text-right" >
<div class="captcha">
<span style="float: left;" >{!! captcha_img() !!} </span>
</div>
</div>
<div class="col-xs-9 text-left" >
<input id="captcha" type="text" class="form-input{{ $errors->has('captcha') ? ' has-error' : '' }}" name="captcha" placeholder="Введите код с картинки" required>
@if ($errors->has('captcha'))
<span class="invalid-feedback">
<strong>{{ $errors->first('captcha') }}</strong>
</span>
@endif
</div> </div>
<div class="col-xs-12 text-center"> <div class="col-xs-12 text-right">
<button class="btn btn-primary btn-sm" type="submit">Отправить</button> <button class="btn btn-primary btn-sm" type="submit">Отправить</button>
</div> </div>
</div> </div>
......
...@@ -66,7 +66,9 @@ Route::get('/refresh', 'Auth\LoginController@refresh')->name('refresh'); ...@@ -66,7 +66,9 @@ Route::get('/refresh', 'Auth\LoginController@refresh')->name('refresh');
//Route::post('/login', 'Auth\LoginController@refreshpost')->name('login'); //Route::post('/login', 'Auth\LoginController@refreshpost')->name('login');
Route::post('/feedback/add', 'FeedbackController@addGuest'); /*Route::get('/feedback/add', 'FeedbackController@addGuestCaptcha');
Route::post('/feedback/add', 'FeedbackController@addGuest');*/
Route::post('/send-mail', 'HomeController@sendMail')->name('send.mail'); Route::post('/send-mail', 'HomeController@sendMail')->name('send.mail');
Route::get('/send-mail', 'HomeController@sendMailGet'); Route::get('/send-mail', 'HomeController@sendMailGet');
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment