Update mw.py

pull/583/head
Mr Chen 12 months ago
parent d931790dd3
commit 41f016050f
  1. 6
      class/core/mw.py

@ -1312,9 +1312,9 @@ def checkDomainPanel():
nconf = getServerDir() + "/web_conf/nginx/vhost/panel.conf" nconf = getServerDir() + "/web_conf/nginx/vhost/panel.conf"
if os.path.exists(nconf): if os.path.exists(nconf):
port = "80" port = "80"
if not domain:
return False
if domain:
client_ip = getClientIp() client_ip = getClientIp()
if client_ip in ['127.0.0.1', 'localhost', '::1']: if client_ip in ['127.0.0.1', 'localhost', '::1']:
return False return False
@ -1324,9 +1324,11 @@ def checkDomainPanel():
to = scheme + "://" + domain + ":" + str(port) to = scheme + "://" + domain + ":" + str(port)
# print(to) # print(to)
return redirect(to, code=302) return redirect(to, code=302)
return False return False
def createLinuxUser(user, group): def createLinuxUser(user, group):
execShell("groupadd {}".format(group)) execShell("groupadd {}".format(group))
execShell('useradd -s /sbin/nologin -g {} {}'.format(user, group)) execShell('useradd -s /sbin/nologin -g {} {}'.format(user, group))

Loading…
Cancel
Save