pull/701/head
Mr Chen 3 months ago
parent f1f98b2624
commit 4321c0e6b3
  1. 39
      plugins/lam/conf/config.cfg
  2. 0
      plugins/lam/conf/config.php
  3. 39
      plugins/lam/index.py
  4. 31
      plugins/phpldapadmin/index.py

@ -0,0 +1,39 @@
{
"password": "{CRYPT-SHA512}$6$WheNHdlVwDoL4s.x$DrZ10TpIGQa5wd0jbvtm8eaTleJCf1nec3ihOaNwMdPUKVFCphXwtnTSmFFXjhGa45RlrSEWhDVyjLCMiV\/.c. V2hlTkhkbFZ3RG9MNHMueA==",
"default": "lam",
"sessionTimeout": "30",
"hideLoginErrorDetails": "false",
"logLevel": "4",
"logDestination": "SYSLOG",
"allowedHosts": "",
"passwordMinLength": "10",
"passwordMinUpper": "0",
"passwordMinLower": "0",
"passwordMinNumeric": "0",
"passwordMinClasses": "0",
"passwordMinSymbol": "0",
"checkedRulesCount": "-1",
"passwordMustNotContainUser": "false",
"passwordMustNotContain3Chars": "false",
"externalPwdCheckUrl": "",
"errorReporting": "default",
"allowedHostsSelfService": "",
"license": "",
"licenseEmailFrom": "",
"licenseEmailTo": "",
"licenseWarningType": "all",
"licenseEmailDateSent": "",
"mailServer": "",
"mailUser": "",
"mailPassword": "",
"mailEncryption": "TLS",
"mailAttribute": "mail",
"mailBackupAttribute": "passwordselfresetbackupmail",
"configDatabaseType": "files",
"configDatabaseServer": "",
"configDatabasePort": "",
"configDatabaseName": "",
"configDatabaseUser": "",
"configDatabasePassword": "",
"moduleSettings": "eyJyZXF1ZXN0QWNjZXNzIjp7Imhpc3RvcnlSZXRlbnRpb25QZXJpb2QiOiIzNjUwIiwiZXhwaXJhdGlvblBlcmlvZCI6IjMwIn19"
}

@ -62,7 +62,7 @@ def getConf():
def getConfInc(): def getConfInc():
return getServerDir() + "/" + getCfg()['path'] + '/config/config.php' return getServerDir() + "/" + getCfg()['path'] + '/config/config.cfg'
def getPort(): def getPort():
@ -172,7 +172,7 @@ def returnCfg():
def status(): def status():
conf = getConf() conf = getConf()
conf_inc = getServerDir() + "/" + getCfg()["path"] + '/config/config.php' conf_inc = getServerDir() + "/" + getCfg()["path"] + '/config/config.cfg'
# 两个文件都在,才算启动成功 # 两个文件都在,才算启动成功
if os.path.exists(conf) and os.path.exists(conf_inc): if os.path.exists(conf) and os.path.exists(conf_inc):
return 'start' return 'start'
@ -251,9 +251,9 @@ def start():
os.mkdir(tmp) os.mkdir(tmp)
mw.execShell("chown -R www:www " + tmp) mw.execShell("chown -R www:www " + tmp)
conf_run = getServerDir() + "/" + getCfg()["path"] + '/config/config.php' conf_run = getServerDir() + "/" + getCfg()["path"] + '/config/config.cfg'
if not os.path.exists(conf_run): if not os.path.exists(conf_run):
conf_tpl = getPluginDir() + '/conf/config.php' conf_tpl = getPluginDir() + '/conf/config.cfg'
centent = mw.readFile(conf_tpl) centent = mw.readFile(conf_tpl)
centent = contentReplace(centent) centent = contentReplace(centent)
mw.writeFile(conf_run, centent) mw.writeFile(conf_run, centent)
@ -425,35 +425,6 @@ def errorLog():
def installVersion(): def installVersion():
return mw.readFile(getServerDir() + '/version.pl') return mw.readFile(getServerDir() + '/version.pl')
def pluginsDbSupport():
data = {}
data['installed'] = 'no'
install_path = getServerDir()
if not os.path.exists(install_path):
return mw.returnJson(True, 'ok', data)
data['installed'] = 'ok'
data['status'] = status()
if (data['status'] == 'stop'):
return mw.returnJson(True, 'ok', data)
data['cfg'] = getCfg()
port = getPort()
ip = '127.0.0.1'
if not mw.isAppleSystem():
ip = thisdb.getOption('server_ip')
cfg = data['cfg']
auth = cfg['username']+':'+cfg['password']
rand_path = cfg['path']
home_page = 'http://' + auth + '@' + ip + ':' + port + '/' + rand_path + '/index.php'
data['home_page'] = home_page
data['version'] = installVersion().strip()
return mw.returnJson(True, 'ok', data)
if __name__ == "__main__": if __name__ == "__main__":
func = sys.argv[1] func = sys.argv[1]
if func == 'status': if func == 'status':
@ -496,7 +467,5 @@ if __name__ == "__main__":
print(accessLog()) print(accessLog())
elif func == 'error_log': elif func == 'error_log':
print(errorLog()) print(errorLog())
elif func == 'plugins_db_support':
print(pluginsDbSupport())
else: else:
print('error') print('error')

@ -422,35 +422,6 @@ def errorLog():
def installVersion(): def installVersion():
return mw.readFile(getServerDir() + '/version.pl') return mw.readFile(getServerDir() + '/version.pl')
def pluginsDbSupport():
data = {}
data['installed'] = 'no'
install_path = getServerDir()
if not os.path.exists(install_path):
return mw.returnJson(True, 'ok', data)
data['installed'] = 'ok'
data['status'] = status()
if (data['status'] == 'stop'):
return mw.returnJson(True, 'ok', data)
data['cfg'] = getCfg()
port = getPort()
ip = '127.0.0.1'
if not mw.isAppleSystem():
ip = thisdb.getOption('server_ip')
cfg = data['cfg']
auth = cfg['username']+':'+cfg['password']
rand_path = cfg['path']
home_page = 'http://' + auth + '@' + ip + ':' + port + '/' + rand_path + '/index.php'
data['home_page'] = home_page
data['version'] = installVersion().strip()
return mw.returnJson(True, 'ok', data)
if __name__ == "__main__": if __name__ == "__main__":
func = sys.argv[1] func = sys.argv[1]
if func == 'status': if func == 'status':
@ -493,7 +464,5 @@ if __name__ == "__main__":
print(accessLog()) print(accessLog())
elif func == 'error_log': elif func == 'error_log':
print(errorLog()) print(errorLog())
elif func == 'plugins_db_support':
print(pluginsDbSupport())
else: else:
print('error') print('error')

Loading…
Cancel
Save