ChangeLinuxUserPassword

This commit is contained in:
usman@cyberpersons.com
2023-02-27 10:11:32 +05:00
parent c2b237fd0e
commit b06886a875
2 changed files with 7 additions and 3 deletions

View File

@@ -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':

View File

@@ -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)