GAP-9
This commit is contained in:
@@ -9,6 +9,16 @@ class AppEvent
|
||||
*/
|
||||
const XMLFORM_RENDER = 0;
|
||||
|
||||
/**
|
||||
* Identify login action
|
||||
*/
|
||||
const LOGIN = 1;
|
||||
|
||||
/**
|
||||
* Identify scripts with no login
|
||||
*/
|
||||
const SCRIPTS_WITH_NO_LOGIN = 2;
|
||||
|
||||
/**
|
||||
* Represents the AppEvent object.
|
||||
*
|
||||
@@ -50,7 +60,7 @@ class AppEvent
|
||||
* @param object $object
|
||||
* @return $this
|
||||
*/
|
||||
public function dispatch($type, $object)
|
||||
public function dispatch($type, &$object)
|
||||
{
|
||||
foreach ($this->callbacks as $callback) {
|
||||
$callback($type, $object, $this);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel;
|
||||
use ProcessMaker\Core\AppEvent;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
@@ -976,6 +977,11 @@ if (!defined('EXECUTE_BY_CRON')) {
|
||||
$noLoginFolders[] = 'services';
|
||||
$noLoginFolders[] = 'tracker';
|
||||
$noLoginFolders[] = 'InstallerModule';
|
||||
|
||||
$data = new stdClass();
|
||||
$data->noLoginFiles = &$noLoginFiles;
|
||||
$data->noLoginFolders = &$noLoginFolders;
|
||||
AppEvent::getAppEvent()->dispatch(AppEvent::SCRIPTS_WITH_NO_LOGIN, $data);
|
||||
|
||||
// This sentence is used when you lost the Session
|
||||
if (!in_array(SYS_TARGET, $noLoginFiles) && !in_array(SYS_COLLECTION,
|
||||
@@ -1024,7 +1030,9 @@ if (!defined('EXECUTE_BY_CRON')) {
|
||||
}
|
||||
|
||||
if (empty($_POST)) {
|
||||
header('location: ' . SYS_URI . $loginUrl . '?u=' . urlencode($_SERVER['REQUEST_URI']));
|
||||
$headerString = 'location: ' . SYS_URI . $loginUrl . '?u=' . urlencode($_SERVER['REQUEST_URI']);
|
||||
AppEvent::getAppEvent()->dispatch(AppEvent::LOGIN, $headerString);
|
||||
header($headerString);
|
||||
} else {
|
||||
if ($isControllerCall) {
|
||||
header("HTTP/1.0 302 session lost in controller");
|
||||
|
||||
Reference in New Issue
Block a user