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