Merged colosa/processmaker into master

This commit is contained in:
Quenta Ronald
2015-04-13 13:20:56 -04:00
13 changed files with 243 additions and 52 deletions

View File

@@ -2634,6 +2634,20 @@ class G
$oldumask = umask( 0 ); $oldumask = umask( 0 );
if (! is_dir( $path )) { if (! is_dir( $path )) {
G::verifyPath( $path, true ); G::verifyPath( $path, true );
}
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$file = str_replace("\\\\","\\",$file,$count);
if(!$count) {
$winPath = explode("\\",$file);
$file = "";
foreach($winPath as $k => $v){
if($v != "") {
$file.= $v."\\";
}
}
$file = substr($file,0,-1);
}
} }
G::LoadSystem('inputfilter'); G::LoadSystem('inputfilter');

View File

@@ -2868,4 +2868,30 @@ function PMFRemoveMask ($field, $separator = '.', $currency = '')
$field = floatval(trim($field)); $field = floatval(trim($field));
return $field; return $field;
}
/**
*@method
*
* Sends an array of case variables to a specified case.
*
* @name PMFSaveCurrentData
* @label PMF Save Current Data
*
* @return int | $result | Result of send variables | Returns 1 if the variables were sent successfully to the case; otherwise, returns 0 if an error occurred.
*
*/
function PMFSaveCurrentData ()
{
global $oPMScript;
$result = 0;
if (isset($_SESSION['APPLICATION']) && isset($oPMScript->aFields)) {
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$result = $ws->sendVariables( $_SESSION['APPLICATION'], $oPMScript->aFields );
}
return $result;
} }

View File

@@ -1012,9 +1012,11 @@ class wsBase
* *
* @param string $caseId * @param string $caseId
* @param string $iDelIndex * @param string $iDelIndex
* @param bool $flagUseDelIndex
*
* @return $result will return an object * @return $result will return an object
*/ */
public function getCaseInfo ($caseId, $iDelIndex) public function getCaseInfo($caseId, $iDelIndex, $flagUseDelIndex = false)
{ {
try { try {
$oCase = new Cases(); $oCase = new Cases();
@@ -1060,7 +1062,12 @@ class wsBase
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE); $oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE); $oCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$oCriteria->add( AppDelegationPeer::APP_UID, $caseId ); $oCriteria->add( AppDelegationPeer::APP_UID, $caseId );
$oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
if ($flagUseDelIndex) {
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $iDelIndex, Criteria::EQUAL);
} else {
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
}
$oCriteria->addAscendingOrderByColumn( AppDelegationPeer::DEL_INDEX ); $oCriteria->addAscendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria ); $oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
@@ -3308,3 +3315,4 @@ class wsBase
} }
} }
} }

View File

