mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-22 01:38:49 -05:00
@@ -59,13 +59,15 @@ class ForgotUsernameController extends Controller
|
||||
$user = User::where('email', $email)->first();
|
||||
|
||||
if (empty($user)) {
|
||||
return redirect()->route('username.request')->with(Toastr::error('We could not find this email in our system!', 'Whoops!', ['options']));
|
||||
return redirect()->route('username.request')
|
||||
->with(Toastr::error('We could not find this email in our system!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
//send username reminder notification
|
||||
$user->notify(new UsernameReminder());
|
||||
|
||||
return redirect()->route('login')->with(Toastr::success('Your username has been sent to your email address!', 'Yay!', ['options']));
|
||||
return redirect()->route('login')
|
||||
->with(Toastr::success('Your username has been sent to your email address!', 'Yay!', ['options']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,12 +41,14 @@ class LoginController extends Controller
|
||||
if ($user->active == 0 || $user->group_id == 1) {
|
||||
auth()->logout();
|
||||
$request->session()->flush();
|
||||
return redirect()->route('login')->with(Toastr::error('This account has not been activated and is still in validating group, Please check your email for activation link. If you did not receive the activation code, please click "forgot password" and complete the steps.', 'Whoops!', ['options']));
|
||||
return redirect()->route('login')
|
||||
->with(Toastr::error('This account has not been activated and is still in validating group, Please check your email for activation link. If you did not receive the activation code, please click "forgot password" and complete the steps.', 'Whoops!', ['options']));
|
||||
}
|
||||
if ($user->group_id == 5) {
|
||||
auth()->logout();
|
||||
$request->session()->flush();
|
||||
return redirect()->route('login')->with(Toastr::error('This account is Banned!', 'Whoops!', ['options']));
|
||||
return redirect()->route('login')
|
||||
->with(Toastr::error('This account is Banned!', 'Whoops!', ['options']));
|
||||
}
|
||||
return redirect('/');
|
||||
}
|
||||
|
||||
@@ -47,14 +47,16 @@ class RegisterController extends Controller
|
||||
|
||||
// Make sure open reg is off and ivite code is present
|
||||
if (config('other.invite-only') == true && $code == null) {
|
||||
return view('auth.login')->with(Toastr::error('Open Reg Closed! You Must Be Invited To Register! You Have Been Redirected To Login Page!', 'Whoops!', ['options']));
|
||||
return view('auth.login')
|
||||
->with(Toastr::error('Open Reg Closed! You Must Be Invited To Register! You Have Been Redirected To Login Page!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
if ($request->isMethod('post')) {
|
||||
// Make sure open reg is off and ivite code exsist and has not been used already
|
||||
$key = Invite::where('code', '=', $code)->first();
|
||||
if (config('other.invite-only') == true && (!$key || $key->accepted_by !== null)) {
|
||||
return view('auth.register', ['code' => $code])->with(Toastr::error('Invalid or Expired Invite Key!', 'Whoops!', ['options']));
|
||||
return view('auth.register', ['code' => $code])
|
||||
->with(Toastr::error('Invalid or Expired Invite Key!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
$v = validator($request->all(), [
|
||||
@@ -65,8 +67,8 @@ class RegisterController extends Controller
|
||||
]);
|
||||
|
||||
if ($v->fails()) {
|
||||
$errors = $v->messages();
|
||||
return redirect()->route('register', ['code' => $code])->with(Toastr::error('Either The Username/Email is already in use or you missed a field. Make sure password is also min 6 charaters!', 'Whoops!', ['options']));
|
||||
return redirect()->route('register', ['code' => $code])
|
||||
->with(Toastr::error($v->errors()->toJson(), 'Whoops!', ['options']));
|
||||
} else {
|
||||
// Create The User
|
||||
$group = Group::where('slug', '=', 'validating')->first();
|
||||
@@ -113,7 +115,8 @@ class RegisterController extends Controller
|
||||
// Activity Log
|
||||
\LogActivity::addToLog("Member " . $user->username . " has successfully registered to site.");
|
||||
|
||||
return redirect()->route('login')->with(Toastr::success('Thanks for signing up! Please check your email to Validate your account', 'Yay!', ['options']));
|
||||
return redirect()->route('login')
|
||||
->with(Toastr::success('Thanks for signing up! Please check your email to Validate your account', 'Yay!', ['options']));
|
||||
}
|
||||
}
|
||||
return view('auth.register', ['code' => $code]);
|
||||
|
||||
Reference in New Issue
Block a user