Merge remote-tracking branch 'origin/release/3.3.9' into bugfix/PMC-580

This commit is contained in:
Paula Quispe
2019-05-07 14:47:01 -04:00
32 changed files with 453 additions and 321 deletions

View File

@@ -394,6 +394,12 @@ class Ajax
print(G::json_encode($processData));
}
/**
* Get the task information of the current task
*
* @see workflow/engine/templates/cases/open->taskInformation()
* @link https://wiki.processmaker.com/3.3/Cases/Information#Task_Information
*/
public function getTaskInformation()
{
if (!isset($_SESSION['USER_LOGGED'])) {
@@ -408,7 +414,15 @@ class Ajax
if ($_SESSION['TASK'] == '-1') {
$_SESSION['TASK'] = $_SESSION['CURRENT_TASK'];
}
$taskData = $task->getDelegatedTaskData($_SESSION['TASK'], $_SESSION['APPLICATION'], $_SESSION['INDEX']);
$arrayTaskUid = explode('|', $_SESSION['TASK']);
if (count($arrayTaskUid) > 1) {
$arrayTaskUid = array_unique($arrayTaskUid);
}
$taskUid = $arrayTaskUid[0];
$taskData = $task->getDelegatedTaskData($taskUid, $_SESSION['APPLICATION'], $_SESSION['INDEX']);
$taskData = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($taskData);

View File

@@ -1,6 +1,7 @@
<?php
use ProcessMaker\Core\System;
use ProcessMaker\Util\DateTime;
$filter = new InputFilter();
$_POST = $filter->xssFilterHard($_POST);
@@ -85,6 +86,7 @@ switch ($actionAjax) {
if ($respMess == 'BLOCK' || $respMess == '') {
$appMessageArray[$index]['APP_MSG_BODY'] = '';
}
$appMessageArray[$index]['APP_MSG_DATE'] = DateTime::convertUtcToTimeZone($appMessageArray[$index]['APP_MSG_DATE']);
$messageList[] = array_merge($appMessageArray[$index], ['MSGS_HISTORY' => $respMess]);
}
}

View File

@@ -196,7 +196,8 @@ $oHeadPublisher->addExtJsScript('app/main', true);
$oHeadPublisher->addExtJsScript('cases/casesList', false); //adding a javascript file .js
$oHeadPublisher->addContent('cases/casesListExtJs'); //adding a html file .html.
$oHeadPublisher->assign('FORMATS', $c->getFormats());
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
$oHeadPublisher->assign('userUid', $userUid);
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState($userUid));
$oHeadPublisher->assign('isIE', Bootstrap::isIE());
$oHeadPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);

View File

@@ -1,6 +1,7 @@
<?php
use ProcessMaker\Core\System;
use ProcessMaker\Util\DateTime;
$filter = new InputFilter();
$_GET = $filter->xssFilterHard($_GET);
@@ -581,6 +582,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
while ($rs->next()) {
$result = $rs->getRow();
$result["TYPE"] = (array_key_exists($result["TYPE"], $arrayToTranslation)) ? $arrayToTranslation[$result["TYPE"]] : $result["TYPE"];
$result['CREATE_DATE'] = DateTime::convertUtcToTimeZone($result['CREATE_DATE']);
$aProcesses[] = $result;
}
@@ -622,7 +624,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
$result["FILEDOCEXIST"] = ($result["FILEDOC"]);
$result["FILEPDFEXIST"] = ($result["FILEPDF"]);
$result["DELETE_FILE"] = (isset($result['ID_DELETE']) && $result['ID_DELETE'] == 'Delete') ? true : false;
$result['CREATE_DATE'] = DateTime::convertUtcToTimeZone($result['CREATE_DATE']);
$aProcesses[] = $result;
$rs->next();

View File

