mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -36,7 +36,7 @@ enable_dl = Off
|
||||
|
||||
|
||||
file_uploads = On
|
||||
upload_tmp_dir = "MD:/bin/tmp/upload"
|
||||
upload_tmp_dir = "/tmp/upload"
|
||||
upload_max_filesize = 2M
|
||||
max_file_uploads = 20
|
||||
|
||||
@@ -153,7 +153,7 @@ bcmath.scale = 0
|
||||
|
||||
[Session]
|
||||
session.save_handler = files
|
||||
session.save_path = "MD:/bin/tmp/session"
|
||||
session.save_path = "/tmp/session"
|
||||
session.use_strict_mode = 0
|
||||
session.use_cookies = 1
|
||||
session.use_only_cookies = 1
|
||||
|
||||
@@ -37,6 +37,7 @@ cd $sourcePath/php/php-7.2.5 && ./configure \
|
||||
--exec-prefix=$serverPath/php/72 \
|
||||
--with-config-file-path=$serverPath/php/72/etc \
|
||||
--with-zlib-dir=$serverPath/lib/zlib \
|
||||
--enable-mysqlnd \
|
||||
--without-iconv \
|
||||
--enable-zip \
|
||||
--enable-mbstring \
|
||||
|
||||
@@ -23,5 +23,5 @@ server
|
||||
deny all;
|
||||
}
|
||||
|
||||
access_log off;
|
||||
access_log {$SERVER_PATH}/phpmyadmin/access.log;
|
||||
}
|
||||
@@ -4,8 +4,8 @@
|
||||
<p class="bgw" onclick="pluginService('phpmyadmin');">服务</p>
|
||||
<p onclick="pluginConfig('phpmyadmin');">重写模版</p>
|
||||
<p onclick="homePage()">主页</p>
|
||||
<p onclick="">PHP版本</p>
|
||||
<p onclick="">安全设置</p>
|
||||
<p onclick="phpVer(56)">PHP版本</p>
|
||||
<p onclick="safeConf();">安全设置</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
|
||||
@@ -133,6 +133,33 @@ def reload():
|
||||
return start()
|
||||
|
||||
|
||||
def setPhpVer():
|
||||
args = getArgs()
|
||||
|
||||
if not 'phpver' in args:
|
||||
return 'phpver missing'
|
||||
|
||||
cacheFile = getServerDir() + '/php.pl'
|
||||
public.writeFile(cacheFile, args['phpver'])
|
||||
restart()
|
||||
|
||||
return 'ok'
|
||||
|
||||
|
||||
def getSetPhpVer():
|
||||
cacheFile = getServerDir() + '/php.pl'
|
||||
if os.path.exists(cacheFile):
|
||||
return public.readFile(cacheFile).strip()
|
||||
return ''
|
||||
|
||||
|
||||
def getPmaPort():
|
||||
try:
|
||||
port = getPort()
|
||||
return public.returnJson(True, 'OK', port)
|
||||
except Exception as e:
|
||||
return public.returnJson(False, '插件未启动!')
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
@@ -149,5 +176,11 @@ if __name__ == "__main__":
|
||||
print getConf()
|
||||
elif func == 'get_home_page':
|
||||
print getHomePage()
|
||||
elif func == 'set_php_ver':
|
||||
print setPhpVer()
|
||||
elif func == 'get_set_php_ver':
|
||||
print getSetPhpVer()
|
||||
elif func == 'get_pma_port':
|
||||
print getPmaPort()
|
||||
else:
|
||||
print 'error'
|
||||
|
||||
@@ -31,11 +31,21 @@ function pmaPost(method,args,callback){
|
||||
},'json');
|
||||
}
|
||||
|
||||
|
||||
function pmaAsyncPost(method,args){
|
||||
|
||||
var _args = null;
|
||||
if (typeof(args) == 'string'){
|
||||
_args = JSON.stringify(str2Obj(args));
|
||||
} else {
|
||||
_args = JSON.stringify(args);
|
||||
}
|
||||
return syncPost('/plugins/run', {name:'phpmyadmin', func:method, args:_args});
|
||||
}
|
||||
|
||||
function homePage(){
|
||||
pmaPost('get_home_page', '', function(data){
|
||||
console.log(data);
|
||||
var rdata = $.parseJSON(data.data);
|
||||
console.log(rdata);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
@@ -45,61 +55,84 @@ function homePage(){
|
||||
});
|
||||
}
|
||||
|
||||
//phpmyadmin安全设置
|
||||
function safeConf(name, port, auth) {
|
||||
var con = '<div class="ver line">\
|
||||
<span style="margin-right:10px">' + lan.soft.pma_port + '</span>\
|
||||
<input class="bt-input-text phpmyadmindk mr20" name="Name" id="pmport" value="' + port + '" placeholder="' + lan.soft.pma_port_title + '" maxlength="5" type="number">\
|
||||
<button class="btn btn-success btn-sm" onclick="phpmyadminport()">' + lan.public.save + '</button>\
|
||||
</div>\
|
||||
<div class="user_pw_tit">\
|
||||
<span class="tit">' + lan.soft.pma_pass + '</span>\
|
||||
<span class="btswitch-p"><input class="btswitch btswitch-ios" id="phpmyadminsafe" type="checkbox" ' + (auth ? 'checked' : '') + '>\
|
||||
<label class="btswitch-btn phpmyadmin-btn" for="phpmyadminsafe" onclick="phpmyadminSafe()"></label>\
|
||||
</span>\
|
||||
</div>\
|
||||
<div class="user_pw">\
|
||||
<p><span>' + lan.soft.pma_user + '</span><input id="username_get" class="bt-input-text" name="username_get" value="" type="text" placeholder="' + lan.soft.edit_empty + '"></p>\
|
||||
<p><span>' + lan.soft.pma_pass1 + '</span><input id="password_get_1" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\
|
||||
<p><span>' + lan.soft.pma_pass2 + '</span><input id="password_get_2" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\
|
||||
<p><button class="btn btn-success btn-sm" onclick="phpmyadmin(\'get\')">' + lan.public.save + '</button></p>\
|
||||
</div>\
|
||||
<ul class="help-info-text c7"><li>' + lan.soft.pma_ps + '</li></ul>';
|
||||
$(".soft-man-con").html(con);
|
||||
if (auth) {
|
||||
$(".user_pw").show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function phpVerChange(type, msg) {
|
||||
var data = type + '=' + $("#" + msg).val();
|
||||
var loadT = layer.msg(lan.public.the, { icon: 16, time: 0, shade: [0.3, '#000'] });
|
||||
$.post('/ajax?action=setPHPMyAdmin', data, function(rdata) {
|
||||
layer.closeAll();
|
||||
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
|
||||
if (rdata.status) {
|
||||
setTimeout(function() {
|
||||
window.location.reload();
|
||||
}, 3000);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//phpmyadmin切换php版本
|
||||
function phpVer(name, version) {
|
||||
$.post('/site?action=GetPHPVersion', function(rdata) {
|
||||
var body = "<div class='ver line'><span class='tname'>" + lan.soft.php_version + "</span><select id='get' class='bt-input-text mr20' name='phpVersion' style='width:110px'>";
|
||||
function phpVer(version) {
|
||||
|
||||
var _version = pmaAsyncPost('get_set_php_ver','')
|
||||
if (_version['data'] != ''){
|
||||
version = _version['data'];
|
||||
}
|
||||
|
||||
$.post('/site/get_php_version', function(rdata) {
|
||||
// console.log(rdata);
|
||||
var body = "<div class='ver line'><span class='tname'>PHP版本</span><select id='phpver' class='bt-input-text mr20' name='phpVersion' style='width:110px'>";
|
||||
var optionSelect = '';
|
||||
for (var i = 0; i < rdata.length; i++) {
|
||||
optionSelect = rdata[i].version == version ? 'selected' : '';
|
||||
body += "<option value='" + rdata[i].version + "' " + optionSelect + ">" + rdata[i].name + "</option>"
|
||||
}
|
||||
body += '</select><button class="btn btn-success btn-sm" onclick="phpVerChange(\'phpversion\',\'get\')">' + lan.public.save + '</button></div>';
|
||||
body += '</select><button class="btn btn-success btn-sm" onclick="phpVerChange(\'phpversion\',\'get\')">保存</button></div>';
|
||||
$(".soft-man-con").html(body);
|
||||
})
|
||||
},'json');
|
||||
}
|
||||
|
||||
function phpVerChange(type, msg) {
|
||||
var phpver = $("#phpver").val();
|
||||
pmaPost('set_php_ver', 'phpver='+phpver, function(data){
|
||||
if ( data.data == 'ok' ){
|
||||
layer.msg('设置成功!',{icon:1,time:2000,shade: [0.3, '#000']});
|
||||
} else {
|
||||
layer.msg('设置失败!',{icon:2,time:2000,shade: [0.3, '#000']});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//phpmyadmin安全设置
|
||||
function safeConf(name, auth) {
|
||||
var data = pmaAsyncPost('get_pma_port');
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var con = '<div class="ver line">\
|
||||
<span style="margin-right:10px">访问端口</span>\
|
||||
<input class="bt-input-text phpmyadmindk mr20" name="Name" id="pmport" value="' + rdata['data'] + '" placeholder="phpmyadmin访问端口" maxlength="5" type="number">\
|
||||
<button class="btn btn-success btn-sm" onclick="phpmyadminport()">保存</button>\
|
||||
</div>\
|
||||
<div class="user_pw_tit">\
|
||||
<span class="tit">密码访问</span>\
|
||||
<span class="btswitch-p"><input class="btswitch btswitch-ios" id="phpmyadminsafe" type="checkbox" ' + (auth ? 'checked' : '') + '>\
|
||||
<label class="btswitch-btn phpmyadmin-btn" for="phpmyadminsafe" onclick="phpmyadminSafe()"></label>\
|
||||
</span>\
|
||||
</div>\
|
||||
<div class="user_pw">\
|
||||
<p><span>授权账号</span><input id="username_get" class="bt-input-text" name="username_get" value="" type="text" placeholder="不修改请留空"></p>\
|
||||
<p><span>访问密码</span><input id="password_get_1" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="不修改请留空"></p>\
|
||||
<p><span>重复密码</span><input id="password_get_2" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="不修改请留空"></p>\
|
||||
<p><button class="btn btn-success btn-sm" onclick="phpmyadmin(\'get\')">保存</button></p>\
|
||||
</div>\
|
||||
<ul class="help-info-text c7"><li>为phpmyadmin增加一道访问安全锁</li></ul>';
|
||||
$(".soft-man-con").html(con);
|
||||
// if (auth) {
|
||||
// $(".user_pw").show();
|
||||
// }
|
||||
}
|
||||
|
||||
//phpmyadmin二级密码
|
||||
function phpmyadminSafe() {
|
||||
var stat = $("#phpmyadminsafe").prop("checked");
|
||||
if (stat) {
|
||||
$(".user_pw").hide();
|
||||
phpmyadmin('close');
|
||||
} else {
|
||||
$(".user_pw").show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//修改phpmyadmin端口
|
||||
function phpmyadminport() {
|
||||
var pmport = $("#pmport").val();
|
||||
@@ -115,17 +148,6 @@ function phpmyadminport() {
|
||||
});
|
||||
}
|
||||
|
||||
//phpmyadmin二级密码
|
||||
function phpmyadminSafe() {
|
||||
var stat = $("#phpmyadminsafe").prop("checked");
|
||||
if (stat) {
|
||||
$(".user_pw").hide();
|
||||
phpmyadmin('close');
|
||||
} else {
|
||||
$(".user_pw").show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//设置phpmyadmin二级密码
|
||||
function phpmyadmin(msg) {
|
||||
|
||||
Reference in New Issue
Block a user