Merged in HOR-3700-RG (pull request #5960)

HOR-3700-RG

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Roly
2017-08-16 20:43:28 +00:00
committed by Julio Cesar Laura Avendaño
4 changed files with 176 additions and 207 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -5836,6 +5836,34 @@ class G
include (PATH_METHODS . "login/version-pmos.php");
}
//Removed default version from code.
/**
* The constants defined comes from the file:
* processmaker/workflow/engine/classes/class.plugin.php, the loading of this
* file is not done by 'require' in this version of ProcessMaker. Therefore,
* these definitions have been moved to this class.
*/
define('G_PLUGIN_CLASS', 1);
define('PM_CREATE_CASE', 1001);
define('PM_UPLOAD_DOCUMENT', 1002);
define('PM_CASE_DOCUMENT_LIST', 1003);
define('PM_BROWSE_CASE', 1004);
define('PM_NEW_PROCESS_LIST', 1005);
define('PM_NEW_PROCESS_SAVE', 1006);
define('PM_NEW_DYNAFORM_LIST', 1007);
define('PM_NEW_DYNAFORM_SAVE', 1008);
define('PM_EXTERNAL_STEP', 1009);
define('PM_CASE_DOCUMENT_LIST_ARR', 1010);
define('PM_LOGIN', 1011);
define('PM_UPLOAD_DOCUMENT_BEFORE', 1012);
define('PM_CREATE_NEW_DELEGATION', 1013);
define('PM_SINGLE_SIGN_ON', 1014);
define('PM_GET_CASES_AJAX_LISTENER', 1015);
define('PM_BEFORE_CREATE_USER', 1016);
define('PM_AFTER_LOGIN', 1017);
define('PM_HASH_PASSWORD', 1018);
define('PM_SCHEDULER_CREATE_CASE_BEFORE', 1019);
define('PM_SCHEDULER_CREATE_CASE_AFTER', 1020);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,10 @@
<?php
use Illuminate\Foundation\Http\Kernel;
use Maveriks\WebApplication;
use Maveriks\Http\Response;
use Maveriks\Pattern\Mvc\PhtmlView;
use ProcessMaker\Exception\RBACException;
// Because laravel has a __ helper function, it's important we include the class.g file to ensure our __ is used.
require_once __DIR__ . '/../../gulliver/system/class.g.php';
@@ -27,47 +32,45 @@ if (isset($_SERVER['UNENCODED_URL'])) {
try {
$rootDir = realpath(__DIR__ . "/../../") . DIRECTORY_SEPARATOR;
$app = new Maveriks\WebApplication();
$app = new WebApplication();
$app->setRootDir($rootDir);
$app->setRequestUri($_SERVER['REQUEST_URI']);
$stat = $app->route();
switch ($stat)
{
case Maveriks\WebApplication::RUNNING_WORKFLOW:
switch ($stat) {
case WebApplication::RUNNING_WORKFLOW:
include "sysGeneric.php";
break;
case Maveriks\WebApplication::RUNNING_API:
$app->run(Maveriks\WebApplication::SERVICE_API);
case WebApplication::RUNNING_API:
$app->run(WebApplication::SERVICE_API);
break;
case Maveriks\WebApplication::RUNNING_OAUTH2:
$app->run(Maveriks\WebApplication::SERVICE_OAUTH2);
case WebApplication::RUNNING_OAUTH2:
$app->run(WebApplication::SERVICE_OAUTH2);
break;
case Maveriks\WebApplication::RUNNING_INDEX:
$response = new Maveriks\Http\Response(file_get_contents("index.html"), 302);
case WebApplication::RUNNING_INDEX:
$response = new Response(file_get_contents("index.html"), 302);
$response->send();
break;
case Maveriks\WebApplication::RUNNING_DEFAULT:
$response = new Maveriks\Http\Response("", 302);
case WebApplication::RUNNING_DEFAULT:
$response = new Response("", 302);
//TODO compose this def url with configuration data from env.ini
$response->setHeader("location", "/sys/en/neoclassic/login/login");
$response->send();
break;
}
} catch (ProcessMaker\Exception\RBACException $e) {
} catch (RBACException $e) {
G::header('location: ' . $e->getPath());
} catch (Exception $e) {
$view = new Maveriks\Pattern\Mvc\PhtmlView($rootDir . "framework/src/templates/Exception.phtml");
$view = new PhtmlView($rootDir . "framework/src/templates/Exception.phtml");
$view->set("message", $e->getMessage());
$view->set("exception", $e);
$response = new Maveriks\Http\Response($view->getOutput(), 503);
$response = new Response($view->getOutput(), 503);
$response->send();
}