本文整理汇总了PHP中Illuminate\Support\Facades\Auth::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::logout方法的具体用法?PHP Auth::logout怎么用?PHP Auth::logout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Auth
的用法示例。
在下文中一共展示了Auth::logout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainController
/**
* Main Notes Form Controller
*/
public function mainController()
{
//get whos login
$user_id = \Auth::user()->id;
session_start();
session_regenerate_id();
if (!isset($_SESSION["timer"])) {
$_SESSION["timer"] = time();
}
if (time() - $_SESSION["timer"] > 20 * 60) {
$user = User::find($user_id);
Auth::logout($user);
unset($_SESSION["timer"]);
return view('auth.login')->with('timeout', "you been logout for inactivity");
}
$fileErrors = $this->updateNotes($user_id);
//initial queries
$notes = Notes::where('user_id', '=', $user_id)->first()->mynotes;
$tbd = Tbd::where('user_id', '=', $user_id)->first()->mytbd;
$linksArray = \App\Websites::where('user_id', $user_id)->first()->mylink;
$image = DB::table('myimages')->where('user_id', $user_id)->lists('myimage', 'id');
$website = explode(',', $linksArray);
$_SESSION["timer"] = time();
return view('home', compact('notes', 'tbd', 'website', 'image', 'fileErrors'));
}
示例2: home
/**
* Log the user out of the application.
*
* @return \Illuminate\Http\Response
*/
public function home()
{
Auth::logout();
//return route('register');
//return "Hola";
return redirect(route('register'));
}
示例3: getLogout
/**
* Log the user out of the application.
*
* @param Session $session
* @return \Illuminate\Http\Response
*/
public function getLogout(Session $session)
{
event(new UserWasLoggedOut($session->getSession()));
$session->setOffline();
Auth::logout();
return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
}
示例4: getLogout
public function getLogout()
{
if (Auth::check()) {
Auth::logout();
}
return Redirect::to('index')->with('message', '你现在已经退出登录了!');
}
示例5: logout
public function logout()
{
$seguranca = new DPRFSeguranca(config("PRF.siglaSistema"), config("PRF.producao"));
$seguranca->auditoria(Auth::user()->cpf, "LOGOUT", "Logout", array());
Auth::logout();
return Redirect::to("/");
}
示例6: doLogout
public function doLogout()
{
Auth::logout();
// log the user out of our application
return Redirect::to('/');
// redirect the user to the login
}
示例7: doLogout
public function doLogout()
{
if (Auth::check()) {
Auth::logout();
return redirect('/');
}
}
示例8: filter
/**
* @return mixed
*/
public function filter()
{
if (!Auth::check() or !Auth::user()->is('admin')) {
Auth::logout();
return Redirect::route('admin.login.index');
}
}
示例9: __construct
/**
* Create a new password controller instance.
*
* @return void
*/
public function __construct()
{
if (Auth::check()) {
Auth::logout();
}
$this->middleware('guest');
}
示例10: logout
/**
* 用户登出
*/
public function logout()
{
if (Auth::check()) {
Auth::logout();
}
return Redirect::route('login');
}
示例11: logout
public function logout()
{
if (Auth::check()) {
Auth::logout();
}
return redirect('/')->with('message', '注销成功!');
}
示例12: getLogout
/**
* Logout the user
*
* @return Redirect
*/
public function getLogout()
{
//Logout the user
Auth::logout();
//Redirect to login page
return Redirect::to('admin/login')->with('success', Lang::get('firadmin::admin.messages.logout-success'));
}
示例13: getLogout
public function getLogout()
{
Auth::logout();
Session::flush();
return redirect('/admin/login');
//return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
}
示例14: postReset
public function postReset(PasswordResetRequest $request)
{
/*
if($request['new_user'] == "" && $request['new_password'] == "")
{
return redirect()->route('user_reset');
}
*/
//$user = User::where('password', '=', bcrypt($request['password']))->count();
//$password = bcrypt($request['password']);
$user = User::where('user', '=', $request['user'])->get();
if ($user->count()) {
$userEdit = User::find($user[0]->id);
if ($userEdit->id != Auth::user()->id) {
$errors = array("0" => "Las credenciales no coinciden con el usuario autentificado actualmente!");
return $request->response($errors);
}
if ($request['new_user'] != "") {
$userEdit->user = $request['new_user'];
}
if ($request['new_password'] != "") {
$userEdit->password = bcrypt($request['new_password']);
}
$userEdit->save();
//***//
Auth::logout();
return redirect()->route('login')->with('message', 'resetok');
} else {
$errors = array("0" => "Usuario no identificado");
return $request->response($errors);
}
}
示例15: getLogout
public function getLogout()
{
Auth::logout();
$this->login = false;
$this->user = null;
return "Volte a qualquer momento";
}