@@ -431,40 +431,51 @@ class Cases
throw (new \Exception($arrayData)); throw (new \Exception($arrayData));
} }
} else { } else {
\G::LoadClass("wsBase");
//Verify data
$this->throwExceptionIfNotExistsCase($applicationUid, $this->getFieldNameByFormatFieldName("APP_UID"));
$criteria = new \Criteria("workflow"); $criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\AppCacheViewPeer::DEL_INDEX);
$criteria->add(\AppCacheViewPeer::USR_UID, $userUid); $criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
$criteria->add(\AppCacheViewPeer::APP_UID, $applicationUid); $criteria->add(\AppDelegationPeer::APP_UID, $applicationUid);
$criteria->add( $criteria->add(\AppDelegationPeer::USR_UID, $userUid);
//ToDo - getToDo()
$criteria->getNewCriterion(\AppCacheViewPeer::APP_STATUS, "TO_DO", \CRITERIA::EQUAL)->addAnd( $rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
$criteria->getNewCriterion(\AppCacheViewPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL))->addAnd(
$criteria->getNewCriterion(\AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd( if (!$rsCriteria->next()) {
$criteria->getNewCriterion(\AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN")) throw new \Exception(\G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED"));
)->addOr(
//Draft - getDraft()
$criteria->getNewCriterion(\AppCacheViewPeer::APP_STATUS, "DRAFT", \CRITERIA::EQUAL)->addAnd(
$criteria->getNewCriterion(\AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(\AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN"))
);
$criteria->addDescendingOrderByColumn(\AppCacheViewPeer::APP_NUMBER);
$rsCriteria = \AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$row["DEL_INDEX"] = '';
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
} }
\G::LoadClass('wsBase');
//Get data
$arrayStatusInfo = $this->getStatusInfo($applicationUid);
$applicationStatus = "";
$delIndex = 0;
$flagUseDelIndex = false;
if (count($arrayStatusInfo) > 0) {
$applicationStatus = $arrayStatusInfo["APP_STATUS"];
$delIndex = $arrayStatusInfo["DEL_INDEX"];
if (in_array($applicationStatus, array("DRAFT", "PAUSED", "CANCELLED"))) {
$flagUseDelIndex = true;
}
}
$ws = new \wsBase(); $ws = new \wsBase();
$fields = $ws->getCaseInfo($applicationUid, $row["DEL_INDEX"]);
$fields = $ws->getCaseInfo($applicationUid, $delIndex, $flagUseDelIndex);
$array = json_decode(json_encode($fields), true); $array = json_decode(json_encode($fields), true);
if ($array ["status_code"] != 0) { if ($array ["status_code"] != 0) {
throw (new \Exception($array ["message"])); throw (new \Exception($array ["message"]));
} else { } else {
$array['app_uid'] = $array['caseId']; $array['app_uid'] = $array['caseId'];
$array['app_number'] = $array['caseNumber']; $array['app_number'] = $array['caseNumber'];
$array['app_name'] = $array['caseName']; $array['app_name'] = $array['caseName'];
$array['app_status'] = $array['caseStatus']; $array["app_status"] = ($applicationStatus != "")? $applicationStatus : $array["caseStatus"];
$array['app_init_usr_uid'] = $array['caseCreatorUser']; $array['app_init_usr_uid'] = $array['caseCreatorUser'];
$array['app_init_usr_username'] = trim($array['caseCreatorUserName']); $array['app_init_usr_username'] = trim($array['caseCreatorUserName']);
$array['pro_uid'] = $array['processId']; $array['pro_uid'] = $array['processId'];
@@ -472,6 +483,9 @@ class Cases
$array['app_create_date'] = $array['createDate']; $array['app_create_date'] = $array['createDate'];
$array['app_update_date'] = $array['updateDate']; $array['app_update_date'] = $array['updateDate'];
$array['current_task'] = $array['currentUsers']; $array['current_task'] = $array['currentUsers'];
$aCurrent_task = array();
for ($i = 0; $i<=count($array['current_task'])-1; $i++) { for ($i = 0; $i<=count($array['current_task'])-1; $i++) {
$current_task = $array['current_task'][$i]; $current_task = $array['current_task'][$i];
$current_task['usr_uid'] = $current_task['userId']; $current_task['usr_uid'] = $current_task['userId'];
@@ -2217,4 +2231,108 @@ class Cases
throw $e; throw $e;
} }
} }
/**
* Get status info Case
*
* @param string $applicationUid Unique id of Case
*
* return array Return an array with status info Case, array empty otherwise
*/
public function getStatusInfo($applicationUid)
{
try {
//Verify data
$this->throwExceptionIfNotExistsCase($applicationUid, $this->getFieldNameByFormatFieldName("APP_UID"));
//Get data
//Status is PAUSED
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn($delimiter . "PAUSED" . $delimiter . " AS APP_STATUS");
$criteria->addSelectColumn(\AppDelayPeer::APP_DEL_INDEX . " AS DEL_INDEX");
$criteria->add(\AppDelayPeer::APP_UID, $applicationUid, \Criteria::EQUAL);
$criteria->add(\AppDelayPeer::APP_TYPE, "PAUSE", \Criteria::EQUAL);
$criteria->add(
$criteria->getNewCriterion(\AppDelayPeer::APP_DISABLE_ACTION_USER, null, \Criteria::ISNULL)->addOr(
$criteria->getNewCriterion(\AppDelayPeer::APP_DISABLE_ACTION_USER, 0, \Criteria::EQUAL))
);
$rsCriteria = \AppDelayPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
//Return
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
}
//Status is TO_DO, DRAFT
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
$arrayCondition = array();
$arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppDelegationPeer::APP_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppThreadPeer::APP_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\ApplicationPeer::APP_UID, $delimiter . $applicationUid . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria->add(
$criteria->getNewCriterion(\ApplicationPeer::APP_STATUS, "TO_DO", \Criteria::EQUAL)->addAnd(
$criteria->getNewCriterion(\AppDelegationPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL))->addAnd(
$criteria->getNewCriterion(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(\AppThreadPeer::APP_THREAD_STATUS, "OPEN"))
)->addOr(
$criteria->getNewCriterion(\ApplicationPeer::APP_STATUS, "DRAFT", \Criteria::EQUAL)->addAnd(
$criteria->getNewCriterion(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(\AppThreadPeer::APP_THREAD_STATUS, "OPEN"))
);
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
//Return
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
}
//Status is CANCELLED, COMPLETED
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
$arrayCondition = array();
$arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppDelegationPeer::APP_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\ApplicationPeer::APP_UID, $delimiter . $applicationUid . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria->add(\ApplicationPeer::APP_STATUS, array("CANCELLED", "COMPLETED"), \Criteria::IN);
$criteria->add(\AppDelegationPeer::DEL_LAST_INDEX, 1, \Criteria::EQUAL);
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
//Return
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
}
//Return
return array();
} catch (\Exception $e) {
throw $e;
}
}
} }

View File

@@ -599,12 +599,12 @@ class Cases extends Api
public function doGetCaseInfo($app_uid) public function doGetCaseInfo($app_uid)
{ {
try { try {
$userUid = $this->getUserId(); $case = new \ProcessMaker\BusinessModel\Cases();
$cases = new \ProcessMaker\BusinessModel\Cases(); $case->setFormatFieldNameInUppercase(false);
$oData = $cases->getCaseInfo($app_uid, $userUid);
return $oData; return $case->getCaseInfo($app_uid, $this->getUserId());
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
} }
} }

View File

@@ -204,7 +204,7 @@ class Server implements iAuthenticate
$clientId = $_GET['client_id']; $clientId = $_GET['client_id'];
$requestedScope = isset($_GET['scope']) ? $_GET['scope'] : '*'; $requestedScope = isset($_GET['scope']) ? $_GET['scope'] : '*';
$requestedScope = empty($requestedScope) ? array() : explode(' ', $requestedScope); $requestedScope = empty($requestedScope) ? array() : explode(' ', $requestedScope);
$client = $this->storage->getClientDetails($clientId);; $client = $this->storage->getClientDetails($clientId);
if (empty($client)) { if (empty($client)) {
// throw error, client does not exist. // throw error, client does not exist.
@@ -309,7 +309,17 @@ class Server implements iAuthenticate
if ($returnResponse) { if ($returnResponse) {
return $response; return $response;
} else { } else {
$response->send(); if ($response->getStatusCode() == 400) {
$msg = $response->getParameter("error_description", "");
$msg = ($msg != "")? $msg : $response->getParameter("error", "");
$rest = new \Maveriks\Extension\Restler();
$rest->setMessage(new \Luracast\Restler\RestException(\ProcessMaker\Services\Api::STAT_APP_EXCEPTION, $msg));
exit(0);
} else {
$response->send();
}
} }
} }

View File

@@ -318,7 +318,8 @@
if ( defined('SYS_TEMP') && SYS_TEMP != '') { if ( defined('SYS_TEMP') && SYS_TEMP != '') {
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS //this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
if ( file_exists( PATH_DB . SYS_TEMP . '/db.php' ) ) { if ( file_exists( PATH_DB . SYS_TEMP . '/db.php' ) ) {
require_once( PATH_DB . SYS_TEMP . '/db.php' ); $pathFile = $filter->validateInput(PATH_DB . SYS_TEMP . '/db.php','path');
require_once( $pathFile );
define ( 'SYS_SYS' , SYS_TEMP ); define ( 'SYS_SYS' , SYS_TEMP );
// defining constant for workspace shared directory // defining constant for workspace shared directory
@@ -348,7 +349,8 @@
else{ else{
if (substr(SYS_SKIN, 0, 2) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form if (substr(SYS_SKIN, 0, 2) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
require_once PATH_CONTROLLERS . 'main.php'; $pathFile = $filter->validateInput(PATH_CONTROLLERS . 'main.php','path');
require_once $pathFile;
$controllerClass = 'Main'; $controllerClass = 'Main';
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin'; $controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
//if the method exists //if the method exists
@@ -552,7 +554,8 @@
//erik: verify if it is a Controller Class or httpProxyController Class //erik: verify if it is a Controller Class or httpProxyController Class
if (is_file(PATH_CONTROLLERS . SYS_COLLECTION . '.php')) { if (is_file(PATH_CONTROLLERS . SYS_COLLECTION . '.php')) {
require_once PATH_CONTROLLERS . SYS_COLLECTION . '.php'; $pathFile = $filter->validateInput(PATH_CONTROLLERS . SYS_COLLECTION . '.php','path');
require_once $pathFile;
$controllerClass = SYS_COLLECTION; $controllerClass = SYS_COLLECTION;
//if the method name is empty set default to index method //if the method name is empty set default to index method
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index'; $controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -340,6 +340,9 @@ Bootstrap::LoadThirdParty("smarty/libs", "Smarty.class");
//Loading the autoloader libraries feature //Loading the autoloader libraries feature
Bootstrap::registerSystemClasses(); Bootstrap::registerSystemClasses();
//Load filter class
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$skinPathErrors = G::skinGetPathToSrcByVirtualUri("errors", $config); $skinPathErrors = G::skinGetPathToSrcByVirtualUri("errors", $config);
$skinPathUpdate = G::skinGetPathToSrcByVirtualUri("update", $config); $skinPathUpdate = G::skinGetPathToSrcByVirtualUri("update", $config);
@@ -373,10 +376,6 @@ $virtualURITable['/skins/(*)'] = PATH_HTML . 'skins/'; //ugly
$virtualURITable['/images/(*)'] = PATH_HTML . 'images/'; //ugly $virtualURITable['/images/(*)'] = PATH_HTML . 'images/'; //ugly
$virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}/'] = 'errorFile'; $virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}/'] = 'errorFile';
//Load filter class
G::LoadSystem('inputfilter');
$filter = new InputFilter();
// Verify if we need to redirect or stream the file, if G:VirtualURI returns true means we are going to redirect the page // Verify if we need to redirect or stream the file, if G:VirtualURI returns true means we are going to redirect the page
if (Bootstrap::virtualURI( $_SERVER['REQUEST_URI'], $virtualURITable, $realPath )) { if (Bootstrap::virtualURI( $_SERVER['REQUEST_URI'], $virtualURITable, $realPath )) {
// review if the file requested belongs to public_html plugin // review if the file requested belongs to public_html plugin
@@ -489,8 +488,9 @@ if (defined( 'PATH_DATA' ) && file_exists( PATH_DATA )) {
Bootstrap::LoadClass( 'serverConfiguration' ); Bootstrap::LoadClass( 'serverConfiguration' );
$oServerConf = & serverConf::getSingleton(); $oServerConf = & serverConf::getSingleton();
} }
$pathFile = PATH_THIRDPARTY . '/pear/PEAR.php';
require_once PATH_THIRDPARTY . '/pear/PEAR.php'; $pathFile = $filter->validateInput($pathFile,'path');
require_once $pathFile;
//Bootstrap::LoadSystem( 'pmException' ); //Bootstrap::LoadSystem( 'pmException' );
@@ -504,7 +504,9 @@ if (! defined( 'PATH_DATA' ) || ! file_exists( PATH_DATA )) {
define( 'PATH_DATA', PATH_C ); define( 'PATH_DATA', PATH_C );
//NewRelic Snippet - By JHL //NewRelic Snippet - By JHL
transactionLog(PATH_CONTROLLERS.'installer.php'); transactionLog(PATH_CONTROLLERS.'installer.php');
require_once (PATH_CONTROLLERS . 'installer.php'); $pathFile = PATH_CONTROLLERS . 'installer.php';
$pathFile = $filter->validateInput($pathFile,'path');
require_once ($pathFile);
$controller = 'Installer'; $controller = 'Installer';
// if the method name is empty set default to index method // if the method name is empty set default to index method
@@ -548,8 +550,10 @@ if ($oServerConf->isWSDisabled( SYS_TEMP )) {
// if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file // if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file
if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') { if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS //this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
if (file_exists( PATH_DB . SYS_TEMP . '/db.php' )) { $pathFile = PATH_DB . SYS_TEMP . '/db.php';
require_once (PATH_DB . SYS_TEMP . '/db.php'); $pathFile = $filter->validateInput($pathFile,'path');
if (file_exists( $pathFile )) {
require_once ($pathFile);
define( 'SYS_SYS', SYS_TEMP ); define( 'SYS_SYS', SYS_TEMP );
// defining constant for workspace shared directory // defining constant for workspace shared directory
@@ -575,11 +579,14 @@ if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
die(); die();
} else { } else {
if (SYS_TARGET == "dbInfo") { //Show dbInfo when no SYS_SYS if (SYS_TARGET == "dbInfo") { //Show dbInfo when no SYS_SYS
require_once (PATH_METHODS . "login/dbInfo.php"); $pathFile = PATH_METHODS . "login/dbInfo.php";
$pathFile = $filter->validateInput($pathFile,'path');
require_once ($pathFile);
} else { } else {
if (substr( SYS_SKIN, 0, 2 ) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form if (substr( SYS_SKIN, 0, 2 ) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
require_once PATH_CONTROLLERS . 'main.php'; $pathFile = $filter->validateInput(PATH_CONTROLLERS . 'main.php','path');
require_once $pathFile;
$controllerClass = 'Main'; $controllerClass = 'Main';
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin'; $controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
//if the method exists //if the method exists
@@ -590,7 +597,8 @@ if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
$controller->call( $controllerAction ); $controller->call( $controllerAction );
} }
} else { // classic sysLogin interface } else { // classic sysLogin interface
require_once (PATH_METHODS . "login/sysLogin.php"); $pathFile = $filter->validateInput(PATH_METHODS . "login/sysLogin.php",'path');
require_once ($pathFile);
die(); die();
} }
} }
@@ -684,13 +692,15 @@ ob_start();
// Rebuild the base Workflow translations if not exists // Rebuild the base Workflow translations if not exists
if (! is_file( PATH_LANGUAGECONT . 'translation.en' )) { if (! is_file( PATH_LANGUAGECONT . 'translation.en' )) {
require_once ("classes/model/Translation.php"); $pathFile = $filter->validateInput("classes/model/Translation.php",'path');
require_once ($pathFile);
$fields = Translation::generateFileTranslation( 'en' ); $fields = Translation::generateFileTranslation( 'en' );
} }
// TODO: Verify if the language set into url is defined in translations env. // TODO: Verify if the language set into url is defined in translations env.
if (SYS_LANG != 'en' && ! is_file( PATH_LANGUAGECONT . 'translation.' . SYS_LANG )) { if (SYS_LANG != 'en' && ! is_file( PATH_LANGUAGECONT . 'translation.' . SYS_LANG )) {
require_once ("classes/model/Translation.php"); $pathFile = $filter->validateInput("classes/model/Translation.php",'path');
require_once ($pathFile);
$fields = Translation::generateFileTranslation( SYS_LANG ); $fields = Translation::generateFileTranslation( SYS_LANG );
} }
@@ -760,7 +770,8 @@ if (substr( SYS_COLLECTION, 0, 8 ) === 'gulliver') {
//erik: verify if it is a Controller Class or httpProxyController Class //erik: verify if it is a Controller Class or httpProxyController Class
if (is_file( PATH_CONTROLLERS . SYS_COLLECTION . '.php' )) { if (is_file( PATH_CONTROLLERS . SYS_COLLECTION . '.php' )) {
Bootstrap::LoadSystem( 'controller' ); Bootstrap::LoadSystem( 'controller' );
require_once PATH_CONTROLLERS . SYS_COLLECTION . '.php'; $pathFile = $filter->validateInput(PATH_CONTROLLERS . SYS_COLLECTION . '.php','path');
require_once $pathFile;
$controllerClass = SYS_COLLECTION; $controllerClass = SYS_COLLECTION;
//if the method name is empty set default to index method //if the method name is empty set default to index method
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index'; $controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';
@@ -913,7 +924,8 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
Bootstrap::LoadClass( 'sessions' ); Bootstrap::LoadClass( 'sessions' );
$oSessions = new Sessions(); $oSessions = new Sessions();
if ($aSession = $oSessions->verifySession( $_GET['sid'] )) { if ($aSession = $oSessions->verifySession( $_GET['sid'] )) {
require_once 'classes/model/Users.php'; $pathFile = $filter->validateInput('classes/model/Users.php','path');
require_once $pathFile;
$oUser = new Users(); $oUser = new Users();
$aUser = $oUser->load( $aSession['USR_UID'] ); $aUser = $oUser->load( $aSession['USR_UID'] );
$_SESSION['USER_LOGGED'] = $aUser['USR_UID']; $_SESSION['USER_LOGGED'] = $aUser['USR_UID'];