Logging out now displays a message
This commit is contained in:
parent
23622bc5a8
commit
ab8506882a
@ -96,7 +96,16 @@ class Home
|
|||||||
|
|
||||||
public function logout()
|
public function logout()
|
||||||
{
|
{
|
||||||
if ($this->access->logout()) {
|
$user = Session::get('userid');
|
||||||
|
$username = Session::get('username');
|
||||||
|
if ($this->access->logout($user)) {
|
||||||
|
Session::flash('info', "$username has logged out");
|
||||||
|
|
||||||
|
Session::delete('userid');
|
||||||
|
Session::delete('username');
|
||||||
|
Session::delete('full_name');
|
||||||
|
Session::delete('privilage');
|
||||||
|
|
||||||
Redirect::to('/');
|
Redirect::to('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,19 +102,9 @@ class Access extends \Core\Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logout()
|
public function logout($id)
|
||||||
{
|
{
|
||||||
$id = \Core\Session::get('userid');
|
if ($this->update('user', ['status' => 0], $id)) {
|
||||||
if ($this->update(
|
|
||||||
'user',
|
|
||||||
['status' => 0],
|
|
||||||
$id
|
|
||||||
)) {
|
|
||||||
\Core\Session::delete('userid');
|
|
||||||
\Core\Session::delete('username');
|
|
||||||
\Core\Session::delete('full_name');
|
|
||||||
\Core\Session::delete('privilage');
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user