Unverified Commit 97bff03f authored by Medicean's avatar Medicean Committed by GitHub

Merge pull request #275 from Ch1ngg/v2.1.x

fix #271
parents b30ef6c2 b70b348f
......@@ -10,8 +10,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$port=explode(":",$hst)[1];
$hst=explode(":",$hst)[0];
list($hst, $port) = split(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
$q=@mysqli_query($T,"SHOW DATABASES");
while($rs=@mysqli_fetch_row($q)){
......@@ -29,8 +29,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$port=explode(":",$hst)[1];
$hst=explode(":",$hst)[0];
list($hst, $port) = split(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
$q=@mysqli_query($T, "SHOW TABLES FROM \`{$dbn}\`");
while($rs=@mysqli_fetch_row($q)){
......@@ -50,8 +50,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
$port=explode(":",$hst)[1];
$hst=explode(":",$hst)[0];
list($hst, $port) = split(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
@mysqli_select_db($T, $dbn);
$q=@mysqli_query($T, "SHOW COLUMNS FROM \`{$tab}\`");
......@@ -73,8 +73,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$port=explode(":",$hst)[1];
$hst=explode(":",$hst)[0];
list($hst, $port) = split(":", $hst);
$port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port);
@mysqli_query($T,"SET NAMES $_POST[${arg6}]");
@mysqli_select_db($T,$dbn);
......
......@@ -10,11 +10,16 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
list($host,$port,$dbn) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$dbn == "" ? $dbn = "postgres" : $dbn;
$arr=array(
'host'=>explode(':',$hst)[0],
'port'=>explode(':',$hst)[1],
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn
);
$cs='';
foreach($arr as $k=>$v) {
......@@ -49,9 +54,12 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>explode(':',$hst)[0],
'port'=>explode(':',$hst)[1],
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
......@@ -91,9 +99,12 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>explode(':',$hst)[0],
'port'=>explode(':',$hst)[1],
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
......@@ -136,9 +147,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>explode(':',$hst)[0],
'port'=>explode(':',$hst)[1],
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
......
......@@ -10,11 +10,14 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$host=explode(':',$hst)[0];
$port=explode(':',$hst)[1];
list($host, $port,$dbn) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$dbn == "" ? $dbn = "postgres" : $dbn;
$arr=array(
'host'=>$host,
'port'=>$port,
'dbname'=>$dbn
);
$cs='pgsql:';
foreach($arr as $k=>$v) {
......@@ -46,8 +49,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$host=explode(':',$hst)[0];
$port=explode(':',$hst)[1];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
......@@ -85,8 +88,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
$host=explode(':',$hst)[0];
$port=explode(':',$hst)[1];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
......@@ -127,8 +130,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
$host=explode(':',$hst)[0];
$port=explode(':',$hst)[1];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
......
/**
* 数据库管理模板::sqlsrv
* php >= 5.3 原生不支持 mssql, 可 sqlsrv 连接 sqlserver
* php >= 5.3 原生不支持 mssql, 可采用 sqlsrv 连接 sqlserver
* i 数据分隔符号 => \t|\t
*/
......
......@@ -412,9 +412,15 @@ class PHP {
})
break;
case 'postgresql':
form.setFormData({
host: 'localhost:5432:postgres',
user: 'postgres',
passwd: '',
});
break;
case 'postgresql_pdo':
form.setFormData({
host: 'localhost:5432',
host: 'localhost:5432:postgres',
user: 'postgres',
passwd: '',
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment