本文整理汇总了PHP中App\Http\Controllers\Auth::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::logout方法的具体用法?PHP Auth::logout怎么用?PHP Auth::logout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Http\Controllers\Auth
的用法示例。
在下文中一共展示了Auth::logout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
/**
* Logout
*
* @return Response
*/
public function logout()
{
if (\Auth::check()) {
\Auth::logout();
}
return \Redirect::route('home.index');
}
示例2: loginuser
public function loginuser(Request $request)
{
$rules = ['email' => 'required|email', 'password' => 'required'];
$nicename = ['email' => 'emile', 'password' => 'password'];
$validator = \Illuminate\Support\Facades\Validator::make($request->all(), $rules);
$validator->setAttributeNames($nicename);
if ($validator->fails()) {
$request->flash();
return redirect()->back()->withErrors($validator);
}
if ($request->has('password') && $request->has('email')) {
if (\Auth::user()->attempt(['email' => $request->input('email'), 'password' => $request->input('password')])) {
// Authentication passed...
if (\Auth::user()->get()->type == 0) {
$userinfo = \DB::table('system_user')->where('system_user.user', '=', \Auth::user()->get()->id)->get();
session()->put('userinfo', $userinfo);
return redirect()->intended('home');
} else {
Auth::logout();
return redirect()->back();
}
} else {
$request->flash();
return redirect()->back()->withErrors(['loginwrong' => 'check your access info']);
}
}
}
示例3: logout
public function logout()
{
Auth::logout();
// logout user
return Redirect::to('admin/login');
//redirect back to login
}
示例4: logout
public static function logout()
{
if (\Auth::user()) {
\Auth::logout();
}
return \Redirect::route('home');
}
示例5: logout
public function logout()
{
if (\Auth::check()) {
\Auth::logout();
}
return \Redirect::back();
}
示例6: doLogout
public function doLogout()
{
Auth::logout();
// log the user out of our application
return Redirect::to('login');
// redirect the user to the login screen
}
示例7: logout
/**
* @author LAHAXE Arnaud
*
* @param \App\Libraries\OAuth\Password $passwordService
*
* @return \Illuminate\Http\RedirectResponse|\Laravel\Lumen\Http\Redirector
*/
public function logout(OAuthPassword $passwordService)
{
// remove OAuth token from database and session
$passwordService->logout();
// logout user
\Auth::logout();
return redirect(route('auth.loginForm'));
}
示例8: logout
/**
* Logout user
* @return Ambigous <\Illuminate\Routing\Redirector, \Illuminate\Http\RedirectResponse>
*/
public function logout()
{
if (\Auth::check()) {
\Auth::logout();
session()->flush();
}
return redirect('/');
}
示例9: redirectToFacebook
public function redirectToFacebook($redirect_path = null)
{
\Session::flush();
\Auth::logout();
if ($redirect_path) {
\Config::set('services.facebook.redirect', \Config::get('services.facebook.redirect') . "/" . $redirect_path);
}
return Socialize::with('facebook')->redirect();
}
示例10: logout
public function logout()
{
if (\Auth::check()) {
\Auth::logout();
Session::forget('user_name');
Session::forget('pts');
return Redirect::to('/')->with('message', 'Successfully Logged Out!');
} else {
return Redirect::to('login')->with('message', 'You need to login first!');
}
}
示例11: confirmPassword
public function confirmPassword(Request $r)
{
$token = urldecode($r->token);
$id = $r->id;
if ($pwd = PRM::find($id)) {
$deadline = strtotime($pwd->created_at) + 86400;
$pageOpenTime = strtotime('now');
if (abs($deadline - $pageOpenTime) >= 86400) {
return "Password Token expired";
}
event(new PCEvent($pwd));
\Auth::logout();
return redirect('/');
} else {
return "Password Change Process Terminated";
}
}
示例12: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(Request $request)
{
if (\Auth::check()) {
if (\Auth::user()->role == 1) {
$numberReferredCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '<>', 'Pending Closure')->where('cases.status', '<>', 'Resolved')->groupBy('cases.id')->get();
$numberPendingClosureCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '=', 'Pending Closure')->groupBy('cases.id')->get();
$numberResolvedCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '=', 'Resolved')->groupBy('cases.id')->get();
$numberPendingCases = \DB::table('cases')->where('cases.status', '=', 'Pending')->get();
} else {
$numberReferredCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '<>', 'Pending Closure')->where('cases.status', '<>', 'Resolved')->where('caseOwners.user', '=', \Auth::user()->id)->groupBy('cases.id')->get();
$numberPendingClosureCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '=', 'Pending Closure')->where('caseOwners.user', '=', \Auth::user()->id)->groupBy('cases.id')->get();
$numberResolvedCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '=', 'Resolved')->where('caseOwners.user', '=', \Auth::user()->id)->groupBy('cases.id')->get();
}
return view('home.home', compact('numberReferredCases', 'numberPendingClosureCases', 'numberResolvedCases', 'numberPendingCases'));
} else {
\Auth::logout();
}
}
示例13: store
public function store()
{
$id = $this->missionService->storeMission();
if ($id == 'logout') {
\Auth::logout();
\Session::flush();
return \Redirect::route('admin/home');
}
$file = \Input::file('file');
if ($file != null) {
$validateFile = $this->fileService->validateImage($file);
if (!$validateFile['error']) {
$this->missionService->storeImg($id, $file);
} else {
//else, redirect back with message
\Session::flash('flash_message', $validateFile['message']);
\Session::flash('flash_type', 'alert-danger');
return \Redirect::back()->withInput();
}
}
return \Redirect::route('mission/profile', ['id' => $id]);
}
示例14: confirmEmail
/**
* @param $token
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function confirmEmail($token)
{
// validate if this token exists on the record.
// validate if the email address associated with this token
$reset_record = \App\Email_address_reset::where('token', '=', $token)->firstOrFail();
$new_email = $reset_record->email;
// select the specific user
$user = $reset_record->user()->get()[0];
// NEED TO FIX !!!!!!!!!
// change his email address
$user->email = $new_email;
$user->save();
// delete the record
$reset_record->where('token', $token)->delete();
// flash the message
flash('Your Email is updated, please sign in with your new Email Address');
// redirect somewhere
// Kill session or have user logout
if (\Auth::check()) {
\Auth::logout();
}
return redirect('auth/login');
}
示例15: logout
public function logout()
{
\Auth::logout();
return view('loggedOut');
}