diff --git a/.gitignore b/.gitignore index 976524a46..b951fad8a 100755 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,3 @@ workflow/public_html/build-log.html temp.txt update.sh workflow/public_html/translations/ - diff --git a/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php b/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php index 0202cacb0..d3c8a05ee 100755 --- a/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php +++ b/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php @@ -198,8 +198,16 @@ class MySQLConnection extends ConnectionCommon implements Connection { } }//echo $sql . '

'; $result = @mysql_query($sql, $this->dblink); + if (!$result) { - throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql); + if (!defined('DEBUG_SQL')) { + define('DEBUG_SQL', 0); + } + if (DEBUG_SQL == 1) { + throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql); + } else { + throw new SQLException('It is not possible to execute the query. Please contact your system administrator'); + } } return new MySQLResultSet($this, $result, $fetchmode); } diff --git a/workflow/engine/classes/class.applications.php b/workflow/engine/classes/class.applications.php index 3ee6b6738..0e52eda6a 100755 --- a/workflow/engine/classes/class.applications.php +++ b/workflow/engine/classes/class.applications.php @@ -22,6 +22,14 @@ class Applications ) { $callback = isset($callback)? $callback : "stcCallback1001"; $dir = isset($dir)? $dir : "DESC"; + + if (isset($sort)) { + G::LoadClass('phpSqlParser'); + $parser = new PHPSQLParser($sort); + $sort = $parser->parsed; + $sort = $sort[''][0]; + } + $sort = isset($sort)? $sort : ""; $start = isset($start)? $start : "0"; $limit = isset($limit)? $limit : "25"; @@ -494,10 +502,10 @@ class Applications //execute the query $oDataset = AppCacheViewPeer::doSelectRS( $Criteria ); - + $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); -//g::pr($oDataset); + //g::pr($oDataset); $result = array (); $result['totalCount'] = $totalCount; $rows = array (); diff --git a/workflow/engine/classes/class.system.php b/workflow/engine/classes/class.system.php index c85d9692d..6b1d6085d 100755 --- a/workflow/engine/classes/class.system.php +++ b/workflow/engine/classes/class.system.php @@ -1107,8 +1107,10 @@ class System } // Workspace environment configuration - if (($wsConf = @parse_ini_file($wsIniFile)) !== false) { - $config = array_merge($config, $wsConf); + if (file_exists($wsIniFile) ) { + if (($wsConf = @parse_ini_file($wsIniFile)) !== false) { + $config = array_merge($config, $wsConf); + } } // validation debug config, only binary value is valid; debug = 1, to enable diff --git a/workflow/engine/classes/model/AdditionalTables.php b/workflow/engine/classes/model/AdditionalTables.php index 56b86815e..c34abc1ba 100755 --- a/workflow/engine/classes/model/AdditionalTables.php +++ b/workflow/engine/classes/model/AdditionalTables.php @@ -368,7 +368,7 @@ class AdditionalTables extends BaseAdditionalTables } } - public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true, $filter = '') + public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true, $filter = '', $appUid = false) { $addTab = new AdditionalTables(); $aData = $addTab->load($sUID, true); @@ -421,17 +421,17 @@ class AdditionalTables extends BaseAdditionalTables $closure = ''; $types = array('INTEGER', 'BIGINT', 'SMALLINT', 'TINYINT', 'DECIMAL', 'DOUBLE', 'FLOAT', 'REAL'); foreach ($aData['FIELDS'] as $aField) { - if ($aField['FLD_NAME'] != 'APP_UID') { - if (in_array($aField['FLD_TYPE'], $types)) { - if (is_numeric($filter)) { - $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';'; - $closure = '->addOr($a)'; - } - } else { - $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "%' . $filter . '%", Criteria::LIKE)' . $closure . ';'; - $closure = '->addOr($a)'; - } - } + if (($appUid == false && $aField['FLD_NAME'] != 'APP_UID') || ($appUid == true)) { + if (in_array($aField['FLD_TYPE'], $types)) { + if (is_numeric($filter)) { + $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';'; + $closure = '->addOr($a)'; + } + } else { + $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "%' . $filter . '%", Criteria::LIKE)' . $closure . ';'; + $closure = '->addOr($a)'; + } + } } $stringOr = $stringOr . '$oCriteria->add($a);'; eval($stringOr); diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index 7969a00a6..c7be5b04b 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -410,6 +410,7 @@ class pmTablesProxy extends HttpProxyController * @param string $httpData->id * @param string $httpData->start * @param string $httpData->limit + * @param string $httpData->appUid */ public function dataView ($httpData) { @@ -421,13 +422,14 @@ class pmTablesProxy extends HttpProxyController $limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20; $start = isset( $httpData->start ) ? $httpData->start : 0; $limit = isset( $httpData->limit ) ? $httpData->limit : $limit_size; + $appUid = isset( $httpData->appUid ) ? $httpData->appUid : false; + $appUid = ($appUid == "true") ? true : false; $filter = isset( $httpData->textFilter ) ? $httpData->textFilter : ''; - $additionalTables = new AdditionalTables(); $table = $additionalTables->load( $httpData->id, true ); if ($filter != '') { - $result = $additionalTables->getAllData( $httpData->id, $start, $limit, true, $filter); + $result = $additionalTables->getAllData( $httpData->id, $start, $limit, true, $filter, $appUid); } else { $result = $additionalTables->getAllData( $httpData->id, $start, $limit ); } diff --git a/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php b/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php index f960e6ea3..35dd69c51 100644 --- a/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php +++ b/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php @@ -208,7 +208,7 @@ class Server implements iAuthenticate $pmAccessToken = new \PmoauthUserAccessTokens(); $session = $pmAccessToken->getSessionData($token['ACCESS_TOKEN']); - if ($session !== false) { + if ($session !== false && array_key_exists($session->getSessionId(), $_COOKIE)) { // increase the timeout for local php session cookie $config = \Bootstrap::getSystemConfiguration(); diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index 6751d0d39..d9cfc1b19 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -76,6 +76,11 @@ Ext.onReady(function(){ handler: DoSearch }); + appUidSearch = new Ext.form.Checkbox ({ + id: 'appUidSearch', + boxLabel : 'Search also in the APP_UID field' + }); + contextMenu = new Ext.menu.Menu({ items : [ editButton, deleteButton ] }); @@ -386,6 +391,7 @@ Ext.onReady(function(){ importButton, exportButton, '->', + appUidSearch, searchText, clearTextButton, searchButton @@ -394,6 +400,7 @@ Ext.onReady(function(){ else tbar = [genDataReportButton, '->', + appUidSearch, searchText, clearTextButton, searchButton]; @@ -466,12 +473,13 @@ onMessageContextMenu = function (grid, rowIndex, e) { //Do Search Function DoSearch = function(){ infoGrid.store.setBaseParam('textFilter', searchText.getValue()); - infoGrid.store.load({params: {start : 0 , limit : pageSize }}); + infoGrid.store.load({params: {start : 0 , limit : pageSize , appUid : appUidSearch.getValue() }}); }; //Load Grid By Default GridByDefault = function(){ searchText.reset(); + appUidSearch.reset(); infoGrid.store.setBaseParam('textFilter', searchText.getValue()); infoGrid.store.load(); }; diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 8e343fd34..66c9a1c6f 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -313,6 +313,7 @@ ini_set( 'soap.wsdl_cache_enabled', $config['wsdl_cache'] ); ini_set( 'date.timezone', $config['time_zone'] ); define( 'DEBUG_SQL_LOG', $config['debug_sql'] ); +define( 'DEBUG_SQL', $config['debug'] ); define( 'DEBUG_TIME_LOG', $config['debug_time'] ); define( 'DEBUG_CALENDAR_LOG', $config['debug_calendar'] ); define( 'MEMCACHED_ENABLED', $config['memcached'] );