mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 13:25:51 +01:00
ChangeLinuxUserPassword
This commit is contained in:
@@ -118,6 +118,10 @@ def router(request):
|
||||
return cm.ChangeStateThemes()
|
||||
elif controller == 'DeleteThemes':
|
||||
return cm.DeleteThemes()
|
||||
elif controller == 'ChangeLinuxUserPassword':
|
||||
from websiteFunctions.website import WebsiteManager
|
||||
wm = WebsiteManager()
|
||||
return wm.saveSSHAccessChanges(admin.id, data)
|
||||
elif controller == 'GetServerPublicSSHkey':
|
||||
return cm.GetServerPublicSSHkey()
|
||||
elif controller == 'SubmitPublicKey':
|
||||
|
||||
@@ -4680,13 +4680,13 @@ StrictHostKeyChecking no
|
||||
uBuntuPath = '/etc/lsb-release'
|
||||
|
||||
if os.path.exists(uBuntuPath):
|
||||
command = "echo '%s:%s' | chpasswd" % (data['externalApp'], data['password'])
|
||||
command = "echo '%s:%s' | chpasswd" % (website.externalApp, data['password'])
|
||||
else:
|
||||
command = 'echo "%s" | passwd --stdin %s' % (data['password'], data['externalApp'])
|
||||
command = 'echo "%s" | passwd --stdin %s' % (data['password'], website.externalApp)
|
||||
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
data_ret = {'status': 1, 'error_message': 'None'}
|
||||
data_ret = {'status': 1, 'error_message': 'None', 'LinuxUser': website.externalApp}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user