Fixed login issue

This commit is contained in:
Gregorio Chiko Putra 2017-09-18 08:49:42 +07:00
parent acd2880637
commit d555bde0d8

View File

@ -56,9 +56,6 @@ class Home
if ($hash == true) { if ($hash == true) {
if ($user['max_user'] <= 0) { if ($user['max_user'] <= 0) {
$info = "Telah mencapai maksimal user yang diizinkan - Silahkan logout pada perangkat lain terlebih dahulu"; $info = "Telah mencapai maksimal user yang diizinkan - Silahkan logout pada perangkat lain terlebih dahulu";
} else {
if ($this->model->update(['status' => 1], $user['id']) != true) {
$info = "Terjadi kesalahan. Silahkan coba lagi dalam beberapa saat";
} else { } else {
$max_user = $user['max_user'] - 1; $max_user = $user['max_user'] - 1;
if ($this->model->update(['max_user' => $max_user], $user['id']) == true) { if ($this->model->update(['max_user' => $max_user], $user['id']) == true) {
@ -72,7 +69,6 @@ class Home
} }
} }
} }
}
Session::flash('info', $info); Session::flash('info', $info);
Redirect::to('/'); Redirect::to('/');
die(); die();
@ -171,7 +167,6 @@ class Home
if ($this->model->update( if ($this->model->update(
[ [
'status' => 0,
'max_user' => $max_user 'max_user' => $max_user
], ],
$userid $userid