Beautify the web
This commit is contained in:
@@ -28,7 +28,7 @@ class Home
|
||||
public function login($args = [])
|
||||
{
|
||||
if (Session::exists('userid')) {
|
||||
Session::flash('info', 'Anda telah masuk.');
|
||||
Session::flash('info', 'Anda telah masuk');
|
||||
Redirect::to('/');
|
||||
die();
|
||||
} else {
|
||||
@@ -53,16 +53,16 @@ class Home
|
||||
]);
|
||||
|
||||
if ($user == false) {
|
||||
$info = "Username/password salah.";
|
||||
$info = "Username/password salah";
|
||||
} else {
|
||||
$hash = Hash::compare($password, $user['salt'], $user['password']);
|
||||
|
||||
if ($hash == true) {
|
||||
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.";
|
||||
$info = "Terjadi kesalahan. Silahkan coba lagi dalam beberapa saat";
|
||||
} else {
|
||||
$max_user = $user['max_user'] - 1;
|
||||
if ($this->model->update(['max_user' => $max_user], $user['id']) == true) {
|
||||
@@ -85,14 +85,14 @@ class Home
|
||||
|
||||
public function logout() {
|
||||
if ($this->delete() != true) {
|
||||
$info = "Terjadi kesalahan. Silahkan coba lagi dalam beberapa saat.";
|
||||
$info = "Terjadi kesalahan. Silahkan coba lagi dalam beberapa saat";
|
||||
} else {
|
||||
Session::delete('userid');
|
||||
Session::delete('username');
|
||||
Session::delete('full_name');
|
||||
Session::delete('privilage');
|
||||
|
||||
$info = "Berhasil keluar.";
|
||||
$info = "Berhasil keluar";
|
||||
}
|
||||
Session::flash('info', $info);
|
||||
Redirect::to('/');
|
||||
@@ -114,7 +114,7 @@ class Home
|
||||
{
|
||||
foreach ($args as $value) {
|
||||
if ($value == '') {
|
||||
Session::flash('info', 'Semua data harus diisi.');
|
||||
Session::flash('info', 'Semua data harus diisi');
|
||||
Redirect::to('./register');
|
||||
die();
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class Home
|
||||
$known_uname = $data['username'];
|
||||
}
|
||||
if ($args['username'] == $known_uname) {
|
||||
Session::flash('info', 'Username telah digunakan. Silahkan gunakan username lain.');
|
||||
Session::flash('info', 'Username telah digunakan. Silahkan gunakan username lain');
|
||||
Redirect::to('./register');
|
||||
die();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user