Merge branch 'release/3.2.2' into bugfix/HOR-3663

This commit is contained in:
Ronald Quenta
2017-08-14 10:15:10 -04:00
7 changed files with 54 additions and 45 deletions

View File

@@ -10,6 +10,7 @@ return [
'debug' => env('APP_DEBUG', false),
'log' => env('APP_LOG', 'single'),
'log_level' => env('APP_LOG_LEVEL', 'debug'),
'cache_lifetime' => env('APP_CACHE_LIFETIME', 60),
'providers' => [
FilesystemServiceProvider::class,

View File

@@ -2592,7 +2592,7 @@ class Bootstrap
$hashTypePrevious = $passwordHashConfig['previous'];
$acceptance = false;
if ($RBAC->loginWithHash()) {
if ($RBAC != null && $RBAC->loginWithHash()) {
//To enable compatibility with soap login
if ((Bootstrap::hashPassword($pass, $hashTypeCurrent) == $userPass) || ($pass === $hashTypeCurrent . ':' . $userPass)) {
$acceptance = true;

View File

@@ -184,9 +184,10 @@ class RbacUsers extends BaseRbacUsers
try {
$c = new Criteria('rbac');
$c->add(RbacUsersPeer::USR_UID, $sUsrUid);
$rs = RbacUsersPeer::doSelect($c, Propel::getDbConnection('rbac_ro'));
if (is_array($rs) && isset($rs[0]) && is_object($rs[0]) && get_class($rs[0]) == 'RbacUsers') {
$aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
$resultSet = RbacUsersPeer::doSelectRS($c, Propel::getDbConnection('rbac_ro'));
if ($resultSet->next()) {
$this->hydrate($resultSet);
$aFields = $this->toArray(BasePeer::TYPE_FIELDNAME);
return $aFields;
}
return false;
@@ -326,10 +327,14 @@ class RbacUsers extends BaseRbacUsers
*
* @param string $keyType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param boolean $original If true return de original verion of fields.
* @return an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $original = false)
{
if ($original) {
return parent::toArray($keyType);
}
$key = RbacUsersPeer::translateFieldName(
RbacUsersPeer::USR_PASSWORD,
BasePeer::TYPE_COLNAME,

View File

@@ -1,36 +1,11 @@
<?php
/**
* cliCommon.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2011 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
* @author Alexandre Rosenfeld <alexandre@colosa.com>
* @package workflow-engine-bin-tasks
*/
/* Get the size of the terminal (only works on Linux, on Windows it's always 80) */
preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a |grep columns')), $output);
if(sizeof($output) == 3 && isset($output[2]) && isset($output[2][0])) {
define("COLUMNS", $output[2][0]);
if (sizeof($output) == 3 && isset($output[2]) && isset($output[2][0])) {
define("COLUMNS", $output[2][0]);
} else {
define("COLUMNS", 80);
define("COLUMNS", 80);
}
/**
@@ -41,15 +16,9 @@ if(sizeof($output) == 3 && isset($output[2]) && isset($output[2][0])) {
* returns all available workspaces
* @return array of workspace objects
*/
function get_workspaces_from_args($args, $includeAll = true) {
$workspaces = array();
foreach ($args as $arg) {
$workspaces[] = new workspaceTools($arg);
}
if (empty($workspaces) && $includeAll) {
$workspaces = PmSystem::listWorkspaces();
}
return $workspaces;
function get_workspaces_from_args($args, $includeAll = true)
{
return \ProcessMaker\Util\System::getWorkspacesFromArgs($args, $includeAll);
}
?>

View File

@@ -83,8 +83,11 @@ class Users extends BaseUsers
try {
$oRow = UsersPeer::retrieveByPK( $UsrUid );
if (! is_null( $oRow )) {
$this->fromArray(
$oRow->toArray( BasePeer::TYPE_FIELDNAME, true ),
BasePeer::TYPE_FIELDNAME
);
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
$this->setNew( false );
return $aFields;
} else {
@@ -496,10 +499,14 @@ class Users extends BaseUsers
*
* @param string $keyType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param boolean $original If true return de original verion of fields.
* @return an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $original = false)
{
if ($original) {
return parent::toArray($keyType);
}
$key = UsersPeer::translateFieldName(
UsersPeer::USR_PASSWORD,
BasePeer::TYPE_COLNAME,

View File

@@ -6,6 +6,7 @@ use Archive_Tar;
use enterprisePlugin;
use Exception;
use G;
use Illuminate\Support\Facades\Cache;
use InputFilter;
use Language;
use PEAR;
@@ -44,6 +45,7 @@ class PluginRegistry
use PluginStructure;
use Attributes;
const NAME_CACHE = SYS_SYS . __CLASS__;
/**
* Instance of de object PluginRegistry
* @var PluginRegistry $instance
@@ -72,7 +74,11 @@ class PluginRegistry
public static function loadSingleton()
{
if (self::$instance === null) {
self::$instance = new PluginRegistry();
if (is_null($object = Cache::get(self::NAME_CACHE))) {
$object = new PluginRegistry();
Cache::put(self::NAME_CACHE, $object, config('app.cache_lifetime'));
}
self::$instance = $object;
}
return self::$instance;
}
@@ -180,6 +186,7 @@ class PluginRegistry
$fieldPlugin = PluginsRegistry::loadOrCreateIfNotExists(md5($plugin['PLUGIN_NAMESPACE']), $plugin);
PluginsRegistry::update($fieldPlugin);
}
Cache::pull(self::NAME_CACHE);
}
/**
* Get the plugin details, by filename

View File

@@ -35,6 +35,26 @@ class System
}
}
/**
* Returns workspace objects from an array of workspace names.
*
* @param array $args an array of workspace names
* @param bool $includeAll if true and no workspace is specified in args,
* returns all available workspaces
* @return array of workspace objects
*/
public static function getWorkspacesFromArgs($args, $includeAll = true)
{
$workspaces = array();
foreach ($args as $arg) {
$workspaces[] = new \workspaceTools($arg);
}
if (empty($workspaces) && $includeAll) {
$workspaces = \System::listWorkspaces();
}
return $workspaces;
}
/**
* Flush the cache files for the specified workspace.
*