@@ -1,26 +1,6 @@
<?php
/**
* summary.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 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.
*/
use ProcessMaker\Util\DateTime;
try {
global $RBAC;
@@ -70,7 +50,7 @@ try {
if ($result->next()) {
$FieldsPmDynaform = $applicationFields;
$FieldsPmDynaform["CURRENT_DYNAFORM"] = $_REQUEST['DYN_UID'];
$a = new PmDynaform(\ProcessMaker\Util\DateTime::convertUtcToTimeZone($FieldsPmDynaform));
$a = new PmDynaform(DateTime::convertUtcToTimeZone($FieldsPmDynaform));
$a->printView();
}
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {

View File

@@ -1,5 +1,7 @@
<?php
use Illuminate\Support\Facades\Cache;
use ProcessMaker\BusinessModel\User;
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
@@ -23,6 +25,18 @@ try {
$frm = $_POST['form'];
$changePassword = false;
if (isset($_POST['form']['__USR_PASSWORD_CHANGE__'])) {
$value = Cache::pull($_POST['form']['__USR_PASSWORD_CHANGE__']);
$changePassword = !empty($value);
if ($changePassword === true) {
$_POST['form']['USER_ENV'] = $value['userEnvironment'];
$_POST['form']['BROWSER_TIME_ZONE_OFFSET'] = $value['browserTimeZoneOffset'];
$frm['USR_USERNAME'] = $value['usrUsername'];
$frm['USR_PASSWORD'] = $value['usrPassword'];
}
}
if (isset($frm['USR_USERNAME'])) {
$usr = mb_strtolower(trim($frm['USR_USERNAME']), 'UTF-8');
$pwd = trim($frm['USR_PASSWORD']);
@@ -317,6 +331,15 @@ try {
}
$userPropertyInfo = $userProperty->loadOrCreateIfNotExists($_SESSION['USER_LOGGED'], array('USR_PASSWORD_HISTORY' => serialize(array(G::encryptOld($pwd)))));
//change password
if ($changePassword === true) {
$user = new User();
$currentUser = $user->changePassword($_SESSION['USER_LOGGED'], $_POST['form']['USR_PASSWORD']);
G::header('Location: ' . $currentUser["__REDIRECT_PATH__"]);
return;
}
//Get the errors in the password
$errorInPassword = $userProperty->validatePassword(
$_POST['form']['USR_PASSWORD'],
@@ -345,13 +368,23 @@ try {
$G_PUBLISH = new Publisher;
$version = explode('.', trim(file_get_contents(PATH_GULLIVER . 'VERSION')));
$version = isset($version[0]) ? intval($version[0]) : 0;
if ($version >= 3) {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/changePasswordpm3', '', $messPassword,
'changePassword');
$values = [
"usrUsername" => $usr,
"usrPassword" => $pwd,
"userEnvironment" => config("system.workspace"),
"browserTimeZoneOffset" => $_POST['form']['BROWSER_TIME_ZONE_OFFSET']
];
$messPassword['__USR_PASSWORD_CHANGE__'] = G::generateUniqueID();
Cache::put($messPassword['__USR_PASSWORD_CHANGE__'], $values, 2);
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/changePasswordpm3', '', $messPassword, 'sysLoginVerify');
G::RenderPage('publish');
session_destroy();
} else {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/changePassword', '', $messPassword, 'changePassword');
G::RenderPage('publish');
}
G::RenderPage('publish');
die;
}

View File

@@ -1,92 +1,7 @@
<?php
use ProcessMaker\Plugins\PluginRegistry;
require_once 'classes/model/Users.php';
$oUser = new Users();
$aUser = $oUser->load($_SESSION['USER_LOGGED']);
global $RBAC;
$aData['USR_UID'] = $aUser['USR_UID'];
$aData['USR_USERNAME'] = $aUser['USR_USERNAME'];
$aData['USR_PASSWORD'] = Bootstrap::hashPassword($_POST['form']['USR_PASSWORD']);
$aData['USR_FIRSTNAME'] = $aUser['USR_FIRSTNAME'];
$aData['USR_LASTNAME'] = $aUser['USR_LASTNAME'];
$aData['USR_EMAIL'] = $aUser['USR_EMAIL'];
$aData['USR_DUE_DATE'] = $aUser['USR_DUE_DATE'];
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
$RBAC->updateUser($aData, $aUser['USR_ROLE']);
$aData['USR_COUNTRY'] = $aUser['USR_COUNTRY'];
$aData['USR_CITY'] = $aUser['USR_CITY'];
$aData['USR_LOCATION'] = $aUser['USR_LOCATION'];
$aData['USR_ADDRESS'] = $aUser['USR_ADDRESS'];
$aData['USR_PHONE'] = $aUser['USR_PHONE'];
$aData['USR_ZIP_CODE'] = $aUser['USR_ZIP_CODE'];
$aData['USR_POSITION'] = $aUser['USR_POSITION'];
$oUser->update($aData);
require_once 'classes/model/UsersProperties.php';
$oUserProperty = new UsersProperties();
$aUserProperty = $oUserProperty->load($_SESSION['USER_LOGGED']);
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
if (!is_array($aHistory)) {
$aHistory = array();
}
if (!defined('PPP_PASSWORD_HISTORY')) {
define('PPP_PASSWORD_HISTORY', 0);
}
if (PPP_PASSWORD_HISTORY > 0) {
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
array_shift($aHistory);
}
$aHistory[] = $_POST['form']['USR_PASSWORD'];
}
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 0;
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
$oUserProperty->update($aUserProperty);
if (class_exists('redirectDetail')) {
//falta validar...
if (isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'])) {
$userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
}
$oPluginRegistry = PluginRegistry::loadSingleton();
//$oPluginRegistry->showArrays();
$aRedirectLogin = $oPluginRegistry->getRedirectLogins();
if (isset($aRedirectLogin)) {
if (is_array($aRedirectLogin)) {
/** @var \ProcessMaker\Plugins\Interfaces\RedirectDetail $detail */
foreach ($aRedirectLogin as $detail) {
if (isset($detail->sPathMethod)) {
if ($detail->equalRoleCodeTo($userRole)) {
G::header(
'location: /sys' . SYS_TEMP . '/' . SYS_LANG .
'/' . SYS_SKIN . '/' . $detail->getPathMethod()
);
die;
}
}
}
}
}
}
//end plugin
if (isset($frm['USER_LANG'])) {
if ($frm['USER_LANG'] != '') {
$lang = $frm['USER_LANG'];
}
} else {
if (defined('SYS_LANG')) {
$lang = SYS_LANG;
} else {
$lang = 'en';
}
}
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
G::header('Location: ' . $sLocation);
die;
use ProcessMaker\BusinessModel\User;
$user = new User();
$currentUser = $user->changePassword($_SESSION['USER_LOGGED'], $_POST['form']['USR_PASSWORD'], isset($_POST['form']['USER_LANG']) ? $_POST['form']['USER_LANG'] : "");
G::header('Location: ' . $currentUser["__REDIRECT_PATH__"]);

View File

@@ -2,6 +2,7 @@
use ProcessMaker\Plugins\PluginRegistry;
use ProcessMaker\Exception\RBACException;
use ProcessMaker\Util\DateTime;
$req = (isset($_REQUEST['request']) ? $_REQUEST['request'] : '');
@@ -131,6 +132,7 @@ switch ($req) {
while ($result->next()) {
$row = $result->getRow();
$row['APP_MSG_STATUS'] = ucfirst($row['APP_MSG_STATUS']);
$row['APP_MSG_DATE'] = DateTime::convertUtcToTimeZone($row['APP_MSG_DATE']);
switch ($filterBy) {
case 'CASES':

View File

@@ -3,7 +3,7 @@ CREATE TRIGGER CONTENT_UPDATE BEFORE UPDATE ON CONTENT
FOR EACH ROW
BEGIN
DECLARE str TEXT;
DECLARE str MEDIUMTEXT;
IF (NEW.CON_VALUE IS NULL) THEN
SET str = '';