Merged in release/3.4.5 (pull request #7212)

Release/3.4.5

Approved-by: Paula Quispe <paula.quispe@processmaker.com>
Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2020-01-16 14:20:04 +00:00
committed by Julio Cesar Laura Avendaño
84 changed files with 2949 additions and 1322 deletions

View File

@@ -0,0 +1,13 @@
<?php
namespace ProcessMaker\Services\OAuth2;
use OAuth2\Server;
/**
* Extended class where the properties are correctly initialized, compatibility with PHP 7.3.x
*/
class OAuth2Server extends Server
{
protected $responseTypes = [];
}

View File

@@ -54,7 +54,7 @@ class Server implements iAuthenticate
}
// Pass a storage object or array of storage objects to the OAuth2 server class
$this->server = new \OAuth2\Server($this->storage, array('allow_implicit' => true, 'access_lifetime' => 86400));
$this->server = new OAuth2Server($this->storage, array('allow_implicit' => true, 'access_lifetime' => 86400));
$this->server->setConfig('enforce_state', false);
@@ -182,7 +182,7 @@ class Server implements iAuthenticate
if (! isset($_SESSION['USER_LOGGED'])) {
$http = \G::is_https() ? 'https' : 'http';
$host = $http . '://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
$redirect = urlencode($host.'/'.self::$workspace.$_SERVER['REQUEST_URI']);
$redirect = urlencode('/'.self::$workspace.$_SERVER['REQUEST_URI']);
$loginLink = sprintf('%s/sys%s/%s/%s/login/login?u=%s', $host, config("system.workspace"), SYS_LANG, SYS_SKIN, $redirect);
header('location: ' . $loginLink);