Added condition when login invalid
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user