PMC-1117
This commit is contained in:
@@ -108,9 +108,8 @@ if (isset($request)) {
|
|||||||
$aRows = [];
|
$aRows = [];
|
||||||
try {
|
try {
|
||||||
$con = Propel::getConnection($bdUid);
|
$con = Propel::getConnection($bdUid);
|
||||||
$con->begin();
|
$stmt = $con->createStatement();
|
||||||
$rs = $con->executeQuery($sqlQuery);
|
$rs = $stmt->executeQuery($sqlQuery, \ResultSet::FETCHMODE_NUM);
|
||||||
$con->commit();
|
|
||||||
|
|
||||||
while ($rs->next()) {
|
while ($rs->next()) {
|
||||||
array_push($aRows, $rs->getRow());
|
array_push($aRows, $rs->getRow());
|
||||||
|
|||||||
@@ -1010,7 +1010,7 @@ class database extends database_base
|
|||||||
public function tableExists($tableName, $database)
|
public function tableExists($tableName, $database)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$result = DB::connect($this->getNameConnection())
|
$result = DB::connection($this->getNameConnection())
|
||||||
->select("show tables like '$tableName'");
|
->select("show tables like '$tableName'");
|
||||||
$flag = count($result) > 0;
|
$flag = count($result) > 0;
|
||||||
|
|
||||||
|
|||||||
@@ -155,39 +155,6 @@ if (! (isset( $fields->Fields['XMLNODE_NAME'] ) && ($fields->Fields['XMLNODE_NAM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type == 'suggest' && isset( $Fields['PME_SQLCONNECTION'] ) && $Fields['PME_SQLCONNECTION'] != '') {
|
|
||||||
//define the dbArray with the table fields
|
|
||||||
//g::pr($Fields);
|
|
||||||
|
|
||||||
|
|
||||||
$tableExists = true;
|
|
||||||
$sDataBase = 'database_' . strtolower( DB_ADAPTER );
|
|
||||||
if (G::LoadSystemExist( $sDataBase )) {
|
|
||||||
|
|
||||||
$oDataBase = new database();
|
|
||||||
$dataBase = $Fields['PME_SQLCONNECTION'];
|
|
||||||
if ($Fields['PME_SQLCONNECTION'] == 'workflow') {
|
|
||||||
$dataBase = DB_NAME;
|
|
||||||
}
|
|
||||||
$tableExists = $oDataBase->tableExists( 'USERS', $dataBase );
|
|
||||||
}
|
|
||||||
if ($tableExists) {
|
|
||||||
$con = Propel::getConnection( $Fields['PME_SQLCONNECTION'] );
|
|
||||||
if ($Fields['PME_SQLCONNECTION'] == 'rbac') {
|
|
||||||
$rs = $con->executeQuery( "SHOW COLUMNS FROM RBAC_USERS" );
|
|
||||||
} else {
|
|
||||||
$rs = $con->executeQuery( "SHOW COLUMNS FROM USERS" );
|
|
||||||
}
|
|
||||||
$result = Array ();
|
|
||||||
$i = 0;
|
|
||||||
while ($rs->next()) {
|
|
||||||
$result[$i ++] = $rs->getRow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//g::pr($result);
|
|
||||||
|
|
||||||
|
|
||||||
if (isset( $Fields['PME_HINT'] )) {
|
if (isset( $Fields['PME_HINT'] )) {
|
||||||
$Fields['PME_HINT'] = stripslashes( $Fields['PME_HINT'] );
|
$Fields['PME_HINT'] = stripslashes( $Fields['PME_HINT'] );
|
||||||
$Fields['PME_HINT'] = htmlspecialchars_decode( $Fields['PME_HINT'] );
|
$Fields['PME_HINT'] = htmlspecialchars_decode( $Fields['PME_HINT'] );
|
||||||
|
|||||||
Reference in New Issue
Block a user