From 49635c415d7d1048cafacc34363620d69a855587 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Sat, 2 Aug 2025 09:42:18 +0500 Subject: [PATCH] bug fix: https://github.com/usmannasir/cyberpanel/issues/1467 --- plogical/mailUtilities.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/plogical/mailUtilities.py b/plogical/mailUtilities.py index 5e247f606..ca44d9f4c 100644 --- a/plogical/mailUtilities.py +++ b/plogical/mailUtilities.py @@ -404,20 +404,15 @@ class mailUtilities: @staticmethod def changeEmailPassword(email, newPassword, encrypt = None): try: + changePass = EUsers.objects.get(email=email) if encrypt == None: - CentOSPath = '/etc/redhat-release' - changePass = EUsers.objects.get(email=email) - if os.path.exists(CentOSPath): - password = bcrypt.hashpw(newPassword.encode('utf-8'), bcrypt.gensalt()) - password = '{CRYPT}%s' % (password.decode()) - changePass.password = password - else: - changePass.password = newPassword - changePass.save() + # Always use bcrypt hashing regardless of OS + password = bcrypt.hashpw(newPassword.encode('utf-8'), bcrypt.gensalt()) + password = '{CRYPT}%s' % (password.decode()) + changePass.password = password else: - changePass = EUsers.objects.get(email=email) changePass.password = newPassword - changePass.save() + changePass.save() return 0,'None' except BaseException as msg: return 0, str(msg)