fix Customer change password

This commit is contained in:
Ibnu Maksum 2024-06-25 13:51:46 +07:00
parent 812844a15a
commit 8ee0edf985
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
2 changed files with 10 additions and 8 deletions

View file

@ -25,11 +25,10 @@ switch ($action) {
$password = _post('password');
run_hook('customer_change_password'); #HOOK
if ($password != '') {
$d_pass = $d['password'];
$d_pass = $user['password'];
$npass = _post('npass');
$cnpass = _post('cnpass');
if (Password::_uverify($password, $d_pass) == true) {
if ($password == $d_pass) {
if (!Validator::Length($password, 36, 2)) {
r2(U . 'accounts/change-password', 'e', 'New Password must be 2 to 35 character');
}
@ -56,12 +55,12 @@ switch ($action) {
}
$user->password = $npass;
$user->save();
_msglog('s', Lang::T('Password changed successfully, Please login again'));
User::removeCookie();
session_destroy();
_log('[' . $user['username'] . ']: Password changed successfully', 'User', $user['id']);
r2(U . 'login');
_alert(Lang::T('Password changed successfully, Please login again'), 'success', "login");
} else {
die($password);
r2(U . 'accounts/change-password', 'e', Lang::T('Incorrect Current Password'));
}
} else {

View file

@ -535,5 +535,8 @@
"Additional_Information": "informasi tambahan",
"City_of_Resident": "Kota Residen",
"State_of_Resident": "Negara Bagian Tempat Tinggal",
"Zip_Code": "Kode Pos"
"Zip_Code": "Kode Pos",
"Phone": "Telepon",
"Customer_Geo_Location_Information": "Informasi Lokasi Geo Pelanggan",
"": ""
}