diff --git a/baseTemplate/static/baseTemplate/custom-js/system-status.js b/baseTemplate/static/baseTemplate/custom-js/system-status.js index 2d649e608..656bc8003 100644 --- a/baseTemplate/static/baseTemplate/custom-js/system-status.js +++ b/baseTemplate/static/baseTemplate/custom-js/system-status.js @@ -137,6 +137,7 @@ app.controller('adminController', function($scope,$http,$timeout) { $("#remoteBackups").hide(); $("#packageHome").hide(); $("#packageSub").hide(); + $("#createWebsite").hide(); } } diff --git a/baseTemplate/views.py b/baseTemplate/views.py index e59330cce..e61320243 100644 --- a/baseTemplate/views.py +++ b/baseTemplate/views.py @@ -46,12 +46,16 @@ def getAdminStatus(request): else: admin_type = "Normal User" - serverIPAddress = "192.168.100.1" + # read server IP try: - serverIPAddress = requests.get('https://api.ipify.org').text - except: - pass + ipFile = "/etc/cyberpanel/machineIP" + f = open(ipFile) + ipData = f.read() + serverIPAddress = ipData.split('\n', 1)[0] + except BaseException,msg: + logging.CyberCPLogFileWriter.writeToFile("Failed to read machine IP, error:" +str(msg)) + serverIPAddress = "192.168.100.1" adminName = administrator.firstName + " " + administrator.lastName diff --git a/dns/views.py b/dns/views.py index ddfd64307..2a25070e7 100644 --- a/dns/views.py +++ b/dns/views.py @@ -259,10 +259,14 @@ def addDeleteDNSRecords(request): admin = Administrator.objects.get(pk=val) domainsList = [] - domains = Domains.objects.all() - - for items in domains: - domainsList.append(items.name) + if admin.type == 1: + domains = Domains.objects.all() + for items in domains: + domainsList.append(items.name) + else: + domains = admin.domains_set.all() + for items in domains: + domainsList.append(items.name) return render(request, 'dns/addDeleteDNSRecords.html',{"domainsList":domainsList}) diff --git a/install/install.py b/install/install.py index 8289e7366..e90263a7d 100644 --- a/install/install.py +++ b/install/install.py @@ -2381,6 +2381,14 @@ def main(): logging.InstallLog.writeToFile("Starting CyberPanel installation..") preFlightsChecks.stdOut("Starting CyberPanel installation..") + ## Writing public IP + + os.mkdir("/etc/cyberpanel") + + machineIP = open("/etc/cyberpanel/machineIP", "w") + machineIP.writelines(args.publicip) + machineIP.close() + cwd = os.getcwd() checks = preFlightsChecks("/usr/local/lsws/",args.publicip,"/usr/local",cwd,"/usr/local/CyberCP") diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 3d2d422e7..66bdf8f06 100644 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -1128,8 +1128,6 @@ def Main(cwd): InstallCyberPanel.mysql_Root_password = randomPassword.generate_pass() - os.mkdir("/etc/cyberpanel") - password = open("/etc/cyberpanel/mysqlPassword","w") password.writelines(InstallCyberPanel.mysql_Root_password) diff --git a/static/baseTemplate/custom-js/system-status.js b/static/baseTemplate/custom-js/system-status.js index 2d649e608..656bc8003 100644 --- a/static/baseTemplate/custom-js/system-status.js +++ b/static/baseTemplate/custom-js/system-status.js @@ -137,6 +137,7 @@ app.controller('adminController', function($scope,$http,$timeout) { $("#remoteBackups").hide(); $("#packageHome").hide(); $("#packageSub").hide(); + $("#createWebsite").hide(); } } diff --git a/websiteFunctions/templates/websiteFunctions/listWebsites.html b/websiteFunctions/templates/websiteFunctions/listWebsites.html index e62653e8a..20417f5fb 100644 --- a/websiteFunctions/templates/websiteFunctions/listWebsites.html +++ b/websiteFunctions/templates/websiteFunctions/listWebsites.html @@ -27,6 +27,7 @@