From fd23a4c572b7c17f95c2737a9969c829f8a0a395 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 18:22:21 +0800 Subject: [PATCH] =?UTF-8?q?phpmysqladmin=E4=BF=9D=E5=AD=98=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/phpmyadmin/index.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index 5b11ad07d..e843b7dcb 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -124,7 +124,8 @@ def contentReplace(content): content = content.replace('{$BLOWFISH_SECRET}', blowfish_secret) cfg = getCfg() - if (cfg['choose'] == ""): + + if (cfg['choose'] == "mysql"): content = content.replace('{$CHOOSE_DB}', 'mysql') content = content.replace('{$CHOOSE_DB_DIR}', 'mysql') else: @@ -136,7 +137,6 @@ def contentReplace(content): port = cfg["port"] rep = 'listen\s*(.*);' content = re.sub(rep, "listen " + port + ';', content) - return content @@ -327,11 +327,13 @@ def setPmaChoose(): choose = args['choose'] setCfg('choose', choose) - conf_run = getServerDir() + '/phpmyadmin/config.inc.php' + pma_path = getCfg()['path'] + conf_run = getServerDir() + "/" + pma_path + '/config.inc.php' + conf_tpl = getPluginDir() + '/conf/config.inc.php' - centent = mw.readFile(conf_tpl) - centent = contentReplace(centent) - mw.writeFile(conf_run, centent) + content = mw.readFile(conf_tpl) + content = contentReplace(content) + mw.writeFile(conf_run, content) mw.restartWeb() return mw.returnJson(True, '修改成功!')