From: Vincent Vanwaelscappel Date: Fri, 19 Apr 2024 08:45:19 +0000 (+0200) Subject: wip #6872 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=30cf631e27838f5823210a844443c0921fb4487a;p=bastide-resah.git wip #6872 @1 --- diff --git a/app/Http/Controllers/Admin/ClientCrudController.php b/app/Http/Controllers/Admin/ClientCrudController.php index 1376ba9..481d3f0 100644 --- a/app/Http/Controllers/Admin/ClientCrudController.php +++ b/app/Http/Controllers/Admin/ClientCrudController.php @@ -13,7 +13,6 @@ class ClientCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagi use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation; use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation; use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation; - use \App\Http\Controllers\Operations\Client\Fluidbook; diff --git a/app/Http/Controllers/FluidbookController.php b/app/Http/Controllers/FluidbookController.php new file mode 100644 index 0000000..6055e34 --- /dev/null +++ b/app/Http/Controllers/FluidbookController.php @@ -0,0 +1,53 @@ +all(), [ + 'finess' => 'required|regex:/^[0-9]{9}$/', + 'password' => 'required|confirmed|min:8', + 'hospital' => 'required', + 'firstname' => 'required', + 'name' => 'required', + 'function' => 'required', + 'phone' => 'required|regex:/^0[0-9]{9}$/', + 'email' => 'required|confirmed|unique:App\Models\Client,email', + ]); + + if ($validator->fails()) { + return response()->setStatusCode(422)->json(['errors' => $validator->errors()]); + } else { + + $client = new Client(); + foreach ($validator->valid() as $k => $v) { + if ($k === 'password') { + $client->$k = Hash::make($v); + } else { + $client->$k = $v; + } + } + $client->enabled = false; + $client->save(); + + return response()->setStatusCode(200)->json(['success' => 'ok']); + + } + } + + protected function login() + { +// + } + + protected function forgotpassword() + { + // + } +} diff --git a/app/Http/Controllers/LandingController.php b/app/Http/Controllers/LandingController.php new file mode 100644 index 0000000..7b0c15f --- /dev/null +++ b/app/Http/Controllers/LandingController.php @@ -0,0 +1,24 @@ +', '', $html); + return response($html)->header('Content-Type', 'text/html'); + } + + return XSendFileController::sendfile($relayPath); + } +} diff --git a/app/Http/Controllers/Operations/Client/Fluidbook.php b/app/Http/Controllers/Operations/Client/Fluidbook.php deleted file mode 100644 index 756b48e..0000000 --- a/app/Http/Controllers/Operations/Client/Fluidbook.php +++ /dev/null @@ -1,64 +0,0 @@ -withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); - Route::match(['post'], $segment . '/login', $controller . '@login')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); - Route::match(['post'], $segment . '/forgotpassword', $controller . '@login')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); - } - - protected function signin() - { - $validator = Validator::make(request()->all(), [ - 'finess' => 'required|regex:/^[0-9]{9}$/', - 'password' => 'required|confirmed|min:8', - 'hospital' => 'required', - 'firstname' => 'required', - 'name' => 'required', - 'function' => 'required', - 'phone' => 'required|regex:/^0[0-9]{9}$/', - 'email' => 'required|confirmed|unique:App\Models\Client,email', - ]); - - if ($validator->fails()) { - return response()->setStatusCode(422)->json(['errors' => $validator->errors()]); - } else { - - $client = new Client(); - foreach ($validator->valid() as $k => $v) { - if ($k === 'password') { - $client->$k = Hash::make($v); - } else { - $client->$k = $v; - } - } - $client->enabled = false; - $client->save(); - - return response()->setStatusCode(200)->json(['success' => 'ok']); - - } - } - - protected function login() - { -// - } - - protected function forgotpassword() - { - // - } -} diff --git a/app/Http/Controllers/WebflowController.php b/app/Http/Controllers/WebflowController.php deleted file mode 100644 index d143667..0000000 --- a/app/Http/Controllers/WebflowController.php +++ /dev/null @@ -1,22 +0,0 @@ - 'client', 'plural' => 'clients']; - protected $_operations = [Fluidbook::class]; - public function setFields() { parent::setFields(); @@ -26,6 +25,5 @@ class Client extends CubistMagicAuthenticatable $this->addField('name', Text::class, 'Nom', ['tab' => 'Login']); $this->addField('function', Text::class, 'Fonction', ['tab' => 'Login']); $this->addField('phone', Text::class, 'Numéro de téléphone', ['tab' => 'Login']); - } } diff --git a/resources/webflow/charte-de-protection-des-donnees-personnelles.html b/resources/webflow/charte-de-protection-des-donnees-personnelles.html index 3eaa239..3195b39 100644 --- a/resources/webflow/charte-de-protection-des-donnees-personnelles.html +++ b/resources/webflow/charte-de-protection-des-donnees-personnelles.html @@ -1,5 +1,5 @@ - + diff --git a/resources/webflow/index.html b/resources/webflow/index.html index ca83034..de43b54 100644 --- a/resources/webflow/index.html +++ b/resources/webflow/index.html @@ -1,5 +1,5 @@ - + @@ -39,7 +39,7 @@

Pour afficher les tarifs, ajouter des produits à votre sélection, et nous envoyer une demande de devis, veuillez vous identifier :

-
+
Thank you! Your submission has been received!
diff --git a/resources/webflow/js/custom.js b/resources/webflow/js/custom.js index 6b762bd..3bee40e 100644 --- a/resources/webflow/js/custom.js +++ b/resources/webflow/js/custom.js @@ -1,6 +1,15 @@ $(function () { $('#wf-form-login').on('submit', function (e) { - alert('non !! va pas sur ' + $(this).attr('action')); + $.ajax( + { + url: $(this).attr('action'), + method: "POST", + data: $(this).serialize(), + dataType: 'json', + success: function (data) { + + } + }); return false; }); }); diff --git a/resources/webflow/mentions-legales.html b/resources/webflow/mentions-legales.html index ba8d60f..a1b6d36 100644 --- a/resources/webflow/mentions-legales.html +++ b/resources/webflow/mentions-legales.html @@ -1,5 +1,5 @@ - + diff --git a/routes/web.php b/routes/web.php index ea13b82..dcd368e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,8 +1,17 @@ where('path', '.*'); Route::get('/catalogue_invite/{path?}', \App\Http\Controllers\CatalogController::class . '@guest')->where('path', '.*'); -Route::get('/{path?}', \App\Http\Controllers\WebflowController::class . '@catchall')->where('path', '.*'); +Route::get('/{path?}', \App\Http\Controllers\LandingController::class . '@catchall')->where('path', '.*'); +Route::match(['post'], '/fluidbook/signin', \App\Http\Controllers\FluidbookController::class . '@signin')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); +Route::match(['post'], '/fluidbook/login', \App\Http\Controllers\FluidbookController::class . '@login')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); +Route::match(['post'], '/fluidbook/forgotpassword', \App\Http\Controllers\FluidbookController::class . '@forgotPAssword')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); + +Route::match(['post'], '/landing/signin', \App\Http\Controllers\LandingController::class . '@signin')->withoutMiddleware([CheckIfAdmin::class]); +Route::match(['post'], '/landing/login', \App\Http\Controllers\LandingController::class . '@login')->withoutMiddleware([CheckIfAdmin::class]); +Route::match(['post'], '/landing/forgotpassword', \App\Http\Controllers\LandingController::class . '@forgotPassword')->withoutMiddleware([CheckIfAdmin::class]);