diff --git a/gulliver/thirdparty/creole/drivers/mssql/MSSQLConnection.php b/gulliver/thirdparty/creole/drivers/mssql/MSSQLConnection.php index 688eb48bd..0c3e1db2c 100755 --- a/gulliver/thirdparty/creole/drivers/mssql/MSSQLConnection.php +++ b/gulliver/thirdparty/creole/drivers/mssql/MSSQLConnection.php @@ -69,11 +69,28 @@ class MSSQLConnection extends ConnectionCommon implements Connection { $pw = $dsninfo['password']; $dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost'; + /** + * MSSQL (http://php.net/manual/en/intro.mssql.php) + * These functions allow you to access MS SQL Server database. + * This extension is not available anymore on Windows with PHP 5.3 or later. + * SQLSRV, an alternative extension for MS SQL connectivity is available from + * Microsoft: » http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. + * http://blogs.msdn.com/b/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx + * + * Alternatively to use the mssql functions in Windows, use php_dblib.dll (FreeTDS) http://www.freetds.org/ + * e.g. php.ini setting + * extension=php_dblib.dll + * + * php_dblib.dll (FreeTDS) use ':' as the delimiter in all installations. + */ + /* if (PHP_OS == "WINNT" || PHP_OS == "WIN32") { $portDelimiter = ","; } else { $portDelimiter = ":"; } + */ + $portDelimiter = ":"; if(!empty($dsninfo['port'])) { $dbhost .= $portDelimiter.$dsninfo['port']; diff --git a/workflow/engine/classes/class.dbConnections.php b/workflow/engine/classes/class.dbConnections.php index ec4ac1aa7..462932612 100755 --- a/workflow/engine/classes/class.dbConnections.php +++ b/workflow/engine/classes/class.dbConnections.php @@ -136,10 +136,13 @@ class dbConnections /** * getConnectionsProUid * - * @param string $pType + * Parameter $only list of items displayed, everything else is ignored. + * + * @param string $pProUid + * @param string $only * @return Array $connections */ - public function getConnectionsProUid ($pProUid) + public function getConnectionsProUid ($pProUid, $only = array()) { $connections = Array (); $c = new Criteria(); @@ -155,8 +158,9 @@ class dbConnections $result->next(); $row = $result->getRow(); + $sw = count($only) > 0; while ($row = $result->getRow()) { - if ((trim( $pProUid ) == trim( $row[1] )) && ($row[2] == 'mysql')) { + if ((trim( $pProUid ) == trim( $row[1] )) && ( $sw ? in_array($row[2], $only) : true )) { $connections[] = Array ('DBS_UID' => $row[0],'DBS_NAME' => '[' . $row[3] . '] ' . $row[2] . ': ' . $row[4] ); } diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index d7def0d0b..577daadab 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -116,7 +116,7 @@ class pmTablesProxy extends HttpProxyController G::LoadClass( 'dbConnections' ); $proUid = $_POST['PRO_UID']; $dbConn = new DbConnections(); - $dbConnections = $dbConn->getConnectionsProUid( $proUid ); + $dbConnections = $dbConn->getConnectionsProUid( $proUid, array('mysql') ); $workSpace = new workspaceTools(SYS_SYS); $workspaceDB = $workSpace->getDBInfo();