mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-14 09:16:11 +01:00
incremental backups: completion
This commit is contained in:
@@ -180,17 +180,22 @@ class mailUtilities:
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
def changeEmailPassword(email, newPassword):
|
||||
def changeEmailPassword(email, newPassword, encrypt = None):
|
||||
try:
|
||||
CentOSPath = '/etc/redhat-release'
|
||||
changePass = EUsers.objects.get(email=email)
|
||||
if os.path.exists(CentOSPath):
|
||||
password = bcrypt.hashpw(str(newPassword), bcrypt.gensalt())
|
||||
password = '{CRYPT}%s' % (password)
|
||||
changePass.password = password
|
||||
if encrypt == None:
|
||||
CentOSPath = '/etc/redhat-release'
|
||||
changePass = EUsers.objects.get(email=email)
|
||||
if os.path.exists(CentOSPath):
|
||||
password = bcrypt.hashpw(str(newPassword), bcrypt.gensalt())
|
||||
password = '{CRYPT}%s' % (password)
|
||||
changePass.password = password
|
||||
else:
|
||||
changePass.password = newPassword
|
||||
changePass.save()
|
||||
else:
|
||||
changePass = EUsers.objects.get(email=email)
|
||||
changePass.password = newPassword
|
||||
changePass.save()
|
||||
changePass.save()
|
||||
return 0,'None'
|
||||
except BaseException, msg:
|
||||
return 0, str(msg)
|
||||
|
||||
Reference in New Issue
Block a user