Skip to content

Commit b06886a

Browse files
committed
ChangeLinuxUserPassword
1 parent c2b237f commit b06886a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cloudAPI/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ def router(request):
118118
return cm.ChangeStateThemes()
119119
elif controller == 'DeleteThemes':
120120
return cm.DeleteThemes()
121+
elif controller == 'ChangeLinuxUserPassword':
122+
from websiteFunctions.website import WebsiteManager
123+
wm = WebsiteManager()
124+
return wm.saveSSHAccessChanges(admin.id, data)
121125
elif controller == 'GetServerPublicSSHkey':
122126
return cm.GetServerPublicSSHkey()
123127
elif controller == 'SubmitPublicKey':

websiteFunctions/website.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4680,13 +4680,13 @@ def saveSSHAccessChanges(self, userID=None, data=None):
46804680
uBuntuPath = '/etc/lsb-release'
46814681

46824682
if os.path.exists(uBuntuPath):
4683-
command = "echo '%s:%s' | chpasswd" % (data['externalApp'], data['password'])
4683+
command = "echo '%s:%s' | chpasswd" % (website.externalApp, data['password'])
46844684
else:
4685-
command = 'echo "%s" | passwd --stdin %s' % (data['password'], data['externalApp'])
4685+
command = 'echo "%s" | passwd --stdin %s' % (data['password'], website.externalApp)
46864686

46874687
ProcessUtilities.executioner(command)
46884688

4689-
data_ret = {'status': 1, 'error_message': 'None'}
4689+
data_ret = {'status': 1, 'error_message': 'None', 'LinuxUser': website.externalApp}
46904690
json_data = json.dumps(data_ret)
46914691
return HttpResponse(json_data)
46924692

0 commit comments

Comments
 (0)