Added condition when login invalid

This commit is contained in:
2017-09-06 10:57:17 +07:00
parent 71fb5e4933
commit a34ce9d0eb
2 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,6 @@ class Home
}
public function index()
{
// echo "This is index of home"; // Nanti di replace sama twig view ke App\Views\Data\pengumuman.html
$posts = new Posts();
$posts->index();
return true;
@@ -24,22 +23,22 @@ class Home
public function login()
{
// echo "You have to login"; // Nanti di replace sama twig view ke App\Views\Access\login.html
View::render('Access/login.html', [
'token' => Token::generate()
]);
return true;
}
// Methods
public function put($args = [])
{
if ($this->access->login($args)) {
$table = 'user';
$id = Session::get('userid');
if ($this->access->update($table, ['status' => 1], $id)) {
Redirect::to('/');
}
$this->access->update($table, ['status' => 1], $id);
}
Redirect::to('/');
}
public function logout()