From b16506c8bcb8301d4a9de8a84dde083470e88366 Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 23 Oct 2022 14:07:18 +0800 Subject: [PATCH] =?UTF-8?q?#211=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit phpmyadmin安全设置处修改端口保存后当前用修改后的端口能打开,一旦停止phpmyadmin后,再重启phpmyadmin端口又变为888,需要手工再次改变 --- plugins/phpmyadmin/index.html | 5 +++-- plugins/phpmyadmin/index.py | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/phpmyadmin/index.html b/plugins/phpmyadmin/index.html index ab22e74d6..7e064260d 100755 --- a/plugins/phpmyadmin/index.html +++ b/plugins/phpmyadmin/index.html @@ -17,6 +17,7 @@ \ No newline at end of file diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index 52b3333b2..e65a35a53 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -124,6 +124,10 @@ def contentReplace(content): content = content.replace('{$CHOOSE_DB}', 'MariaDB') content = content.replace('{$CHOOSE_DB_DIR}', 'mariadb') + port = cfg["port"] + rep = 'listen\s*(.*);' + content = re.sub(rep, "listen " + port + ';', content) + return content @@ -284,6 +288,8 @@ def setPmaPort(): rep = 'listen\s*(.*);' content = re.sub(rep, "listen " + port + ';', content) mw.writeFile(file, content) + + setCfg("port", port) mw.restartWeb() return mw.returnJson(True, '修改成功!')