本文整理汇总了PHP中Auth::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::logout方法的具体用法?PHP Auth::logout怎么用?PHP Auth::logout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Auth
的用法示例。
在下文中一共展示了Auth::logout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_logout
public function action_logout()
{
if ($this->_auth->logout()) {
$this->_message = __("Logout succeeded");
$this->_user = NULL;
} else {
$this->_message = __("Couldn't logout");
}
}
示例2: anySignout
/**
* anySignout
* --------------------------------------------------
* @return Signs out the user
* --------------------------------------------------
*/
public function anySignout()
{
/* Sign out the user */
Auth::logout();
/* Redirect and add bye message */
return Redirect::route('dashboard.dashboard')->with('success', 'Good bye.');
}
示例3: logout
public function logout()
{
Session::forget('ltime');
Session::forget('sescode');
Auth::logout();
return Response::json(array('flash' => 'Logged Out !'));
}
示例4: getLogout
public function getLogout()
{
if (Auth::check()) {
Auth::logout();
}
return Redirect::to('/');
}
示例5: logout
public function logout()
{
if (Auth::check()) {
Auth::logout();
}
return Redirect::route('frontpage');
}
示例6: doLogout
public function doLogout()
{
//Desconctamos al usuario
Auth::logout();
//Redireccionamos al inicio de la app con un mensaje
return Redirect::to('/login')->with('msg-logout', 'Sesión finalizada correctamente.');
}
示例7: destroy
/**
* Remove the specified resource from storage.
* DELETE /sessions/{id}
*
* @param int $id
* @return Response
*/
public function destroy()
{
if (!Auth::guest()) {
Auth::logout();
}
return Redirect::to('/');
}
示例8: logout
/**
* Log user out of system.
*/
public function logout()
{
Auth::logout();
Session::flush();
// Clear *ALL* session data!
return Redirect::to('login')->with('message', 'You have logged out.');
}
示例9: postIndex
public function postIndex()
{
if (Input::has('changepw')) {
$rules = array('oldPass' => 'required', 'newPass1' => 'required|min:8', 'newPass2' => 'required|min:8|same:newPass1');
$input = Input::all();
$validator = Validator::make($input, $rules);
if ($validator->fails()) {
return Redirect::to('/account')->withErrors($validator);
}
$user = Auth::user();
if (!Auth::validate(array('name' => $user->name, 'password' => $input['oldPass']))) {
return Redirect::to('/account')->withErrors(array('message' => 'You have entered a wrong password.'));
}
$user->password = Hash::make($input['newPass2']);
$user->save();
return Redirect::to('/account');
} elseif (Input::has('removeacc')) {
$rules = array('remPass' => 'required|min:8');
$input = Input::all();
$validator = Validator::make($input, $rules);
if ($validator->fails()) {
return Redirect::to('/account')->withErrors($validator);
}
$user = Auth::user();
if (!Auth::validate(array('name' => $user->name, 'password' => $input['oldPass']))) {
return Redirect::to('/account')->withErrors(array('message' => 'You have entered a wrong password.'));
}
$user->delete();
Auth::logout();
return Redirect::to('/');
}
}
示例10: getLogout
public function getLogout()
{
Auth::logout();
Session::flush();
// Redirect to homepage
return Redirect::to('/')->with('success', 'You have been successfully logged out');
}
示例11: doSignOut
public function doSignOut()
{
$categories = DB::table('categories')->select('name')->get();
$lastPosts = DB::table('posts')->orderBy('id', "DESC")->limit(6)->get();
Auth::logout();
return Redirect::route("index")->with('results', ['categories' => $categories, 'lastPosts' => $lastPosts]);
}
示例12: logout
public function logout()
{
$data = [Auth::user()->full_name, Auth::user()->email, Auth::user()->tipo];
Auth::logout();
$this->setAuditoria('acceso', 'logout', $data);
return Redirect::route('inicio');
}
示例13: getLogout
function getLogout()
{
Session::forget('username');
Session::forget('password');
Auth::logout();
return Redirect::to('/login');
}
示例14: logout
public function logout()
{
// OTURUMU SONLANDIRALIM
Auth::logout();
// KULLANICIYI SORULAR SAYFASINA YÖNLENDİRELİM
return Redirect::route('allQuestions');
}
示例15: profileSave
public function profileSave()
{
$json_request = array('status' => FALSE, 'responseText' => '', 'redirectURL' => FALSE);
$validator = Validator::make(Input::all(), Accounts::$update_rules);
if ($validator->passes()) {
$post = Input::all();
if (self::accountUpdate($post)) {
$result = self::crmAccountUpdate($post);
if ($result === -1) {
Auth::logout();
$json_request['responseText'] = Config::get('api.message');
$json_request['redirectURL'] = pageurl('auth');
return Response::json($json_request, 200);
}
$json_request['redirectURL'] = URL::route('dashboard');
$json_request['responseText'] = Lang::get('interface.DEFAULT.success_save');
$json_request['status'] = TRUE;
} else {
$json_request['responseText'] = Lang::get('interface.DEFAULT.fail');
}
} else {
$json_request['responseText'] = $validator->messages()->all();
}
if (Request::ajax()) {
return Response::json($json_request, 200);
} else {
return Redirect::route('dashboard');
}
}