Merged in 322ToDev (pull request #6135)
release/3.2.2 Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
17
Rakefile
17
Rakefile
@@ -1,5 +1,5 @@
|
||||
require 'rubygems'
|
||||
|
||||
require 'json'
|
||||
desc "Default Task - Build Library"
|
||||
task :default => [:required] do
|
||||
Rake::Task['build'].execute
|
||||
@@ -53,6 +53,7 @@ task :build => [:required] do
|
||||
mafeDir = targetDir + "/mafe"
|
||||
pmdynaformDir = targetDir + "/pmdynaform"
|
||||
|
||||
generateEnviromentVariables
|
||||
prepareDirs([targetDir, pmUIDir, mafeDir, pmdynaformDir, jsTargetDir, cssTargetDir, cssImagesTargetDir, imgTargetDir, pmUIFontsDir])
|
||||
|
||||
buildPmUi(Dir.pwd + "/vendor/colosa/pmUI", targetDir, mode)
|
||||
@@ -134,6 +135,20 @@ task :build => [:required] do
|
||||
#task argv1.to_sym do ; end
|
||||
end
|
||||
|
||||
def generateEnviromentVariables()
|
||||
puts "Creating System Constants..."
|
||||
content = "var __env = __env || {};"
|
||||
file = File.read('./config/enviromentvariables.json')
|
||||
dataUser = JSON.parse(file)
|
||||
content = content + "__env.USER_GUEST = " + JSON.generate(dataUser['constants']['userguest'])
|
||||
dir = "vendor/colosa/MichelangeloFE/src/enviroment/"
|
||||
# create a directory enviroment
|
||||
FileUtils.mkdir_p(dir)
|
||||
File.open(dir +'constants.js', 'w') { |fileWrite|
|
||||
fileWrite.write content + ';'
|
||||
}
|
||||
end
|
||||
|
||||
def buildPmUi(homeDir, targetDir, mode)
|
||||
puts "\nBuilding PMUI library".green.bold
|
||||
|
||||
|
||||
12
config/enviromentvariables.json
Normal file
12
config/enviromentvariables.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "Environment variables",
|
||||
"description": "Definition of system constants",
|
||||
"constants": {
|
||||
"userguest": {
|
||||
"uid": "00000000000000000000000000000002",
|
||||
"firstname": "Guest",
|
||||
"lastname": "Guest",
|
||||
"username": "guest"
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
21
gulpfile.js
21
gulpfile.js
@@ -471,7 +471,26 @@ gulp.task('clean', function () {
|
||||
cleanDirectory('workflow/public_html/lib');
|
||||
});
|
||||
|
||||
gulp.task('default', ['clean'], function (cb) {
|
||||
/**
|
||||
* This scheduled task is to be able to create the guest user constants
|
||||
*/
|
||||
gulp.task('__env', function (cb) {
|
||||
var data = require('./config/enviromentvariables.json'),
|
||||
pathEnviroment = 'vendor/colosa/MichelangeloFE/src/enviroment/',
|
||||
content = 'var __env = __env || {};';
|
||||
|
||||
gutil.log(gutil.colors.green('Creating System Constants...'));
|
||||
if (!fs.existsSync(pathEnviroment)){
|
||||
fs.mkdirSync(pathEnviroment);
|
||||
}
|
||||
fs.writeFile(
|
||||
pathEnviroment + 'constants.js',
|
||||
content + '__env.USER_GUEST = ' + JSON.stringify(data.constants.userguest) + ';',
|
||||
cb
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('default', ['clean', '__env'], function (cb) {
|
||||
var i, tasks = [];
|
||||
|
||||
gutil.log(gutil.colors.green('Initializing ProcessMaker building...'));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -115,6 +115,7 @@ class Roles extends BaseRoles {
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_UPDATE_DATE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_STATUS);
|
||||
$oCriteria->add(RolesPeer::ROL_UID, '', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(RolesPeer::ROL_CODE, RBAC::PROCESSMAKER_GUEST, Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(SystemsPeer::SYS_CODE, $systemCode);
|
||||
$oCriteria->add(RolesPeer::ROL_CREATE_DATE, '', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(RolesPeer::ROL_UPDATE_DATE, '', Criteria::NOT_EQUAL);
|
||||
@@ -158,7 +159,7 @@ class Roles extends BaseRoles {
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_CREATE_DATE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_UPDATE_DATE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_STATUS);
|
||||
$oCriteria->add(RolesPeer::ROL_UID, '', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(RolesPeer::ROL_UID, ['', RBAC::PROCESSMAKER_GUEST_UID], Criteria::NOT_IN);
|
||||
$oCriteria->add(SystemsPeer::SYS_CODE, $systemCode);
|
||||
$oCriteria->add(RolesPeer::ROL_CREATE_DATE, '', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(RolesPeer::ROL_UPDATE_DATE, '', Criteria::NOT_EQUAL);
|
||||
@@ -572,7 +573,7 @@ class Roles extends BaseRoles {
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$result->next();
|
||||
|
||||
$a = Array();
|
||||
$a = [RBAC::PM_GUEST_CASE_UID];
|
||||
while( $row = $result->getRow() ) {
|
||||
$a[] = $row['PER_UID'];
|
||||
$result->next();
|
||||
|
||||
@@ -63,13 +63,15 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000062','PM_EDIT_USER_PROFILE_DEFAULT_MAIN_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000063','PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000064','PM_REASSIGNCASE_SUPERVISOR','2016-09-01 00:00:00','2016-09-01 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000065','PM_SETUP_CUSTOM_CASES_LIST','2017-03-27 00:00:00','2017-03-27 00:00:00',1,'00000000000000000000000000000002');
|
||||
('00000000000000000000000000000065','PM_SETUP_CUSTOM_CASES_LIST','2017-03-27 00:00:00','2017-03-27 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000066','PM_GUEST_CASE','2017-03-27 00:00:00','2017-03-27 00:00:00',1,'00000000000000000000000000000002');
|
||||
|
||||
INSERT INTO `RBAC_ROLES` VALUES
|
||||
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
('00000000000000000000000000000002','','00000000000000000000000000000002','PROCESSMAKER_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
('00000000000000000000000000000003','','00000000000000000000000000000002','PROCESSMAKER_OPERATOR','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
('00000000000000000000000000000004', '', '00000000000000000000000000000002', 'PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1);
|
||||
('00000000000000000000000000000004', '', '00000000000000000000000000000002', 'PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1),
|
||||
('00000000000000000000000000000005', '', '00000000000000000000000000000002', 'PROCESSMAKER_GUEST', '2009-02-01 12:24:36', '2009-02-01 12:24:36', 1);
|
||||
|
||||
|
||||
INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
||||
@@ -213,8 +215,11 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000004','00000000000000000000000000000060'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000061'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000062'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000063');
|
||||
('00000000000000000000000000000004','00000000000000000000000000000063'),
|
||||
('00000000000000000000000000000005','00000000000000000000000000000066');
|
||||
|
||||
INSERT INTO `RBAC_SYSTEMS` VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1),('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||
INSERT INTO `RBAC_USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','');
|
||||
INSERT INTO `RBAC_USERS_ROLES` VALUES ('00000000000000000000000000000001','00000000000000000000000000000002');
|
||||
INSERT INTO `RBAC_USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','',''),
|
||||
('00000000000000000000000000000002','guest','674ba9750749d735ec9787d606170d78','Guest','','guest@processmaker.com','2200-01-01','2009-02-01 12:24:36','2009-02-01 12:24:36',0,'MYSQL','00000000000000000000000000000000','','');
|
||||
INSERT INTO `RBAC_USERS_ROLES` VALUES ('00000000000000000000000000000001','00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000005');
|
||||
|
||||
@@ -77,28 +77,38 @@ class Groups
|
||||
/**
|
||||
* Set a user to group
|
||||
*
|
||||
* @param string $GrpUid, $UsrUid
|
||||
* @return array
|
||||
* @param string $grpUid
|
||||
* @param string $usrUid
|
||||
* @return boolean
|
||||
* @throws exception
|
||||
*/
|
||||
public function addUserToGroup($GrpUid, $UsrUid)
|
||||
public function addUserToGroup($grpUid, $usrUid)
|
||||
{
|
||||
try {
|
||||
$oGrp = GroupUserPeer::retrieveByPk($GrpUid, $UsrUid);
|
||||
if (is_object($oGrp) && get_class($oGrp) == 'GroupUser') {
|
||||
//Check the usrUid value
|
||||
if (RBAC::isGuestUserUid($usrUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($usrUid)));
|
||||
return false;
|
||||
}
|
||||
|
||||
$groupUser = GroupUserPeer::retrieveByPk($grpUid, $usrUid);
|
||||
if (is_object($groupUser) && get_class($groupUser) == 'GroupUser') {
|
||||
return true;
|
||||
} else {
|
||||
$oGrp = new GroupUser();
|
||||
$oGrp->setGrpUid($GrpUid);
|
||||
$oGrp->setUsrUid($UsrUid);
|
||||
$oGrp->Save();
|
||||
$groupUser = new GroupUser();
|
||||
$groupUser->setGrpUid($grpUid);
|
||||
$groupUser->setUsrUid($usrUid);
|
||||
$groupUser->Save();
|
||||
|
||||
$oGrpwf = new Groupwf();
|
||||
$grpName = $oGrpwf->loadByGroupUid($GrpUid);
|
||||
$groupWf = new Groupwf();
|
||||
$grpName = $groupWf->loadByGroupUid($grpUid);
|
||||
|
||||
$oUsr = new Users();
|
||||
$usrName = $oUsr->load($UsrUid);
|
||||
$users = new Users();
|
||||
$usrName = $users->load($usrUid);
|
||||
|
||||
G::auditLog("AssignUserToGroup", "Assign user ". $usrName['USR_USERNAME'] ." (".$UsrUid.") to group ".$grpName['CON_VALUE']." (".$GrpUid.") ");
|
||||
G::auditLog("AssignUserToGroup", "Assign user ". $usrName['USR_USERNAME'] ." (".$usrUid.") to group ".$grpName['CON_VALUE']." (".$grpUid.") ");
|
||||
|
||||
return true;
|
||||
}
|
||||
} catch (exception $oError) {
|
||||
throw ($oError);
|
||||
@@ -107,13 +117,14 @@ class Groups
|
||||
|
||||
/**
|
||||
* Remove a user from group
|
||||
* @param string $GrpUid, $UsrUid
|
||||
* @param string $grpUid
|
||||
* @param string $usrUid
|
||||
* @return array
|
||||
*/
|
||||
public function removeUserOfGroup($GrpUid, $UsrUid)
|
||||
public function removeUserOfGroup($grpUid, $usrUid)
|
||||
{
|
||||
$gu = new GroupUser();
|
||||
$gu->remove($GrpUid, $UsrUid);
|
||||
$gu->remove($grpUid, $usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,33 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* TaskUser.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseTaskUser.php';
|
||||
//require_once 'classes/model/Content.php';
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'GROUP_USER' table.
|
||||
*
|
||||
@@ -39,42 +10,59 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
use ProcessMaker\BusinessModel\WebEntry;
|
||||
class TaskUser extends BaseTaskUser
|
||||
{
|
||||
|
||||
/**
|
||||
* Create the application document registry
|
||||
* Create the new record in the table TaskUser
|
||||
*
|
||||
* @param array $aData
|
||||
* @param array $requestData
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function create ($aData)
|
||||
public function create ($requestData)
|
||||
{
|
||||
$oConnection = Propel::getConnection( TaskUserPeer::DATABASE_NAME );
|
||||
$connection = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
|
||||
try {
|
||||
$taskUser = TaskUserPeer::retrieveByPK( $aData['TAS_UID'], $aData['USR_UID'], $aData['TU_TYPE'], $aData['TU_RELATION'] );
|
||||
|
||||
if (is_object( $taskUser )) {
|
||||
return - 1;
|
||||
$bmWebEntry = new WebEntry;
|
||||
//Check the usrUid value
|
||||
if (RBAC::isGuestUserUid($requestData['USR_UID']) && !$bmWebEntry->isTaskAWebEntry($requestData['TAS_UID'])) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($requestData['USR_UID'])));
|
||||
return false;
|
||||
}
|
||||
$oTaskUser = new TaskUser();
|
||||
$oTaskUser->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($oTaskUser->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oTaskUser->save();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
|
||||
$taskUser = TaskUserPeer::retrieveByPK(
|
||||
$requestData['TAS_UID'],
|
||||
$requestData['USR_UID'],
|
||||
$requestData['TU_TYPE'],
|
||||
$requestData['TU_RELATION']
|
||||
);
|
||||
|
||||
if (is_object($taskUser)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
$taskUser = new TaskUser();
|
||||
$taskUser->fromArray($requestData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($taskUser->validate()) {
|
||||
$connection->begin();
|
||||
$result = $taskUser->save();
|
||||
$connection->commit();
|
||||
|
||||
return $result;
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oTaskUser->getValidationFailures();
|
||||
$message = '';
|
||||
$aValidationFailures = $taskUser->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
$message .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw (new Exception( 'The registry cannot be created!<br />' . $sMessage ));
|
||||
throw (new Exception('The registry cannot be created!<br />' . $message));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
$connection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,10 +281,20 @@ class Users extends BaseUsers
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all information about the user
|
||||
* @param string $userUid
|
||||
* @return array $arrayData
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getAllInformation ($userUid)
|
||||
{
|
||||
if (! isset( $userUid ) || $userUid == "") {
|
||||
throw (new Exception( "$userUid is empty." ));
|
||||
if (!isset($userUid) || empty($userUid)) {
|
||||
throw (new Exception('$userUid is empty.'));
|
||||
}
|
||||
if (RBAC::isGuestUserUid($userUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($userUid)));
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
INSERT INTO USERS (USR_UID,USR_USERNAME,USR_PASSWORD,USR_FIRSTNAME,USR_LASTNAME,USR_EMAIL,USR_DUE_DATE,USR_CREATE_DATE,USR_UPDATE_DATE,USR_STATUS,USR_COUNTRY,USR_CITY,USR_LOCATION,USR_ADDRESS,USR_PHONE,USR_FAX,USR_CELLULAR,USR_ZIP_CODE,DEP_UID,USR_POSITION,USR_RESUME,USR_BIRTHDAY,USR_ROLE,USR_REPORTS_TO,USR_REPLACED_BY ) VALUES
|
||||
('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator',' ', 'admin@processmaker.com','2020-01-01','1999-11-30 00:00:00','2008-05-23 18:36:19','ACTIVE', 'US','FL','MMK','','', '1-305-402-0282','1-305-675-1400','','','Administrator', '','1999-02-25','PROCESSMAKER_ADMIN','','');
|
||||
('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator',' ', 'admin@processmaker.com','2020-01-01','1999-11-30 00:00:00','2008-05-23 18:36:19','ACTIVE', 'US','FL','MMK','','', '1-305-402-0282','1-305-675-1400','','','Administrator', '','1999-02-25','PROCESSMAKER_ADMIN','',''),
|
||||
('00000000000000000000000000000002','guest','674ba9750749d735ec9787d606170d78','Guest',' ', 'guest@processmaker.com','2200-01-01','2009-02-01 12:24:36','2009-02-01 12:24:36','INACTIVE', 'US','FL','MMK','','', '1-305-402-0282','1-305-675-1400','','','Guest', '','2009-02-01','PROCESSMAKER_GUEST','','');
|
||||
|
||||
INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES
|
||||
('ROL_NAME','','00000000000000000000000000000002','en','System Administrator'),
|
||||
|
||||
@@ -64,6 +64,7 @@ if ($actionAjax == "userValues") {
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_ID);
|
||||
break;
|
||||
}
|
||||
$cUsers->add(UsersPeer::USR_UID, [RBAC::GUEST_USER_UID], Criteria::NOT_IN);
|
||||
$cUsers->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
if (!is_null($query)) {
|
||||
$filters = $cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $query . '%', Criteria::LIKE)->addOr(
|
||||
|
||||
@@ -1,38 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* main.php Cases List main processor
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
$RBAC->requirePermissions( 'PM_CASES' );
|
||||
$RBAC->requirePermissions('PM_CASES/strict');
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
|
||||
$_POST['qs'] = isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
|
||||
$_POST['qs'] = isset($_SERVER['QUERY_STRING'])
|
||||
&& $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_Load' );
|
||||
$G_PUBLISH->AddContent('view', 'cases/cases_Load');
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/PM.js');
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js');
|
||||
G::RenderPage( 'publish' );
|
||||
G::RenderPage('publish');
|
||||
|
||||
|
||||
@@ -252,7 +252,8 @@ switch ($_POST['action']) {
|
||||
$subQuery = "SELECT " . GroupUserPeer::USR_UID .
|
||||
" FROM " . GroupUserPeer::TABLE_NAME .
|
||||
" WHERE " . GroupUserPeer::GRP_UID . " = '" .
|
||||
$inputFilter->quoteSmart($_REQUEST['gUID'], Propel::getConnection("workflow")) . "'";
|
||||
$inputFilter->quoteSmart($_REQUEST['gUID'], Propel::getConnection("workflow")) . "'\n" .
|
||||
"UNION SELECT '" . RBAC::GUEST_USER_UID . "'";
|
||||
|
||||
$aUsers = Array ();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
|
||||
@@ -293,7 +293,7 @@ try {
|
||||
|
||||
// Assign the uid of user to userloggedobj
|
||||
$RBAC->loadUserRolePermission($RBAC->sSystem, $uid);
|
||||
$res = $RBAC->userCanAccess('PM_LOGIN');
|
||||
$res = $RBAC->userCanAccess('PM_LOGIN/strict');
|
||||
if ($res != 1 ) {
|
||||
if ($res == -2) {
|
||||
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error");
|
||||
|
||||
@@ -981,14 +981,7 @@ function ifPermission($sessionId, $permission)
|
||||
|
||||
$oRBAC = RBAC::getSingleton();
|
||||
$oRBAC->loadUserRolePermission($oRBAC->sSystem, $user['USR_UID']);
|
||||
$aPermissions = $oRBAC->aUserInfo[$oRBAC->sSystem]['PERMISSIONS'];
|
||||
$sw = 0;
|
||||
|
||||
foreach ($aPermissions as $aPermission) {
|
||||
if ($aPermission['PER_CODE'] == $permission) {
|
||||
$sw = 1;
|
||||
}
|
||||
}
|
||||
$sw = $oRBAC->userCanAccess($permission) === 1 ? 1 : 0;
|
||||
|
||||
return $sw;
|
||||
}
|
||||
|
||||
@@ -8,33 +8,33 @@ global $RBAC;
|
||||
G::LoadClass('pmFunctions');
|
||||
try {
|
||||
if (empty($_REQUEST['we_uid'])) {
|
||||
throw new \Exception('Missing required field "we_uid"');
|
||||
throw new Exception('Missing required field "we_uid"');
|
||||
}
|
||||
|
||||
$weUid = $_REQUEST['we_uid'];
|
||||
|
||||
$webEntry = \WebEntryPeer::retrieveByPK($weUid);
|
||||
$webEntry = WebEntryPeer::retrieveByPK($weUid);
|
||||
if (empty($webEntry)) {
|
||||
throw new \Exception('Undefined WebEntry');
|
||||
throw new Exception('Undefined WebEntry');
|
||||
}
|
||||
|
||||
$userUid = $webEntry->getUsrUid();
|
||||
$userInfo = PMFInformationUser($userUid);
|
||||
$userInfo = UsersPeer::retrieveByPK($userUid);
|
||||
if (empty($userInfo)) {
|
||||
throw new \Exception('WebEntry User not found');
|
||||
throw new Exception('WebEntry User not found');
|
||||
}
|
||||
|
||||
initUserSession($userUid, $userInfo['username']);
|
||||
initUserSession($userUid, $userInfo->getUsrUsername());
|
||||
|
||||
$result = [
|
||||
'user_logged' => $userUid,
|
||||
'userName' => $userInfo['username'],
|
||||
'firstName' => $userInfo['firstname'],
|
||||
'lastName' => $userInfo['lastname'],
|
||||
'mail' => $userInfo['mail'],
|
||||
'user_logged' => $userUid,
|
||||
'userName' => $userInfo->getUsrUsername(),
|
||||
'firstName' => $userInfo->getUsrFirstName(),
|
||||
'lastName' => $userInfo->getUsrLastName(),
|
||||
'mail' => $userInfo->getUsrEmail(),
|
||||
'image' => '../users/users_ViewPhoto?t='.microtime(true),
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$result = [
|
||||
'error' => $e->getMessage(),
|
||||
];
|
||||
|
||||
@@ -1,31 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* dashboard.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.
|
||||
*/
|
||||
|
||||
$RBAC->requirePermissions('PM_DASHBOARD');
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if (!$licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
}
|
||||
|
||||
@@ -33,10 +11,10 @@ $G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'DASHBOARD+';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'strategicDashboard/load' );
|
||||
$G_PUBLISH->AddContent('view', 'strategicDashboard/load');
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/PM.js');
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js');
|
||||
G::RenderPage( 'publish' );
|
||||
G::RenderPage('publish');
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
|
||||
//Check guest user
|
||||
if (isset($_GET['USR_UID']) && RBAC::isGuestUserUid($_GET['USR_UID'])) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($_GET['USR_UID'])));
|
||||
return;
|
||||
}
|
||||
|
||||
//calculating the max upload file size;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
|
||||
@@ -95,6 +95,11 @@ try {
|
||||
$total = $webEntry->getWebEntryRelatedToUser($userUid);
|
||||
}
|
||||
|
||||
//check user guest
|
||||
if (RBAC::isGuestUserUid($userUid)) {
|
||||
$total++;
|
||||
}
|
||||
|
||||
$response = '{success: true, candelete: ';
|
||||
$response .= ($total > 0) ? 'false' : 'true';
|
||||
$response .= ', hashistory: ';
|
||||
|
||||
@@ -43,20 +43,25 @@ class Catalog
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Catalog
|
||||
* Update Catalog.
|
||||
*
|
||||
* @param string $cat_uid Unique id of Group
|
||||
* @param string $cat_type Unique id of Group
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the new Group update
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @return array Return data of the new Group update
|
||||
*
|
||||
* @access private
|
||||
* @deprecated since 3.2.2
|
||||
*/
|
||||
public function update($cat_uid, $cat_type, $arrayData)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->update($cat_uid, $cat_type, $arrayData);
|
||||
$arrayData['CAT_UID'] = $cat_uid;
|
||||
$arrayData['CAT_TYPE'] = !isset($arrayData['CAT_TYPE'])
|
||||
? $cat_type
|
||||
: $arrayData['CAT_TYPE'];
|
||||
$response = $catalog->createOrUpdate($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -110,6 +110,8 @@ class User
|
||||
'PREF_DEFAULT_CASES_MENUSELECTED' => 'PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS'
|
||||
);
|
||||
|
||||
private $guestUser = RBAC::GUEST_USER_UID;
|
||||
|
||||
/**
|
||||
* Constructor of the class
|
||||
*/
|
||||
@@ -124,6 +126,16 @@ class User
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the guest user defined
|
||||
*
|
||||
* @return string guestUser, uid related to this user
|
||||
*/
|
||||
public function getGuestUser()
|
||||
{
|
||||
return $this->guestUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -640,6 +652,10 @@ class User
|
||||
{
|
||||
try {
|
||||
|
||||
//check user guest
|
||||
if (RBAC::isGuestUserUid($userUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($userUid)));
|
||||
}
|
||||
|
||||
//Verify data
|
||||
$validator = new Validator();
|
||||
@@ -1078,6 +1094,12 @@ class User
|
||||
$history += ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
|
||||
$history += ApplicationPeer::doCount($c);
|
||||
|
||||
//check user guest
|
||||
if (RBAC::isGuestUserUid($usrUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_MSG_CANNOT_DELETE_USER", array($USR_UID)));
|
||||
}
|
||||
|
||||
if ($total > 0) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_BE_DELETED", array($USR_UID)));
|
||||
} else {
|
||||
@@ -1182,6 +1204,9 @@ class User
|
||||
//Query
|
||||
$criteria = $this->getUserCriteria();
|
||||
|
||||
//Remove the guest user
|
||||
$criteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
|
||||
|
||||
if ($flagCondition && !empty($arrayWhere['condition'])) {
|
||||
foreach ($arrayWhere['condition'] as $value) {
|
||||
$criteria->add($value[0], $value[1], $value[2]);
|
||||
@@ -1556,6 +1581,9 @@ class User
|
||||
}
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
||||
|
||||
//Remove the guest user
|
||||
$oCriteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
|
||||
|
||||
if ($authSource != '') {
|
||||
$totalRows = sizeof($aUsers);
|
||||
} else {
|
||||
@@ -1583,6 +1611,10 @@ class User
|
||||
$oCriteria->addAsColumn('DUE_DATE_OK', 1);
|
||||
$sep = "'";
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
||||
|
||||
//Remove the guest user
|
||||
$oCriteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
|
||||
|
||||
if ($filter != '') {
|
||||
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE)
|
||||
->addOr($oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -91,7 +91,7 @@ class PluginRegistry
|
||||
public static function newInstance()
|
||||
{
|
||||
self::$instance = new PluginRegistry();
|
||||
if (! is_object(self::$instance) || get_class(self::$instance) != "ProcessMaker\Plugins\PluginRegistry") {
|
||||
if (!is_object(self::$instance) || get_class(self::$instance) != "ProcessMaker\Plugins\PluginRegistry") {
|
||||
throw new Exception("Can't load main PluginRegistry object.");
|
||||
}
|
||||
return self::$instance;
|
||||
@@ -121,10 +121,10 @@ class PluginRegistry
|
||||
$plugin->sDescription,
|
||||
$plugin->sSetupPage,
|
||||
$plugin->iVersion,
|
||||
isset($plugin->sCompanyLogo) ? $plugin->sCompanyLogo: '',
|
||||
isset($plugin->aWorkspaces) ? $plugin->aWorkspaces: [],
|
||||
isset($plugin->enable) ? $plugin->enable: false,
|
||||
isset($plugin->bPrivate) ? $plugin->bPrivate: false
|
||||
isset($plugin->sCompanyLogo) ? $plugin->sCompanyLogo : '',
|
||||
isset($plugin->aWorkspaces) ? $plugin->aWorkspaces : [],
|
||||
isset($plugin->enable) ? $plugin->enable : false,
|
||||
isset($plugin->bPrivate) ? $plugin->bPrivate : false
|
||||
);
|
||||
$this->_aPluginDetails[$Namespace] = $detail;
|
||||
}
|
||||
@@ -203,6 +203,7 @@ class PluginRegistry
|
||||
}
|
||||
Cache::pull(config("system.workspace") . __CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the plugin details, by filename
|
||||
* @param string $Filename
|
||||
@@ -475,7 +476,7 @@ class PluginRegistry
|
||||
if (isset($this->_aPluginDetails[$Namespace])) {
|
||||
/** @var PluginDetail $detail */
|
||||
$detail = $this->_aPluginDetails[$Namespace];
|
||||
$className= $detail->getClassName();
|
||||
$className = $detail->getClassName();
|
||||
/** @var enterprisePlugin $oPlugin */
|
||||
$oPlugin = new $className($detail->getNamespace(), $detail->getFile());
|
||||
$oPlugin->setup();
|
||||
@@ -856,13 +857,13 @@ class PluginRegistry
|
||||
require_once($classFile);
|
||||
$sClassNameA = substr($this->_aPluginDetails[$trigger->getNamespace()]->getClassName(), 0, 1) .
|
||||
str_replace(
|
||||
['Plugin','plugin'],
|
||||
['Plugin', 'plugin'],
|
||||
'Class',
|
||||
substr($this->_aPluginDetails[$trigger->getNamespace()]->getClassName(), 1)
|
||||
);
|
||||
$sClassNameB = substr($this->_aPluginDetails[$trigger->getNamespace()]->getClassName(), 0, 1) .
|
||||
str_replace(
|
||||
['Plugin','plugin'],
|
||||
['Plugin', 'plugin'],
|
||||
'class',
|
||||
substr($this->_aPluginDetails[$trigger->getNamespace()]->getClassName(), 1)
|
||||
);
|
||||
@@ -890,7 +891,7 @@ class PluginRegistry
|
||||
public function existsTrigger($TriggerId)
|
||||
{
|
||||
$found = false;
|
||||
/** @var TriggerDetail $trigger */
|
||||
/** @var TriggerDetail $trigger */
|
||||
foreach ($this->_aTriggers as $trigger) {
|
||||
if ($trigger->equalTriggerId($TriggerId)) {
|
||||
//review all folders registered for this namespace
|
||||
@@ -1124,7 +1125,8 @@ class PluginRegistry
|
||||
$ActionSave,
|
||||
$ActionExecute,
|
||||
$ActionGetFields
|
||||
) {
|
||||
)
|
||||
{
|
||||
$found = false;
|
||||
/** @var CaseSchedulerPlugin $caseScheduler */
|
||||
foreach ($this->_aCaseSchedulerPlugin as $caseScheduler) {
|
||||
@@ -1244,15 +1246,18 @@ class PluginRegistry
|
||||
*/
|
||||
public function registerExtendsRestService($Namespace, $ClassName)
|
||||
{
|
||||
$baseSrcPluginPath = PATH_PLUGINS . $Namespace . PATH_SEP . "src";
|
||||
$apiPath = PATH_SEP . "Services" . PATH_SEP . "Ext" . PATH_SEP;
|
||||
$baseSrcPluginPath = PATH_PLUGINS . $Namespace . PATH_SEP . 'src';
|
||||
$apiPath = PATH_SEP . 'Services' . PATH_SEP . 'Ext' . PATH_SEP;
|
||||
$classFile = $baseSrcPluginPath . $apiPath . 'Ext' . $ClassName . '.php';
|
||||
if (file_exists($classFile)) {
|
||||
$this->_restExtendServices[$Namespace][$ClassName] = array(
|
||||
"filePath" => $classFile,
|
||||
"classParent" => $ClassName,
|
||||
"classExtend" => 'Ext' . $ClassName
|
||||
);
|
||||
if (empty($this->_restExtendServices[$Namespace])) {
|
||||
$this->_restExtendServices[$Namespace] = new stdClass();
|
||||
}
|
||||
$this->_restExtendServices[$Namespace]->{$ClassName} = [
|
||||
'filePath' => $classFile,
|
||||
'classParent' => $ClassName,
|
||||
'classExtend' => 'Ext' . $ClassName
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1263,10 +1268,10 @@ class PluginRegistry
|
||||
*/
|
||||
public function getExtendsRestService($ClassName)
|
||||
{
|
||||
$responseRestExtendService = array();
|
||||
$responseRestExtendService = [];
|
||||
foreach ($this->_restExtendServices as $Namespace => $restExtendService) {
|
||||
if (isset($restExtendService[$ClassName])) {
|
||||
$responseRestExtendService = $restExtendService[$ClassName];
|
||||
if (isset($restExtendService->{$ClassName})) {
|
||||
$responseRestExtendService = $restExtendService->{$ClassName};
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1281,10 +1286,10 @@ class PluginRegistry
|
||||
*/
|
||||
public function disableExtendsRestService($Namespace, $ClassName = '')
|
||||
{
|
||||
if (isset($this->_restExtendServices[$Namespace][$ClassName]) && !empty($ClassName)) {
|
||||
unset($this->_restExtendServices[$Namespace][$ClassName]);
|
||||
} elseif (empty($ClassName)) {
|
||||
if (empty($ClassName)) {
|
||||
unset($this->_restExtendServices[$Namespace]);
|
||||
} elseif (isset($this->_restExtendServices[$Namespace]->{$ClassName})) {
|
||||
unset($this->_restExtendServices[$Namespace]->{$ClassName});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2086,7 +2086,8 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$arrayResult = $webEntryEvent->update(
|
||||
$arrayWebEntryEventData['WEE_UID'],
|
||||
$bpmnProject->getPrjAuthor(),
|
||||
(!is_null($arrayData))? $arrayData : $arrayWebEntryEventData
|
||||
(!is_null($arrayData))? $arrayData : $arrayWebEntryEventData,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +63,14 @@ class ActionsByEmail extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update template.
|
||||
*
|
||||
* @url PUT /updateTemplate
|
||||
*
|
||||
* @param type $params
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function updateTemplate($params)
|
||||
{
|
||||
@@ -81,8 +87,16 @@ class ActionsByEmail extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update configuration.
|
||||
*
|
||||
* @url PUT /saveConfiguration
|
||||
*
|
||||
* @param type $params
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function saveConfiguration($params)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user