banned customer will automatically logout
This commit is contained in:
parent
9521e96495
commit
f81feee9c0
@ -163,7 +163,9 @@ class User
|
|||||||
$id = User::getID();
|
$id = User::getID();
|
||||||
}
|
}
|
||||||
$d = ORM::for_table('tbl_customers')->find_one($id);
|
$d = ORM::for_table('tbl_customers')->find_one($id);
|
||||||
|
if ($d['status'] != 'Banned') {
|
||||||
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($d['status']), 'danger', "logout");
|
||||||
|
}
|
||||||
if (empty($d['username'])) {
|
if (empty($d['username'])) {
|
||||||
r2(U . 'logout', 'd', '');
|
r2(U . 'logout', 'd', '');
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* by https://t.me/ibnux
|
* by https://t.me/ibnux
|
||||||
**/
|
**/
|
||||||
|
|
||||||
if(User::getID()){
|
if (User::getID()) {
|
||||||
r2(U.'home');
|
r2(U . 'home');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($routes['1'])) {
|
if (isset($routes['1'])) {
|
||||||
@ -24,8 +24,8 @@ switch ($do) {
|
|||||||
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
||||||
if ($d) {
|
if ($d) {
|
||||||
$d_pass = $d['password'];
|
$d_pass = $d['password'];
|
||||||
if($d['status'] != 'Banned'){
|
if ($d['status'] != 'Banned') {
|
||||||
_alert(Lang::T('This account status').' : '.Lang::T($c['status']),'danger', "");
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($d['status']), 'danger', "");
|
||||||
}
|
}
|
||||||
if (Password::_uverify($password, $d_pass) == true) {
|
if (Password::_uverify($password, $d_pass) == true) {
|
||||||
$_SESSION['uid'] = $d['id'];
|
$_SESSION['uid'] = $d['id'];
|
||||||
@ -33,7 +33,7 @@ switch ($do) {
|
|||||||
$d->last_login = date('Y-m-d H:i:s');
|
$d->last_login = date('Y-m-d H:i:s');
|
||||||
$d->save();
|
$d->save();
|
||||||
_log($username . ' ' . Lang::T('Login Successful'), 'User', $d['id']);
|
_log($username . ' ' . Lang::T('Login Successful'), 'User', $d['id']);
|
||||||
_alert(Lang::T('Login Successful'),'success', "home");
|
_alert(Lang::T('Login Successful'), 'success', "home");
|
||||||
} else {
|
} else {
|
||||||
_msglog('e', Lang::T('Invalid Username or Password'));
|
_msglog('e', Lang::T('Invalid Username or Password'));
|
||||||
_log($username . ' ' . Lang::T('Failed Login'), 'User');
|
_log($username . ' ' . Lang::T('Failed Login'), 'User');
|
||||||
@ -71,7 +71,7 @@ switch ($do) {
|
|||||||
r2(U . 'login', 'e', Lang::T('Voucher activation failed'));
|
r2(U . 'login', 'e', Lang::T('Voucher activation failed'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_alert(Lang::T('Login Successful'),'success', "dashboard");
|
_alert(Lang::T('Login Successful'), 'success', "dashboard");
|
||||||
r2(U . 'login', 'e', Lang::T('Voucher activation failed') . '.');
|
r2(U . 'login', 'e', Lang::T('Voucher activation failed') . '.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user