Your Shop creates, verify user
This commit is contained in:
parent
c129a44383
commit
ccc2af4bf7
76 changed files with 3728 additions and 1477 deletions
|
|
@ -60,6 +60,9 @@ class HomeController extends Controller
|
|||
if($data == "imprint"){
|
||||
$response = view('legal.imprint_de')->render();
|
||||
}
|
||||
if($data == "shop_term_of_use"){
|
||||
$response = view('legal.shop_term_of_use_de')->render();
|
||||
}
|
||||
if(Request::ajax()) {
|
||||
return response()->json(['response' => $response, 'target'=>$target]);
|
||||
}
|
||||
|
|
@ -117,4 +120,64 @@ class HomeController extends Controller
|
|||
{
|
||||
return view('legal.imprint');
|
||||
}
|
||||
public function verify($confirmation_code){
|
||||
if( ! $confirmation_code)
|
||||
{
|
||||
return redirect('/status/error');
|
||||
}
|
||||
|
||||
$user = User::whereConfirmationCode($confirmation_code)->first();
|
||||
|
||||
if ( ! $user)
|
||||
{
|
||||
|
||||
return redirect('/status/not/found');
|
||||
}
|
||||
|
||||
$user->confirmed = 1;
|
||||
$user->confirmation_date = now();
|
||||
$user->confirmation_code = null;
|
||||
$user->confirmation_code_to = null;
|
||||
$user->confirmation_code_remider = 0;
|
||||
$user->save();
|
||||
|
||||
//Login!
|
||||
Auth::login($user);
|
||||
|
||||
return redirect('/status/verify');
|
||||
}
|
||||
|
||||
public function statusRegister(){
|
||||
return view('status.status_register');
|
||||
}
|
||||
public function statusVerify(){
|
||||
return view('status.status_verify');
|
||||
}
|
||||
public function statusError(){
|
||||
return view('status.status_error');
|
||||
}
|
||||
public function notFound(){
|
||||
return view('status.not_found');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function checkMail(){
|
||||
|
||||
$data = Input::all();
|
||||
if($data['user_id'] == "new"){
|
||||
if(User::where('email', $data['email'])->count()){
|
||||
return json_encode(false);
|
||||
}
|
||||
}else{
|
||||
if(User::where('email', $data['email'])->where('id', '!=', $data['user_id'])->count()){
|
||||
return json_encode(false);
|
||||
}
|
||||
}
|
||||
return json_encode(true);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue