Put security fixes to develop branch
This commit is contained in:
@@ -70,9 +70,48 @@ class RBAC
|
|||||||
public $singleSignOn = false;
|
public $singleSignOn = false;
|
||||||
|
|
||||||
private static $instance = null;
|
private static $instance = null;
|
||||||
|
public $authorizedActions = array();
|
||||||
|
|
||||||
public function __construct ()
|
public function __construct ()
|
||||||
{
|
{
|
||||||
|
$this->authorizedActions = array(
|
||||||
|
'users_Ajax.php' => array(
|
||||||
|
'availableUsers' => array('PM_FACTORY'),
|
||||||
|
'assign' => array('PM_FACTORY'),
|
||||||
|
'changeView' => array(),
|
||||||
|
'ofToAssign' => array('PM_FACTORY'),
|
||||||
|
'usersGroup' => array('PM_FACTORY'),
|
||||||
|
'canDeleteUser' => array('PM_USERS'),
|
||||||
|
'deleteUser' => array('PM_USERS'),
|
||||||
|
'changeUserStatus' => array('PM_USERS'),
|
||||||
|
'availableGroups' => array('PM_USERS'),
|
||||||
|
'assignedGroups' => array('PM_USERS'),
|
||||||
|
'assignGroupsToUserMultiple' => array('PM_USERS'),
|
||||||
|
'deleteGroupsToUserMultiple' => array('PM_USERS'),
|
||||||
|
'authSources' => array('PM_USERS'),
|
||||||
|
'loadAuthSourceByUID' => array('PM_USERS'),
|
||||||
|
'updateAuthServices' => array('PM_USERS'),
|
||||||
|
'usersList' => array('PM_USERS'),
|
||||||
|
'updatePageSize' => array(),
|
||||||
|
'summaryUserData' => array('PM_USERS'),
|
||||||
|
'verifyIfUserAssignedAsSupervisor' => array('PM_USERS')
|
||||||
|
),
|
||||||
|
'skin_Ajax.php' => array(
|
||||||
|
'updatePageSize' => array(),
|
||||||
|
'skinList' => array('PM_SETUP_SKIN'),
|
||||||
|
'newSkin' => array('PM_SETUP_SKIN'),
|
||||||
|
'importSkin' => array('PM_SETUP_SKIN'),
|
||||||
|
'exportSkin' => array('PM_SETUP_SKIN'),
|
||||||
|
'deleteSkin' => array('PM_SETUP_SKIN'),
|
||||||
|
'addTarFolder' => array('PM_SETUP_SKIN'),
|
||||||
|
'copy_skin_folder' => array('PM_SETUP_SKIN'),
|
||||||
|
'deleteSkin' => array('PM_SETUP_SKIN')
|
||||||
|
),
|
||||||
|
'processes_DownloadFile.php' => array(
|
||||||
|
'downloadFileHash' => array('PM_FACTORY')
|
||||||
|
)
|
||||||
|
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1445,5 +1484,36 @@ class RBAC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* This function verify if the user allows to the file with a specific action
|
||||||
|
* If the action is not defined in the authorizedActions we give the allow
|
||||||
|
* @param string $file
|
||||||
|
* @param string $action
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function allows($file, $action)
|
||||||
|
{
|
||||||
|
$access = false;
|
||||||
|
if (isset($this->authorizedActions[$file][$action])) {
|
||||||
|
$permissions = $this->authorizedActions[$file][$action];
|
||||||
|
$totalPermissions = count($permissions);
|
||||||
|
$countAccess = 0;
|
||||||
|
foreach ($permissions as $key => $value) {
|
||||||
|
if ($this->userCanAccess($value) == 1) {
|
||||||
|
$countAccess++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Check if the user has all permissions that needed
|
||||||
|
if ($countAccess == $totalPermissions) {
|
||||||
|
$access = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$access) {
|
||||||
|
G::header('Location: /errors/error403.php');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -409,5 +409,39 @@ class ObjectPermission extends BaseObjectPermission
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify if the user has a objectPermission for some process
|
||||||
|
*
|
||||||
|
* @param string $usrUid the uid of the user
|
||||||
|
* @param int $typeRelation
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function objectPermissionPerUser($usrUid, $typeRelation = 1)
|
||||||
|
{
|
||||||
|
$criteria = new Criteria("workflow");
|
||||||
|
$criteria->addSelectColumn(ObjectPermissionPeer::USR_UID);
|
||||||
|
$criteria->addSelectColumn(ObjectPermissionPeer::PRO_UID);
|
||||||
|
$criteria->add(ObjectPermissionPeer::OP_USER_RELATION, $typeRelation, Criteria::EQUAL);
|
||||||
|
$criteria->add(ObjectPermissionPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||||
|
$doSelectRS = ObjectPermissionPeer::doSelectRS($criteria);
|
||||||
|
$doSelectRS->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$doSelectRS->next();
|
||||||
|
$objectPermision = $doSelectRS->getRow();
|
||||||
|
$data = array();
|
||||||
|
if (isset($objectPermision["USR_UID"])) {
|
||||||
|
$criteria = new Criteria("workflow");
|
||||||
|
$criteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||||
|
$criteria->add(ProcessPeer::PRO_UID, $objectPermision["PRO_UID"], Criteria::EQUAL);
|
||||||
|
$doSelectRS = ProcessPeer::doSelectRS($criteria);
|
||||||
|
$doSelectRS->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$doSelectRS->next();
|
||||||
|
$content = $doSelectRS->getRow();
|
||||||
|
$data['PRO_TITLE'] = $content["PRO_TITLE"];
|
||||||
|
$data['PRO_UID'] = $objectPermision["PRO_UID"];
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15187,6 +15187,12 @@ msgstr "SYSTEM INSTALLATION FAILED"
|
|||||||
msgid "A problem occurred during the installation of the system. Please, uninstall the partial installation and try again."
|
msgid "A problem occurred during the installation of the system. Please, uninstall the partial installation and try again."
|
||||||
msgstr "A problem occurred during the installation of the system. Please, uninstall the partial installation and try again."
|
msgstr "A problem occurred during the installation of the system. Please, uninstall the partial installation and try again."
|
||||||
|
|
||||||
|
# TRANSLATION
|
||||||
|
# LABEL/ID_PROCESSMAKER_ALREADY_INSTALLED
|
||||||
|
#: LABEL/ID_PROCESSMAKER_ALREADY_INSTALLED
|
||||||
|
msgid "ProcessMaker is already installed."
|
||||||
|
msgstr "ProcessMaker is already installed."
|
||||||
|
|
||||||
# TRANSLATION
|
# TRANSLATION
|
||||||
# LABEL/ID_LICENSE_EMPTY
|
# LABEL/ID_LICENSE_EMPTY
|
||||||
#: LABEL/ID_LICENSE_EMPTY
|
#: LABEL/ID_LICENSE_EMPTY
|
||||||
|
|||||||
@@ -29,6 +29,18 @@ class Designer extends Controller
|
|||||||
$client = $this->getClientCredentials();
|
$client = $this->getClientCredentials();
|
||||||
|
|
||||||
if (isset($httpData->tracker_designer) && $httpData->tracker_designer == 1) {
|
if (isset($httpData->tracker_designer) && $httpData->tracker_designer == 1) {
|
||||||
|
try {
|
||||||
|
if (!isset($_SESSION['CASE']) && !isset($_SESSION['PIN'])) {
|
||||||
|
throw (new \Exception(
|
||||||
|
\G::LoadTranslation('ID_CASE_NOT_EXISTS') . "\n" . \G::LoadTranslation('ID_PIN_INVALID')
|
||||||
|
));
|
||||||
|
}
|
||||||
|
\ProcessMaker\BusinessModel\Light\Tracker::authentication($_SESSION['CASE'], $_SESSION['PIN']);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Bootstrap::registerMonolog('CaseTracker', 400, $e->getMessage(), [], SYS_SYS, 'processmaker.log');
|
||||||
|
\G::header('Location: /errors/error403.php');
|
||||||
|
die();
|
||||||
|
}
|
||||||
$client["tracker_designer"] = 1;
|
$client["tracker_designer"] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,18 @@ class Installer extends Controller
|
|||||||
|
|
||||||
public function index ($httpData)
|
public function index ($httpData)
|
||||||
{
|
{
|
||||||
|
if (file_exists(FILE_PATHS_INSTALLED)) {
|
||||||
|
$this->setJSVar('messageError', G::LoadTranslation('ID_PROCESSMAKER_ALREADY_INSTALLED'));
|
||||||
|
$this->includeExtJS('installer/stopInstall');
|
||||||
|
$this->setView('installer/mainStopInstall');
|
||||||
|
G::RenderPage('publish', 'extJs');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && (file_exists($this->path_shared . 'partner.info'))) {
|
if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && (file_exists($this->path_shared . 'partner.info'))) {
|
||||||
$this->includeExtJS( 'installer/stopInstall');
|
$this->setJSVar('messageError', G::LoadTranslation('ID_NO_INSTALL'));
|
||||||
$this->setView( 'installer/mainStopInstall' );
|
$this->includeExtJS('installer/stopInstall');
|
||||||
G::RenderPage( 'publish', 'extJs' );
|
$this->setView('installer/mainStopInstall');
|
||||||
|
G::RenderPage('publish', 'extJs');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4027,6 +4027,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
|||||||
( 'LABEL','ID_ROLE_NAME_NOT_EMPTY','en','The ''Name'' field can not be empty.','2014-01-15') ,
|
( 'LABEL','ID_ROLE_NAME_NOT_EMPTY','en','The ''Name'' field can not be empty.','2014-01-15') ,
|
||||||
( 'LABEL','ID_TITLE_NO_INSTALL','en','SYSTEM INSTALLATION FAILED','2014-01-15') ,
|
( 'LABEL','ID_TITLE_NO_INSTALL','en','SYSTEM INSTALLATION FAILED','2014-01-15') ,
|
||||||
( 'LABEL','ID_NO_INSTALL','en','A problem occurred during the installation of the system. Please, uninstall the partial installation and try again.','2014-01-15') ,
|
( 'LABEL','ID_NO_INSTALL','en','A problem occurred during the installation of the system. Please, uninstall the partial installation and try again.','2014-01-15') ,
|
||||||
|
( 'LABEL','ID_PROCESSMAKER_ALREADY_INSTALLED','en','ProcessMaker is already installed.','2017-05-31') ,
|
||||||
( 'LABEL','ID_LICENSE_EMPTY','en','Can not find any license','2014-01-15') ,
|
( 'LABEL','ID_LICENSE_EMPTY','en','Can not find any license','2014-01-15') ,
|
||||||
( 'LABEL','ID_ADD_LICENSE','en','Please add a new license','2014-01-15') ,
|
( 'LABEL','ID_ADD_LICENSE','en','Please add a new license','2014-01-15') ,
|
||||||
( 'LABEL','ID_DEFAULT_CALENDAR','en','Default Calendar','2014-01-15') ,
|
( 'LABEL','ID_DEFAULT_CALENDAR','en','Default Calendar','2014-01-15') ,
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ switch ($_POST['action']) {
|
|||||||
$result->success = true;
|
$result->success = true;
|
||||||
$result->groups = $arrData;
|
$result->groups = $arrData;
|
||||||
$result->total_groups = $data['totalCount'];
|
$result->total_groups = $data['totalCount'];
|
||||||
|
G::header('Content-Type: application/json');
|
||||||
echo G::json_encode( $result );
|
echo G::json_encode( $result );
|
||||||
break;
|
break;
|
||||||
case 'exitsGroupName':
|
case 'exitsGroupName':
|
||||||
@@ -253,6 +253,7 @@ switch ($_POST['action']) {
|
|||||||
while ($oDataset->next()) {
|
while ($oDataset->next()) {
|
||||||
$arrData[] = $oDataset->getRow();
|
$arrData[] = $oDataset->getRow();
|
||||||
}
|
}
|
||||||
|
G::header('Content-Type: application/json');
|
||||||
echo '{success: true, members: ' . G::json_encode( $arrData ) . ', total_users: ' . $totalRows . '}';
|
echo '{success: true, members: ' . G::json_encode( $arrData ) . ', total_users: ' . $totalRows . '}';
|
||||||
break;
|
break;
|
||||||
case 'availableMembers':
|
case 'availableMembers':
|
||||||
@@ -311,6 +312,7 @@ switch ($_POST['action']) {
|
|||||||
while ($oDataset->next()) {
|
while ($oDataset->next()) {
|
||||||
$arrData[] = $oDataset->getRow();
|
$arrData[] = $oDataset->getRow();
|
||||||
}
|
}
|
||||||
|
G::header('Content-Type: application/json');
|
||||||
echo '{success: true, members: ' . G::json_encode( $arrData ) . ', total_users: ' . $totalRows . '}';
|
echo '{success: true, members: ' . G::json_encode( $arrData ) . ', total_users: ' . $totalRows . '}';
|
||||||
break;
|
break;
|
||||||
case 'assignUsersToGroupsMultiple':
|
case 'assignUsersToGroupsMultiple':
|
||||||
|
|||||||
@@ -1,26 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
$RBAC->allows(basename(__FILE__), 'downloadFileHash');
|
||||||
* processes_DownloadFile.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!isset($_GET["file_hash"])) {
|
if (!isset($_GET["file_hash"])) {
|
||||||
throw new Exception("Invalid Request, param 'file_hash' was not sent.");
|
throw new Exception("Invalid Request, param 'file_hash' was not sent.");
|
||||||
@@ -28,26 +7,16 @@ if (!isset($_GET["file_hash"])) {
|
|||||||
|
|
||||||
$httpStream = new \ProcessMaker\Util\IO\HttpStream();
|
$httpStream = new \ProcessMaker\Util\IO\HttpStream();
|
||||||
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
|
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
|
||||||
$filename = urldecode(base64_decode($_GET["file_hash"]));
|
$fileName = urldecode(base64_decode($_GET["file_hash"]));
|
||||||
$fileExtension = pathinfo($outputDir . $filename, PATHINFO_EXTENSION);
|
$processFile = $outputDir . $fileName;
|
||||||
|
|
||||||
if (!file_exists($outputDir . $filename)) {
|
//Verify if the file related to process exist in the corresponding path
|
||||||
throw new Exception("Error, couldn't find request file: $filename");
|
$fileInformation = pathinfo($processFile);
|
||||||
|
$processFile = $outputDir . $fileInformation['basename'];
|
||||||
|
if (!file_exists($processFile)) {
|
||||||
|
throw new Exception("Error, couldn't find request file: $fileName");
|
||||||
}
|
}
|
||||||
|
$fileExtension = $fileInformation['extension'];
|
||||||
$httpStream->loadFromFile($outputDir . $filename);
|
$httpStream->loadFromFile($processFile);
|
||||||
$httpStream->setHeader("Content-Type", "application/$fileExtension");
|
$httpStream->setHeader("Content-Type", "application/$fileExtension");
|
||||||
$httpStream->send();
|
$httpStream->send();
|
||||||
|
|
||||||
// ************* DEPRECATED (it will be removed soon) *********************************
|
|
||||||
//add more security, and catch any error or exception
|
|
||||||
//$sFileName = $_GET['p'] . '.pm';
|
|
||||||
//$file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm';
|
|
||||||
//$filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
|
|
||||||
//
|
|
||||||
//if (file_exists( $file )) {
|
|
||||||
// rename( $file, $filex );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//$realPath = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
|
|
||||||
//G::streamFile( $realPath, true );
|
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
G::LoadSystem('inputfilter');
|
|
||||||
$filter = new InputFilter();
|
|
||||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
|
||||||
|
|
||||||
if (! isset( $_REQUEST['action'] )) {
|
if (! isset( $_REQUEST['action'] )) {
|
||||||
$res['success'] = false;
|
$res['success'] = false;
|
||||||
$res['error'] = $res['message'] = G::LoadTranslation('ID_REQUEST_ACTION');
|
$res['error'] = $res['message'] = G::LoadTranslation('ID_REQUEST_ACTION');
|
||||||
@@ -17,8 +13,7 @@ if (! function_exists( $_REQUEST['action'] ) || !G::isUserFunction($_REQUEST['ac
|
|||||||
print G::json_encode( $res );
|
print G::json_encode( $res );
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
$restrictedFunctions = array ('copy_skin_folder','addTarFolder'
|
$restrictedFunctions = array ('copy_skin_folder','addTarFolder');
|
||||||
);
|
|
||||||
if (in_array( $_REQUEST['action'], $restrictedFunctions )) {
|
if (in_array( $_REQUEST['action'], $restrictedFunctions )) {
|
||||||
$res['success'] = false;
|
$res['success'] = false;
|
||||||
$res['error'] = $res['message'] = G::LoadTranslation('ID_REQUEST_ACTION_NOT_EXIST');
|
$res['error'] = $res['message'] = G::LoadTranslation('ID_REQUEST_ACTION_NOT_EXIST');
|
||||||
@@ -28,7 +23,7 @@ if (in_array( $_REQUEST['action'], $restrictedFunctions )) {
|
|||||||
|
|
||||||
$functionName = $_REQUEST['action'];
|
$functionName = $_REQUEST['action'];
|
||||||
$functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
|
$functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
|
||||||
|
$RBAC->allows(basename(__FILE__), $functionName);
|
||||||
$functionName();
|
$functionName();
|
||||||
|
|
||||||
function updatePageSize ()
|
function updatePageSize ()
|
||||||
@@ -166,7 +161,7 @@ function newSkin ($baseSkin = 'classic')
|
|||||||
$configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml';
|
$configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml';
|
||||||
|
|
||||||
$xmlConfiguration = file_get_contents( $configFileOriginal );
|
$xmlConfiguration = file_get_contents( $configFileOriginal );
|
||||||
|
|
||||||
$workspace = ($_REQUEST['workspace'] == 'global') ? '' : SYS_SYS;
|
$workspace = ($_REQUEST['workspace'] == 'global') ? '' : SYS_SYS;
|
||||||
|
|
||||||
$xmlConfigurationObj = G::xmlParser($xmlConfiguration);
|
$xmlConfigurationObj = G::xmlParser($xmlConfiguration);
|
||||||
@@ -356,9 +351,9 @@ function exportSkin ($skinToExport = "")
|
|||||||
$response['success'] = true;
|
$response['success'] = true;
|
||||||
$response['message'] = $skinTar;
|
$response['message'] = $skinTar;
|
||||||
G::auditLog("ExportSkin", "Skin Name: ".$skinName);
|
G::auditLog("ExportSkin", "Skin Name: ".$skinName);
|
||||||
|
|
||||||
$response = $filter->xssFilterHard($response);
|
$response = $filter->xssFilterHard($response);
|
||||||
|
|
||||||
print_r( G::json_encode( $response ) );
|
print_r( G::json_encode( $response ) );
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$response['success'] = false;
|
$response['success'] = false;
|
||||||
@@ -374,7 +369,7 @@ function deleteSkin ()
|
|||||||
$filter = new InputFilter();
|
$filter = new InputFilter();
|
||||||
try {
|
try {
|
||||||
$_REQUEST['SKIN_FOLDER_ID'] = $filter->xssFilterHard($_REQUEST['SKIN_FOLDER_ID']);
|
$_REQUEST['SKIN_FOLDER_ID'] = $filter->xssFilterHard($_REQUEST['SKIN_FOLDER_ID']);
|
||||||
|
|
||||||
if (! (isset( $_REQUEST['SKIN_FOLDER_ID'] ))) {
|
if (! (isset( $_REQUEST['SKIN_FOLDER_ID'] ))) {
|
||||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_FOLDER_REQUIRED' ) ));
|
throw (new Exception( G::LoadTranslation( 'ID_SKIN_FOLDER_REQUIRED' ) ));
|
||||||
}
|
}
|
||||||
@@ -400,9 +395,9 @@ function deleteSkin ()
|
|||||||
|
|
||||||
function streamSkin ()
|
function streamSkin ()
|
||||||
{
|
{
|
||||||
$skinTar = $_REQUEST['file'];
|
$skinTar = basename($_REQUEST['file']);
|
||||||
$bDownload = true;
|
$bDownload = true;
|
||||||
G::streamFile( $skinTar, $bDownload, basename( $skinTar ) );
|
G::streamFile(PATH_CUSTOM_SKINS . $skinTar, $bDownload, $skinTar);
|
||||||
@unlink( $fileTar );
|
@unlink( $fileTar );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* users_Ajax.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
try {
|
try {
|
||||||
G::LoadSystem('inputfilter');
|
|
||||||
$filter = new InputFilter();
|
|
||||||
$_GET = $filter->xssFilterHard($_GET);
|
|
||||||
$_POST = $filter->xssFilterHard($_POST);
|
|
||||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
|
||||||
|
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
switch ($RBAC->userCanAccess('PM_LOGIN')) {
|
switch ($RBAC->userCanAccess('PM_LOGIN')) {
|
||||||
case - 2:
|
case - 2:
|
||||||
@@ -47,38 +19,15 @@ try {
|
|||||||
$_POST = $_POST['form'];
|
$_POST = $_POST['form'];
|
||||||
}
|
}
|
||||||
if (isset($_REQUEST['function'])) {
|
if (isset($_REQUEST['function'])) {
|
||||||
//$value= $_POST['function'];
|
|
||||||
$value = get_ajax_value('function');
|
$value = get_ajax_value('function');
|
||||||
} else {
|
} else {
|
||||||
//$value= $_POST['functions'];
|
|
||||||
$value = get_ajax_value('functions');
|
$value = get_ajax_value('functions');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$RBAC->allows(basename(__FILE__), $value);
|
||||||
switch ($value) {
|
switch ($value) {
|
||||||
case 'verifyUsername':
|
|
||||||
//print_r($_POST); die;
|
|
||||||
$_POST['sOriginalUsername'] = get_ajax_value('sOriginalUsername');
|
|
||||||
$_POST['sUsername'] = get_ajax_value('sUsername');
|
|
||||||
if ($_POST['sOriginalUsername'] == $_POST['sUsername']) {
|
|
||||||
echo '0';
|
|
||||||
} else {
|
|
||||||
require_once 'classes/model/Users.php';
|
|
||||||
G::LoadClass('Users');
|
|
||||||
$oUser = new Users();
|
|
||||||
$oCriteria = $oUser->loadByUsername($_POST['sUsername']);
|
|
||||||
$oDataset = UsersPeer::doSelectRs($oCriteria, Propel::getDbConnection('workflow_ro'));
|
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$oDataset->next();
|
|
||||||
$aRow = $oDataset->getRow();
|
|
||||||
//print_r($aRow); die;
|
|
||||||
//if (!$aRow)
|
|
||||||
if (!is_array($aRow)) {
|
|
||||||
echo '0';
|
|
||||||
} else {
|
|
||||||
echo '1';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'availableUsers':
|
case 'availableUsers':
|
||||||
|
//Classic process: list of users to assign in the task
|
||||||
G::LoadClass('processMap');
|
G::LoadClass('processMap');
|
||||||
$oProcessMap = new ProcessMap();
|
$oProcessMap = new ProcessMap();
|
||||||
global $G_PUBLISH;
|
global $G_PUBLISH;
|
||||||
@@ -87,6 +36,7 @@ try {
|
|||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage('publish', 'raw');
|
||||||
break;
|
break;
|
||||||
case 'assign':
|
case 'assign':
|
||||||
|
//Classic process: assign users and groups in the task
|
||||||
G::LoadClass('tasks');
|
G::LoadClass('tasks');
|
||||||
$oTasks = new Tasks();
|
$oTasks = new Tasks();
|
||||||
switch ((int) $_POST['TU_RELATION']) {
|
switch ((int) $_POST['TU_RELATION']) {
|
||||||
@@ -103,6 +53,7 @@ try {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'ofToAssign':
|
case 'ofToAssign':
|
||||||
|
//Classic process: remove users and groups related a task
|
||||||
G::LoadClass('tasks');
|
G::LoadClass('tasks');
|
||||||
$oTasks = new Tasks();
|
$oTasks = new Tasks();
|
||||||
switch ((int) $_POST['TU_RELATION']) {
|
switch ((int) $_POST['TU_RELATION']) {
|
||||||
@@ -117,36 +68,11 @@ try {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'changeView':
|
case 'changeView':
|
||||||
|
//Classic process: set variable for users and groups Ad hoc
|
||||||
$_SESSION['iType'] = $_POST['TU_TYPE'];
|
$_SESSION['iType'] = $_POST['TU_TYPE'];
|
||||||
break;
|
break;
|
||||||
case 'deleteGroup':
|
|
||||||
G::LoadClass('groups');
|
|
||||||
$oGroup = new Groups();
|
|
||||||
$oGroup->removeUserOfGroup($_POST['GRP_UID'], $_POST['USR_UID']);
|
|
||||||
$_GET['sUserUID'] = $_POST['USR_UID'];
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent('view', 'users/users_Tree');
|
|
||||||
G::RenderPage('publish', 'raw');
|
|
||||||
break;
|
|
||||||
case 'showUserGroupInterface':
|
|
||||||
$_GET['sUserUID'] = $_POST['sUserUID'];
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent('view', 'users/users_AssignGroup');
|
|
||||||
G::RenderPage('publish', 'raw');
|
|
||||||
break;
|
|
||||||
case 'showUserGroups':
|
|
||||||
$_GET['sUserUID'] = $_POST['sUserUID'];
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent('view', 'users/users_Tree');
|
|
||||||
G::RenderPage('publish', 'raw');
|
|
||||||
break;
|
|
||||||
case 'assignUserToGroup':
|
|
||||||
G::LoadClass('groups');
|
|
||||||
$oGroup = new Groups();
|
|
||||||
$oGroup->addUserToGroup($_POST['GRP_UID'], $_POST['USR_UID']);
|
|
||||||
echo '<div align="center"><h2><font color="blue">' . G::LoadTranslation('ID_MSG_ASSIGN_DONE') . '</font></h2></div>';
|
|
||||||
break;
|
|
||||||
case 'usersGroup':
|
case 'usersGroup':
|
||||||
|
//Classic process: list of users in a group related a task
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$oGroup = new Groups();
|
$oGroup = new Groups();
|
||||||
$aGroup = $oGroup->getUsersOfGroup($_POST['GRP_UID']);
|
$aGroup = $oGroup->getUsersOfGroup($_POST['GRP_UID']);
|
||||||
@@ -154,29 +80,8 @@ try {
|
|||||||
echo $aValues['USR_FIRSTNAME'] . ' ' . $aValues['USR_LASTNAME'] . '<br>';
|
echo $aValues['USR_FIRSTNAME'] . ' ' . $aValues['USR_LASTNAME'] . '<br>';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//This case is used to check if any of the user group has as role 'PROCESSMAKER_ADMIN',
|
|
||||||
case 'usersAdminGroupExtJS':
|
|
||||||
G::LoadClass('groups');
|
|
||||||
$oGroup = new Groups();
|
|
||||||
$aGroup = $oGroup->getUsersOfGroup($_POST['GRP_UID']);
|
|
||||||
$responseUser = 'false';
|
|
||||||
$usersAdmin = '';
|
|
||||||
foreach ($aGroup as $iIndex => $aValues) {
|
|
||||||
if ($aValues['USR_ROLE'] == 'PROCESSMAKER_ADMIN') {
|
|
||||||
$responseUser = 'true';
|
|
||||||
$usersAdmin .= $aValues['USR_FIRSTNAME'] . ' ' . $aValues['USR_LASTNAME'] . ', ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$usersAdmin = substr($usersAdmin, 0, - 2);
|
|
||||||
|
|
||||||
$result = new stdClass();
|
|
||||||
$result->reponse = $responseUser;
|
|
||||||
$result->users = $usersAdmin;
|
|
||||||
|
|
||||||
echo G::json_encode($result);
|
|
||||||
break;
|
|
||||||
case 'canDeleteUser':
|
case 'canDeleteUser':
|
||||||
|
//Check before delete a user
|
||||||
G::LoadClass('case');
|
G::LoadClass('case');
|
||||||
$oProcessMap = new Cases();
|
$oProcessMap = new Cases();
|
||||||
$userUid = $_POST['uUID'];
|
$userUid = $_POST['uUID'];
|
||||||
@@ -204,44 +109,31 @@ try {
|
|||||||
echo $response;
|
echo $response;
|
||||||
break;
|
break;
|
||||||
case 'deleteUser':
|
case 'deleteUser':
|
||||||
$UID = $_POST['USR_UID'];
|
//Check if the user was defined in a process permissions
|
||||||
|
$oObjectPermission = new ObjectPermission();
|
||||||
//process permissions
|
$aProcess = $oObjectPermission->objectPermissionPerUser($_POST['USR_UID'], 1);
|
||||||
$criteria = new Criteria("workflow");
|
if (count($aProcess) > 0) {
|
||||||
$criteria->addSelectColumn(ObjectPermissionPeer::USR_UID);
|
|
||||||
$criteria->addSelectColumn(ObjectPermissionPeer::PRO_UID);
|
|
||||||
$criteria->add(ObjectPermissionPeer::OP_USER_RELATION, 1, Criteria::EQUAL);
|
|
||||||
$criteria->add(ObjectPermissionPeer::USR_UID, $UID, Criteria::EQUAL);
|
|
||||||
$doSelectRS = DynaformPeer::doSelectRS($criteria);
|
|
||||||
$doSelectRS->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$doSelectRS->next();
|
|
||||||
$objectPermision = $doSelectRS->getRow();
|
|
||||||
if (isset($objectPermision["USR_UID"])) {
|
|
||||||
$criteria = new Criteria("workflow");
|
|
||||||
$criteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
|
||||||
$criteria->add(ProcessPeer::PRO_UID, $objectPermision["PRO_UID"], Criteria::EQUAL);
|
|
||||||
$doSelectRS = ProcessPeer::doSelectRS($criteria);
|
|
||||||
$doSelectRS->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$doSelectRS->next();
|
|
||||||
$content = $doSelectRS->getRow();
|
|
||||||
echo G::json_encode(array(
|
echo G::json_encode(array(
|
||||||
"status" => 'ERROR',
|
"status" => 'ERROR',
|
||||||
"message" => G::LoadTranslation('ID_USER_CANT_BE_DELETED_FOR_THE_PROCESS', array('processTitle' => isset($content["PRO_TITLE"]) ? $content["PRO_TITLE"] : $objectPermision['PRO_UID']))
|
"message" => G::LoadTranslation('ID_USER_CANT_BE_DELETED_FOR_THE_PROCESS', array('processTitle' => isset($aProcess["PRO_TITLE"]) ? $aProcess["PRO_TITLE"] : $aProcess['PRO_UID']))
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Remove from tasks
|
||||||
G::LoadClass('tasks');
|
G::LoadClass('tasks');
|
||||||
$oTasks = new Tasks();
|
$oTasks = new Tasks();
|
||||||
$oTasks->ofToAssignUserOfAllTasks($UID);
|
$oTasks->ofToAssignUserOfAllTasks($UID);
|
||||||
|
|
||||||
|
//Remove from groups
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$oGroups = new Groups();
|
$oGroups = new Groups();
|
||||||
$oGroups->removeUserOfAllGroups($UID);
|
$oGroups->removeUserOfAllGroups($UID);
|
||||||
$RBAC->changeUserStatus($UID, 'CLOSED');
|
|
||||||
$_GET['USR_USERNAME'] = '';
|
//Update the table Users
|
||||||
$RBAC->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']
|
|
||||||
), '');
|
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
|
$RBAC->changeUserStatus($UID, 'CLOSED');
|
||||||
|
$RBAC->updateUser(array('USR_UID' => $UID,'USR_USERNAME' => ''), '');
|
||||||
$oUser = new Users();
|
$oUser = new Users();
|
||||||
$aFields = $oUser->load($UID);
|
$aFields = $oUser->load($UID);
|
||||||
$aFields['USR_STATUS'] = 'CLOSED';
|
$aFields['USR_STATUS'] = 'CLOSED';
|
||||||
@@ -258,13 +150,13 @@ try {
|
|||||||
|
|
||||||
//Delete users as supervisor
|
//Delete users as supervisor
|
||||||
$criteria = new Criteria("workflow");
|
$criteria = new Criteria("workflow");
|
||||||
|
|
||||||
$criteria->add(ProcessUserPeer::USR_UID, $UID, Criteria::EQUAL);
|
$criteria->add(ProcessUserPeer::USR_UID, $UID, Criteria::EQUAL);
|
||||||
$criteria->add(ProcessUserPeer::PU_TYPE, "SUPERVISOR", Criteria::EQUAL);
|
$criteria->add(ProcessUserPeer::PU_TYPE, "SUPERVISOR", Criteria::EQUAL);
|
||||||
ProcessUserPeer::doDelete($criteria);
|
ProcessUserPeer::doDelete($criteria);
|
||||||
G::auditLog("DeleteUser", "User Name: ". $userName." User ID: (".$UID.") ");
|
G::auditLog("DeleteUser", "User Name: ". $userName." User ID: (".$UID.") ");
|
||||||
break;
|
break;
|
||||||
case 'changeUserStatus':
|
case 'changeUserStatus':
|
||||||
|
//When the user change the status: ACTIVE, INACTIVE, VACATION
|
||||||
$response = new stdclass();
|
$response = new stdclass();
|
||||||
if (isset($_REQUEST['USR_UID']) && isset($_REQUEST['NEW_USR_STATUS'])) {
|
if (isset($_REQUEST['USR_UID']) && isset($_REQUEST['NEW_USR_STATUS'])) {
|
||||||
$RBAC->changeUserStatus($_REQUEST['USR_UID'], ($_REQUEST['NEW_USR_STATUS'] == 'ACTIVE' ? 1 : 0));
|
$RBAC->changeUserStatus($_REQUEST['USR_UID'], ($_REQUEST['NEW_USR_STATUS'] == 'ACTIVE' ? 1 : 0));
|
||||||
@@ -284,6 +176,7 @@ try {
|
|||||||
die(G::json_encode($response));
|
die(G::json_encode($response));
|
||||||
break;
|
break;
|
||||||
case 'availableGroups':
|
case 'availableGroups':
|
||||||
|
//Get the available groups for assign to user
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$filter = (isset($_POST['textFilter'])) ? $_POST['textFilter'] : '';
|
$filter = (isset($_POST['textFilter'])) ? $_POST['textFilter'] : '';
|
||||||
$groups = new Groups();
|
$groups = new Groups();
|
||||||
@@ -297,6 +190,7 @@ try {
|
|||||||
echo '{groups: ' . G::json_encode($arr) . '}';
|
echo '{groups: ' . G::json_encode($arr) . '}';
|
||||||
break;
|
break;
|
||||||
case 'assignedGroups':
|
case 'assignedGroups':
|
||||||
|
//Get the groups related to user
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$filter = (isset($_POST['textFilter'])) ? $_POST['textFilter'] : '';
|
$filter = (isset($_POST['textFilter'])) ? $_POST['textFilter'] : '';
|
||||||
$groups = new Groups();
|
$groups = new Groups();
|
||||||
@@ -310,6 +204,7 @@ try {
|
|||||||
echo '{groups: ' . G::json_encode($arr) . '}';
|
echo '{groups: ' . G::json_encode($arr) . '}';
|
||||||
break;
|
break;
|
||||||
case 'assignGroupsToUserMultiple':
|
case 'assignGroupsToUserMultiple':
|
||||||
|
//Assign user in a group
|
||||||
$USR_UID = $_POST['USR_UID'];
|
$USR_UID = $_POST['USR_UID'];
|
||||||
$gUIDs = explode(',', $_POST['GRP_UID']);
|
$gUIDs = explode(',', $_POST['GRP_UID']);
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
@@ -319,6 +214,7 @@ try {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'deleteGroupsToUserMultiple':
|
case 'deleteGroupsToUserMultiple':
|
||||||
|
//Remove a user from a group
|
||||||
$USR_UID = $_POST['USR_UID'];
|
$USR_UID = $_POST['USR_UID'];
|
||||||
$gUIDs = explode(',', $_POST['GRP_UID']);
|
$gUIDs = explode(',', $_POST['GRP_UID']);
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
@@ -328,6 +224,7 @@ try {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'authSources':
|
case 'authSources':
|
||||||
|
//Get the authentication information
|
||||||
$criteria = $RBAC->getAllAuthSources();
|
$criteria = $RBAC->getAllAuthSources();
|
||||||
$objects = AuthenticationSourcePeer::doSelectRS($criteria);
|
$objects = AuthenticationSourcePeer::doSelectRS($criteria);
|
||||||
$objects->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$objects->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
@@ -342,22 +239,19 @@ try {
|
|||||||
}
|
}
|
||||||
$started = Array();
|
$started = Array();
|
||||||
$started['AUTH_SOURCE_UID'] = '00000000000000000000000000000000';
|
$started['AUTH_SOURCE_UID'] = '00000000000000000000000000000000';
|
||||||
//$started['AUTH_SOURCE_NAME'] = 'ProcessMaker';
|
|
||||||
//$started['AUTH_SOURCE_TYPE'] = 'MYSQL';
|
|
||||||
$started['AUTH_SOURCE_SHOW'] = 'ProcessMaker (MYSQL)';
|
$started['AUTH_SOURCE_SHOW'] = 'ProcessMaker (MYSQL)';
|
||||||
$arr[] = $started;
|
$arr[] = $started;
|
||||||
while ($objects->next()) {
|
while ($objects->next()) {
|
||||||
$row = $objects->getRow();
|
$row = $objects->getRow();
|
||||||
$aux = Array();
|
$aux = Array();
|
||||||
$aux['AUTH_SOURCE_UID'] = $row['AUTH_SOURCE_UID'];
|
$aux['AUTH_SOURCE_UID'] = $row['AUTH_SOURCE_UID'];
|
||||||
//$aux['AUTH_SOURCE_NAME'] = $row['AUTH_SOURCE_NAME'];
|
|
||||||
//$aux['AUTH_SOURCE_TYPE'] = $row['AUTH_SOURCE_TYPE'];
|
|
||||||
$aux['AUTH_SOURCE_SHOW'] = $row['AUTH_SOURCE_NAME'] . ' (' . $row['AUTH_SOURCE_PROVIDER'] . ')';
|
$aux['AUTH_SOURCE_SHOW'] = $row['AUTH_SOURCE_NAME'] . ' (' . $row['AUTH_SOURCE_PROVIDER'] . ')';
|
||||||
$arr[] = $aux;
|
$arr[] = $aux;
|
||||||
}
|
}
|
||||||
echo '{sources: ' . G::json_encode($arr) . '}';
|
echo '{sources: ' . G::json_encode($arr) . '}';
|
||||||
break;
|
break;
|
||||||
case 'loadAuthSourceByUID':
|
case 'loadAuthSourceByUID':
|
||||||
|
//Get the authentication source assignment
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
$oCriteria = $RBAC->load($_POST['uUID']);
|
$oCriteria = $RBAC->load($_POST['uUID']);
|
||||||
$UID_AUTH = $oCriteria['UID_AUTH_SOURCE'];
|
$UID_AUTH = $oCriteria['UID_AUTH_SOURCE'];
|
||||||
@@ -379,6 +273,7 @@ try {
|
|||||||
echo G::json_encode($res);
|
echo G::json_encode($res);
|
||||||
break;
|
break;
|
||||||
case 'updateAuthServices':
|
case 'updateAuthServices':
|
||||||
|
//Update the information related to user's autentication
|
||||||
$aData = $RBAC->load($_POST['usr_uid']);
|
$aData = $RBAC->load($_POST['usr_uid']);
|
||||||
unset($aData['USR_ROLE']);
|
unset($aData['USR_ROLE']);
|
||||||
$auth_uid = $_POST['auth_source'];
|
$auth_uid = $_POST['auth_source'];
|
||||||
@@ -399,127 +294,31 @@ try {
|
|||||||
$aData['USR_AUTH_USER_DN'] = $auth_dn;
|
$aData['USR_AUTH_USER_DN'] = $auth_dn;
|
||||||
}
|
}
|
||||||
$RBAC->updateUser($aData);
|
$RBAC->updateUser($aData);
|
||||||
G::auditLog("AssignAuthenticationSource", "User Name: ".$aData['USR_USERNAME'].' User ID: ('.$aData['USR_UID'].') assign to '.$aData['USR_AUTH_TYPE']);
|
G::auditLog(
|
||||||
|
"AssignAuthenticationSource",
|
||||||
|
"User Name: ".$aData['USR_USERNAME'].' User ID: ('.$aData['USR_UID'].') assign to '.$aData['USR_AUTH_TYPE']
|
||||||
|
);
|
||||||
echo '{success: true}';
|
echo '{success: true}';
|
||||||
break;
|
break;
|
||||||
case 'usersList':
|
case 'usersList':
|
||||||
require_once 'classes/model/Users.php';
|
//Get the list of users
|
||||||
require_once 'classes/model/LoginLog.php';
|
//Read the configurations related to enviroments
|
||||||
require_once 'classes/model/Department.php';
|
|
||||||
require_once 'classes/model/AppCacheView.php';
|
|
||||||
require_once PATH_RBAC . 'model/Roles.php';
|
|
||||||
global $RBAC;
|
|
||||||
G::LoadClass('configuration');
|
G::LoadClass('configuration');
|
||||||
$co = new Configurations();
|
$co = new Configurations();
|
||||||
$config = $co->getConfiguration('usersList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
$config = $co->getConfiguration('usersList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
||||||
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
||||||
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
|
||||||
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
|
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
|
||||||
|
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
||||||
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
|
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
|
||||||
$auths = isset($_REQUEST['auths']) ? $_REQUEST['auths'] : '';
|
$authSource = isset($_REQUEST['auths']) ? $_REQUEST['auths'] : '';
|
||||||
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';
|
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';
|
||||||
$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';
|
$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';
|
||||||
$aUsers = Array();
|
|
||||||
if ($auths != '') {
|
|
||||||
$aUsers = $RBAC->getListUsersByAuthSource($auths);
|
|
||||||
}
|
|
||||||
$oCriteria = new Criteria('workflow');
|
|
||||||
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
|
|
||||||
if ($filter != '') {
|
|
||||||
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_EMAIL, '%' . $filter . '%', Criteria::LIKE))));
|
|
||||||
$oCriteria->add($cc);
|
|
||||||
}
|
|
||||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
|
||||||
if ($auths != '') {
|
|
||||||
$totalRows = sizeof($aUsers);
|
|
||||||
} else {
|
|
||||||
$oDataset = UsersPeer::DoSelectRs($oCriteria);
|
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$oDataset->next();
|
|
||||||
$row = $oDataset->getRow();
|
|
||||||
$totalRows = $row['CNT'];
|
|
||||||
}
|
|
||||||
$oCriteria->clearSelectColumns();
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_ROLE);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_STATUS);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_UX);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::DEP_UID);
|
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_LAST_LOGIN);
|
|
||||||
$oCriteria->addAsColumn('LAST_LOGIN', 0);
|
|
||||||
$oCriteria->addAsColumn('DEP_TITLE', 0);
|
|
||||||
$oCriteria->addAsColumn('TOTAL_CASES', 0);
|
|
||||||
$oCriteria->addAsColumn('DUE_DATE_OK', 1);
|
|
||||||
$sep = "'";
|
|
||||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
|
||||||
if ($filter != '') {
|
|
||||||
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_EMAIL, '%' . $filter . '%', Criteria::LIKE))));
|
|
||||||
$oCriteria->add($cc);
|
|
||||||
}
|
|
||||||
if (sizeof($aUsers) > 0) {
|
|
||||||
$oCriteria->add(UsersPeer::USR_UID, $aUsers, Criteria::IN);
|
|
||||||
} elseif ($totalRows == 0 && $auths != '') {
|
|
||||||
$oCriteria->add(UsersPeer::USR_UID, '', Criteria::IN);
|
|
||||||
}
|
|
||||||
if ($sort != '') {
|
|
||||||
if ($dir == 'ASC') {
|
|
||||||
$oCriteria->addAscendingOrderByColumn($sort);
|
|
||||||
} else {
|
|
||||||
$oCriteria->addDescendingOrderByColumn($sort);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$oCriteria->setOffset($start);
|
|
||||||
$oCriteria->setLimit($limit);
|
|
||||||
$oDataset = UsersPeer::DoSelectRs($oCriteria);
|
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$Department = new Department();
|
|
||||||
$aDepart = $Department->getAllDepartmentsByUser();
|
|
||||||
$aAuthSources = $RBAC->getAllAuthSourcesByUser();
|
|
||||||
|
|
||||||
require_once PATH_CONTROLLERS . 'adminProxy.php';
|
//Get all list of users with the additional information related to department, role, authentication, cases
|
||||||
$uxList = adminProxy::getUxTypesList();
|
$oUser = new \ProcessMaker\BusinessModel\User();
|
||||||
|
$oDatasetUsers = $oUser->getAllUsersWithAuthSource($authSource, $filter, $sort, $start, $limit, $dir);
|
||||||
$oRoles = new Roles();
|
$rows = $oUser->getAdditionalInfoFromUsers($oDatasetUsers);
|
||||||
$oParticipated = new ListParticipatedLast();
|
echo '{users: ' . G::json_encode($rows['data']) . ', total_users: ' . $rows['totalCount'] . '}';
|
||||||
$oAppCache = new AppCacheView();
|
|
||||||
$rows = Array();
|
|
||||||
$uRole = Array();
|
|
||||||
while ($oDataset->next()) {
|
|
||||||
$row = $oDataset->getRow();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$uRole = $oRoles->loadByCode($row['USR_ROLE']);
|
|
||||||
} catch (exception $oError) {
|
|
||||||
$uRole['ROL_NAME'] = G::loadTranslation('ID_DELETED');
|
|
||||||
}
|
|
||||||
/*----------------------------------********---------------------------------*/
|
|
||||||
if (true) {
|
|
||||||
$total = $oParticipated->getCountList($row['USR_UID']);
|
|
||||||
} else {
|
|
||||||
/*----------------------------------********---------------------------------*/
|
|
||||||
$total = $oAppCache->getListCounters('sent', $row['USR_UID'], false);
|
|
||||||
/*----------------------------------********---------------------------------*/
|
|
||||||
}
|
|
||||||
/*----------------------------------********---------------------------------*/
|
|
||||||
$row['USR_ROLE_ID'] = $row['USR_ROLE'];
|
|
||||||
$row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['ROL_CODE']) : $uRole['ROL_CODE'];
|
|
||||||
|
|
||||||
$row['DUE_DATE_OK'] = (date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE']))) ? 0 : 1;
|
|
||||||
$row['LAST_LOGIN'] = isset($row['USR_LAST_LOGIN']) ? \ProcessMaker\Util\DateTime::convertUtcToTimeZone($row['USR_LAST_LOGIN']) : '';
|
|
||||||
$row['TOTAL_CASES'] = $total;
|
|
||||||
$row['DEP_TITLE'] = isset($aDepart[$row['USR_UID']]) ? $aDepart[$row['USR_UID']] : '';
|
|
||||||
$row['USR_UX'] = isset($uxList[$row['USR_UX']]) ? $uxList[$row['USR_UX']] : $uxList['NORMAL'];
|
|
||||||
$row['USR_AUTH_SOURCE'] = isset($aAuthSources[$row['USR_UID']]) ? $aAuthSources[$row['USR_UID']] : 'ProcessMaker (MYSQL)';
|
|
||||||
|
|
||||||
$rows[] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '{users: ' . G::json_encode($rows) . ', total_users: ' . $totalRows . '}';
|
|
||||||
break;
|
break;
|
||||||
case 'updatePageSize':
|
case 'updatePageSize':
|
||||||
G::LoadClass('configuration');
|
G::LoadClass('configuration');
|
||||||
@@ -533,6 +332,7 @@ try {
|
|||||||
echo '{success: true}';
|
echo '{success: true}';
|
||||||
break;
|
break;
|
||||||
case 'summaryUserData':
|
case 'summaryUserData':
|
||||||
|
//Get all information for the summary
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
require_once 'classes/model/Department.php';
|
require_once 'classes/model/Department.php';
|
||||||
require_once 'classes/model/AppCacheView.php';
|
require_once 'classes/model/AppCacheView.php';
|
||||||
@@ -574,25 +374,16 @@ try {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "verifyIfUserAssignedAsSupervisor":
|
case "verifyIfUserAssignedAsSupervisor":
|
||||||
|
//Before delete we check if is supervisor
|
||||||
|
$supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
|
||||||
|
$isSupervisor = $supervisor->isUserSupervisor($_POST["supervisorUserUid"]);
|
||||||
$supervisorUserUid = $_POST["supervisorUserUid"];
|
$supervisorUserUid = $_POST["supervisorUserUid"];
|
||||||
$message = "OK";
|
$message = 'OK';
|
||||||
|
if ($isSupervisor) {
|
||||||
$criteria = new Criteria("workflow");
|
$message = 'ERROR';
|
||||||
|
|
||||||
$criteria->addSelectColumn(ProcessUserPeer::PU_UID);
|
|
||||||
$criteria->add(ProcessUserPeer::USR_UID, $supervisorUserUid, Criteria::EQUAL);
|
|
||||||
$criteria->add(ProcessUserPeer::PU_TYPE, "SUPERVISOR", Criteria::EQUAL);
|
|
||||||
|
|
||||||
$rsCriteria = ProcessUserPeer::doSelectRS($criteria);
|
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
if ($rsCriteria->next()) {
|
|
||||||
$message = "ERROR";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = array();
|
$response = array();
|
||||||
$response["result"] = $message;
|
$response["result"] = $message;
|
||||||
|
|
||||||
echo G::json_encode($response);
|
echo G::json_encode($response);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ class Tracker
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* authenticaction for case tracker
|
* Authentication for case tracker
|
||||||
*
|
*
|
||||||
* @param $case numbre case
|
* @param int $case number case
|
||||||
* @param $pin code pin access for case tracek
|
* @param int $pin code pin access for case track
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function authentication($case, $pin)
|
public static function authentication($case, $pin)
|
||||||
{
|
{
|
||||||
$cases = new \Cases();
|
$cases = new \Cases();
|
||||||
$response = array();
|
$response = array();
|
||||||
|
|||||||
@@ -1461,4 +1461,37 @@ class ProcessSupervisor
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Check if the user is supervisor for some process
|
||||||
|
*
|
||||||
|
* @param string $userUid Unique id of User
|
||||||
|
*
|
||||||
|
* @return bool Return
|
||||||
|
*/
|
||||||
|
public function isUserSupervisor($userUid)
|
||||||
|
{
|
||||||
|
//Check if the user is defined as supervisor
|
||||||
|
$criteria = new \Criteria('workflow');
|
||||||
|
$criteria->add(\ProcessUserPeer::USR_UID, $userUid, \Criteria::EQUAL);
|
||||||
|
$criteria->add(\ProcessUserPeer::PU_TYPE, 'SUPERVISOR', \Criteria::EQUAL);
|
||||||
|
$rsCriteria = \ProcessUserPeer::doSelectRS($criteria);
|
||||||
|
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
if ($rsCriteria->next()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//Check if the user is in a group defined as supervisor
|
||||||
|
$criteria = new \Criteria('workflow');
|
||||||
|
$criteria->addSelectColumn(\ProcessUserPeer::USR_UID);
|
||||||
|
$criteria->addJoin(\ProcessUserPeer::USR_UID, \GroupUserPeer::GRP_UID, \Criteria::LEFT_JOIN);
|
||||||
|
$criteria->add(\ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR', \Criteria::EQUAL);
|
||||||
|
$criteria->add(\GroupUserPeer::USR_UID, $userUid, \Criteria::EQUAL);
|
||||||
|
$rsCriteria = \ProcessUserPeer::doSelectRS($criteria);
|
||||||
|
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
if ($rsCriteria->next()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1544,5 +1544,163 @@ class User
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* This function get the list of users
|
||||||
|
*
|
||||||
|
* @param string $authSource, authentication source
|
||||||
|
* @param string $filter
|
||||||
|
* @param string $sort
|
||||||
|
* @param integer $start
|
||||||
|
* @param integer $limit
|
||||||
|
* @param string $dir related to order the column
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function getAllUsersWithAuthSource(
|
||||||
|
$authSource = '',
|
||||||
|
$filter = '',
|
||||||
|
$sort = '',
|
||||||
|
$start = 0,
|
||||||
|
$limit = 20,
|
||||||
|
$dir = 'ASC'
|
||||||
|
)
|
||||||
|
{
|
||||||
|
global $RBAC;
|
||||||
|
$aUsers = array();
|
||||||
|
if ($authSource != '') {
|
||||||
|
$aUsers = $RBAC->getListUsersByAuthSource($authSource);
|
||||||
|
}
|
||||||
|
$oCriteria = new \Criteria('workflow');
|
||||||
|
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
|
||||||
|
if ($filter != '') {
|
||||||
|
$cc = $oCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, '%' . $filter . '%', \Criteria::LIKE)
|
||||||
|
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', \Criteria::LIKE)
|
||||||
|
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME, '%' . $filter . '%', \Criteria::LIKE)
|
||||||
|
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_EMAIL, '%' . $filter . '%', \Criteria::LIKE))));
|
||||||
|
$oCriteria->add($cc);
|
||||||
|
}
|
||||||
|
$oCriteria->add(\UsersPeer::USR_STATUS, array('CLOSED'), \Criteria::NOT_IN);
|
||||||
|
|
||||||
|
if ($authSource != '') {
|
||||||
|
$totalRows = sizeof($aUsers);
|
||||||
|
} else {
|
||||||
|
$oDataset = \UsersPeer::DoSelectRs($oCriteria);
|
||||||
|
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$oDataset->next();
|
||||||
|
$row = $oDataset->getRow();
|
||||||
|
$totalRows = $row['CNT'];
|
||||||
|
}
|
||||||
|
$oCriteria->clearSelectColumns();
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_EMAIL);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_ROLE);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_DUE_DATE);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_STATUS);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_UX);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::DEP_UID);
|
||||||
|
$oCriteria->addSelectColumn(\UsersPeer::USR_LAST_LOGIN);
|
||||||
|
$oCriteria->addAsColumn('LAST_LOGIN', 0);
|
||||||
|
$oCriteria->addAsColumn('DEP_TITLE', 0);
|
||||||
|
$oCriteria->addAsColumn('TOTAL_CASES', 0);
|
||||||
|
$oCriteria->addAsColumn('DUE_DATE_OK', 1);
|
||||||
|
$sep = "'";
|
||||||
|
$oCriteria->add(\UsersPeer::USR_STATUS, array('CLOSED'), \Criteria::NOT_IN);
|
||||||
|
if ($filter != '') {
|
||||||
|
$cc = $oCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, '%' . $filter . '%', \Criteria::LIKE)
|
||||||
|
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', \Criteria::LIKE)
|
||||||
|
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME, '%' . $filter . '%', \Criteria::LIKE)
|
||||||
|
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_EMAIL, '%' . $filter . '%', \Criteria::LIKE))));
|
||||||
|
$oCriteria->add($cc);
|
||||||
|
}
|
||||||
|
if (sizeof($aUsers) > 0) {
|
||||||
|
$oCriteria->add(\UsersPeer::USR_UID, $aUsers, \Criteria::IN);
|
||||||
|
} elseif ($totalRows == 0 && $authSource != '') {
|
||||||
|
$oCriteria->add(\UsersPeer::USR_UID, '', \Criteria::IN);
|
||||||
|
}
|
||||||
|
if ($sort != '') {
|
||||||
|
if ($dir == 'ASC') {
|
||||||
|
$oCriteria->addAscendingOrderByColumn($sort);
|
||||||
|
} else {
|
||||||
|
$oCriteria->addDescendingOrderByColumn($sort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$oCriteria->setOffset($start);
|
||||||
|
$oCriteria->setLimit($limit);
|
||||||
|
$oDataset = \UsersPeer::DoSelectRs($oCriteria);
|
||||||
|
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
return $oDataset;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This function get additional information related to the user
|
||||||
|
* Information about the department, rol, cases, authentication
|
||||||
|
*
|
||||||
|
* @param criteria $oDatasetUsers, criteria for search users
|
||||||
|
*
|
||||||
|
* @return array $dataUsers array of users with the additional information
|
||||||
|
*/
|
||||||
|
public function getAdditionalInfoFromUsers($oDatasetUsers)
|
||||||
|
{
|
||||||
|
global $RBAC;
|
||||||
|
//Get the information about the department
|
||||||
|
$Department = new \Department();
|
||||||
|
$aDepart = $Department->getAllDepartmentsByUser();
|
||||||
|
|
||||||
|
//Get the authentication sources
|
||||||
|
$aAuthSources = $RBAC->getAllAuthSourcesByUser();
|
||||||
|
|
||||||
|
//Get roles
|
||||||
|
$oRoles = new \Roles();
|
||||||
|
|
||||||
|
//Get cases
|
||||||
|
$oParticipated = new \ListParticipatedLast();
|
||||||
|
$oAppCache = new \AppCacheView();
|
||||||
|
|
||||||
|
$rows = array();
|
||||||
|
$uRole = array();
|
||||||
|
$totalRows = 0;
|
||||||
|
$dataUsers = array();
|
||||||
|
while ($oDatasetUsers->next()) {
|
||||||
|
$totalRows++;
|
||||||
|
$row = $oDatasetUsers->getRow();
|
||||||
|
|
||||||
|
//Add the role information related to the user
|
||||||
|
try {
|
||||||
|
$uRole = $oRoles->loadByCode($row['USR_ROLE']);
|
||||||
|
} catch (\exception $oError) {
|
||||||
|
$uRole['ROL_NAME'] = G::loadTranslation('ID_DELETED');
|
||||||
|
}
|
||||||
|
$row['USR_ROLE_ID'] = $row['USR_ROLE'];
|
||||||
|
$row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['ROL_CODE']) : $uRole['ROL_CODE'];
|
||||||
|
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
if (true) {
|
||||||
|
$total = $oParticipated->getCountList($row['USR_UID']);
|
||||||
|
} else {
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
$total = $oAppCache->getListCounters('sent', $row['USR_UID'], false);
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
}
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
$row['TOTAL_CASES'] = $total;
|
||||||
|
|
||||||
|
$row['DUE_DATE_OK'] = (date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE']))) ? 0 : 1;
|
||||||
|
$row['LAST_LOGIN'] = isset($row['USR_LAST_LOGIN']) ? \ProcessMaker\Util\DateTime::convertUtcToTimeZone($row['USR_LAST_LOGIN']) : '';
|
||||||
|
//Add the department information related to the user
|
||||||
|
$row['DEP_TITLE'] = isset($aDepart[$row['USR_UID']]) ? $aDepart[$row['USR_UID']] : '';
|
||||||
|
//Add the authentication information related to the user
|
||||||
|
$row['USR_AUTH_SOURCE'] = isset($aAuthSources[$row['USR_UID']]) ? $aAuthSources[$row['USR_UID']] : 'ProcessMaker (MYSQL)';
|
||||||
|
|
||||||
|
$rows[] = $row;
|
||||||
|
}
|
||||||
|
$dataUsers['data'] = $rows;
|
||||||
|
$dataUsers['totalCount'] = $totalRows;
|
||||||
|
|
||||||
|
return $dataUsers;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ class Tracker extends Api
|
|||||||
public function Authentication($case, $pin)
|
public function Authentication($case, $pin)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oMobile = new \ProcessMaker\BusinessModel\Light\Tracker();
|
$response = \ProcessMaker\BusinessModel\Light\Tracker::authentication($case, $pin);
|
||||||
$response = $oMobile->authentication($case, $pin);
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Ext.onReady(function() {
|
|||||||
title : _('ID_TITLE_NO_INSTALL'),
|
title : _('ID_TITLE_NO_INSTALL'),
|
||||||
|
|
||||||
items:[
|
items:[
|
||||||
{html: _('ID_NO_INSTALL')}
|
{html: messageError}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user