forked from kevinowino869/mitrobill
Session using cookie
This commit is contained in:
@ -22,6 +22,7 @@ switch ($do) {
|
||||
$d_pass = $d['password'];
|
||||
if (Password::_verify($password, $d_pass) == true) {
|
||||
$_SESSION['aid'] = $d['id'];
|
||||
Admin::setCookie($d['id']);
|
||||
$d->last_login = date('Y-m-d H:i:s');
|
||||
$d->save();
|
||||
_log($username . ' ' . $_L['Login_Successful'], 'Admin', $d['id']);
|
||||
|
@ -238,7 +238,7 @@ switch ($action) {
|
||||
if (Validator::Length($fullname, 36, 2) == false) {
|
||||
$msg .= 'Full Name should be between 3 to 25 characters' . '<br>';
|
||||
}
|
||||
if (!Validator::Length($password, 35, 2)) {
|
||||
if (!Validator::Length($password, 36, 2)) {
|
||||
$msg .= 'Password should be between 3 to 35 characters' . '<br>';
|
||||
}
|
||||
|
||||
@ -275,14 +275,14 @@ switch ($action) {
|
||||
$service_type = _post('service_type');
|
||||
run_hook('edit_customer'); #HOOK
|
||||
$msg = '';
|
||||
if (Validator::Length($username, 16, 2) == false) {
|
||||
if (Validator::Length($username, 35, 2) == false) {
|
||||
$msg .= 'Username should be between 3 to 15 characters' . '<br>';
|
||||
}
|
||||
if (Validator::Length($fullname, 26, 1) == false) {
|
||||
if (Validator::Length($fullname, 36, 1) == false) {
|
||||
$msg .= 'Full Name should be between 2 to 25 characters' . '<br>';
|
||||
}
|
||||
if ($password != '') {
|
||||
if (!Validator::Length($password, 15, 2)) {
|
||||
if (!Validator::Length($password, 36, 2)) {
|
||||
$msg .= 'Password should be between 3 to 15 characters' . '<br>';
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ switch ($do) {
|
||||
$d_pass = $d['password'];
|
||||
if (Password::_uverify($password, $d_pass) == true) {
|
||||
$_SESSION['uid'] = $d['id'];
|
||||
User::setCookie($d['id']);
|
||||
$d->last_login = date('Y-m-d H:i:s');
|
||||
$d->save();
|
||||
_log($username . ' ' . $_L['Login_Successful'], 'User', $d['id']);
|
||||
|
@ -6,5 +6,7 @@
|
||||
|
||||
run_hook('customer_logout'); #HOOK
|
||||
if (session_status() == PHP_SESSION_NONE) session_start();
|
||||
Admin::removeCookie();
|
||||
User::removeCookie();
|
||||
session_destroy();
|
||||
header('location: index.php');
|
Reference in New Issue
Block a user