01 2020
This commit is contained in:
parent
f117f79bb9
commit
3711fcc8d0
101 changed files with 4027 additions and 918 deletions
|
|
@ -178,7 +178,6 @@ class CheckoutController extends Controller
|
|||
return redirect(route('checkout.checkout_card'))->withInput(Input::all());
|
||||
}
|
||||
if($ret['elv']['status'] === 'APPROVED' && $ret['elv']['mandate_status'] !== "active"){
|
||||
dd($ret);
|
||||
\Session::flash('elv-managemandate', 1);
|
||||
\Session::flash('elv-mandate_identification', $ret['elv']['mandate_identification']);
|
||||
\Session::flash('elv-mandate_text', $ret['elv']['mandate_text']);
|
||||
|
|
@ -198,7 +197,7 @@ class CheckoutController extends Controller
|
|||
if(Input::get('payment_method') === 'elv' && Input::get('mandate_identification')) {
|
||||
$ret['elv']['mandate_identification'] = Input::get('mandate_identification');
|
||||
$ret['elv']['creditor_identifier'] = Input::get('creditor_identifier');
|
||||
$ret['elv']['iban'] = $data['iban'];
|
||||
$ret['elv']['iban'] = $data['elv_iban'];
|
||||
$ret['elv']['bic'] = $data['elv_bic'];
|
||||
$ret['elv']['bankaccountholder'] = $data['elv_bankaccountholder'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ class ContactController extends Controller
|
|||
$validator = Validator::make(Input::all(), $rules);
|
||||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator)->withErrors($validator)->withInput(Input::all());
|
||||
}else{
|
||||
}
|
||||
|
||||
|
||||
$contact = [];
|
||||
$contact['first_name'] = Input::get('first_name');
|
||||
|
|
@ -78,8 +79,6 @@ class ContactController extends Controller
|
|||
'user_shop' => Util::getUserShop(),
|
||||
];
|
||||
return view('web.templates.contact-final', $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
135
app/Http/Controllers/Web/RegisterController.php
Executable file
135
app/Http/Controllers/Web/RegisterController.php
Executable file
|
|
@ -0,0 +1,135 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Web;
|
||||
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Mail\MailContact;
|
||||
use App\Mail\MailVerifyAccount;
|
||||
use App\Repositories\UserRepository;
|
||||
use App\User;
|
||||
use GuzzleHttp\Client;
|
||||
use Input;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use App\Services\Util;
|
||||
use Validator;
|
||||
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
|
||||
private $GOOGLE_ReCAPTCHA_KEY = "6LeeZosUAAAAAG907fMMqO4BFgsiR4ANDodd8FlU";
|
||||
private $GOOGLE_ReCAPTCHA_SECRET = "6LeeZosUAAAAADIy2fyR4RG3EuM-Zdz7Pa2Qmb1J";
|
||||
|
||||
protected $userRepo;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function __construct(UserRepository $userRepo)
|
||||
{
|
||||
$this->userRepo = $userRepo;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
|
||||
$data = [
|
||||
'GOOGLE_ReCAPTCHA_KEY' => $this->GOOGLE_ReCAPTCHA_KEY,
|
||||
'user_shop' => Util::getUserShop(),
|
||||
];
|
||||
return view('web.templates.registrierung', $data);
|
||||
|
||||
}
|
||||
|
||||
public function register(){
|
||||
|
||||
|
||||
$rules = array(
|
||||
'first_name'=>'required',
|
||||
'last_name'=>'required',
|
||||
'salutation' => 'required',
|
||||
'email' => 'required|string|email|max:255|unique:users',
|
||||
'email-confirm' => 'required|same:email',
|
||||
'password' => 'required|string|min:6|confirmed',
|
||||
'password_confirmation' => 'required|string|min:6',
|
||||
// 'g-recaptcha-response'=>'required|recaptcha',
|
||||
'accepted_data_protection' => 'required',
|
||||
);
|
||||
|
||||
/*Validator::extend('recaptcha', function($attribute, $value, $parameters, $validator) {
|
||||
return $this->reCaptcha_validate($attribute, $value, $parameters, $validator);
|
||||
});*/
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator)->withErrors($validator)->withInput(Input::all());
|
||||
}
|
||||
|
||||
$user_shop = Util::getUserShop();
|
||||
|
||||
$data = Input::all();
|
||||
$user = $this->userRepo->create($data);
|
||||
|
||||
$unique = false;
|
||||
do{
|
||||
$confirmation_code = str_random(30);
|
||||
if(User::where('confirmation_code', '=', $confirmation_code)->count() == 0){
|
||||
$unique = true;
|
||||
}
|
||||
}
|
||||
while(!$unique);
|
||||
|
||||
|
||||
$user->lang = !empty(\App::getLocale()) ? \App::getLocale() : "de";
|
||||
$user->confirmation_code = $confirmation_code;
|
||||
$user->confirmation_code_to = date('Y-m-d H:i:s', strtotime('+1 week'));
|
||||
$user->confirmation_code_remider = 0;
|
||||
$user->m_sponsor = $user_shop->user->id;
|
||||
$user->m_level = 1;
|
||||
$user->save();
|
||||
|
||||
$user->account->data_protection = now();
|
||||
$user->account->save();
|
||||
|
||||
Mail::to($user->email)->send(new MailVerifyAccount($confirmation_code, $user));
|
||||
return redirect('/registrierung/finish');
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function finish()
|
||||
{
|
||||
$data = [
|
||||
'user_shop' => Util::getUserShop(),
|
||||
];
|
||||
return view('web.templates.registrierung_finish', $data);
|
||||
}
|
||||
/*
|
||||
private function reCaptcha_validate($attribute, $value, $parameters, $validator)
|
||||
{
|
||||
|
||||
$client = new Client();
|
||||
|
||||
$response = $client->post(
|
||||
'https://www.google.com/recaptcha/api/siteverify',
|
||||
['form_params' =>
|
||||
[
|
||||
'secret' => $this->GOOGLE_ReCAPTCHA_SECRET,
|
||||
'response' => $value
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$body = json_decode((string)$response->getBody());
|
||||
return $body->success;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -63,8 +63,8 @@ class SiteController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if($site == 'produkte'){
|
||||
if($subsite || $subsite != 'alle-produkte') {
|
||||
if($site === 'produkte'){
|
||||
if($subsite || $subsite !== 'alle-produkte') {
|
||||
$category = Category::where('slug', $subsite)->where('active', true)->first();
|
||||
if ($category) {
|
||||
$headline_image = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue