PMCORE-547 Mapping User Information Between Active Directory and ProcessMaker allows selecting USR_ID in the User Field and breaks the correlative numeration of the USR_ID field in table USERS.
This commit is contained in:
22
database/factories/RbacAuthenticationSourceFactory.php
Normal file
22
database/factories/RbacAuthenticationSourceFactory.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Faker\Generator as Faker;
|
||||||
|
|
||||||
|
$factory->define(\ProcessMaker\Model\RbacAuthenticationSource::class, function (Faker $faker) {
|
||||||
|
return [
|
||||||
|
'AUTH_SOURCE_UID' => G::generateUniqueID(),
|
||||||
|
'AUTH_SOURCE_NAME' => $faker->title,
|
||||||
|
'AUTH_SOURCE_PROVIDER' => 'ldapAdvanced',
|
||||||
|
'AUTH_SOURCE_SERVER_NAME' => $faker->domainName,
|
||||||
|
'AUTH_SOURCE_PORT' => $faker->numberBetween(100, 1000),
|
||||||
|
'AUTH_SOURCE_ENABLED_TLS' => 0,
|
||||||
|
'AUTH_SOURCE_VERSION' => 3,
|
||||||
|
'AUTH_SOURCE_BASE_DN' => 'dc=processmaker,dc=test',
|
||||||
|
'AUTH_ANONYMOUS' => 0,
|
||||||
|
'AUTH_SOURCE_SEARCH_USER' => $faker->userName,
|
||||||
|
'AUTH_SOURCE_PASSWORD' => $faker->password,
|
||||||
|
'AUTH_SOURCE_ATTRIBUTES' => '',
|
||||||
|
'AUTH_SOURCE_OBJECT_CLASSES' => '',
|
||||||
|
'AUTH_SOURCE_DATA' => 'a:8:{s:9:"LDAP_TYPE";s:4:"ldap";s:25:"AUTH_SOURCE_AUTO_REGISTER";s:1:"0";s:31:"AUTH_SOURCE_IDENTIFIER_FOR_USER";s:3:"uid";s:24:"AUTH_SOURCE_USERS_FILTER";s:0:"";s:22:"AUTH_SOURCE_RETIRED_OU";s:0:"";s:20:"AUTH_SOURCE_SHOWGRID";s:2:"on";s:26:"AUTH_SOURCE_GRID_ATTRIBUTE";a:1:{i:1;a:2:{s:13:"attributeLdap";s:4:"test";s:13:"attributeUser";s:13:"USR_FIRSTNAME";}}s:20:"LDAP_PAGE_SIZE_LIMIT";i:1000;}'
|
||||||
|
];
|
||||||
|
});
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\methods\authSources;
|
||||||
|
|
||||||
|
use Faker\Factory;
|
||||||
|
use ProcessMaker\Model\RbacAuthenticationSource;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use RBAC;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AuthSourcesEditTest extends TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This set initial parameters for each test.
|
||||||
|
*/
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
$this->settingUserLogged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This starts a valid user in session with the appropriate permissions.
|
||||||
|
* @global object $RBAC
|
||||||
|
*/
|
||||||
|
private function settingUserLogged()
|
||||||
|
{
|
||||||
|
global $RBAC;
|
||||||
|
|
||||||
|
$user = User::where('USR_ID', '=', 1)
|
||||||
|
->get()
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$_SESSION['USER_LOGGED'] = $user['USR_UID'];
|
||||||
|
|
||||||
|
$RBAC = RBAC::getSingleton(PATH_DATA, session_id());
|
||||||
|
$RBAC->initRBAC();
|
||||||
|
$RBAC->loadUserRolePermission('PROCESSMAKER', $_SESSION['USER_LOGGED']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test the configuration page of a existent authentication source.
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_should_test_edit_configuration_page()
|
||||||
|
{
|
||||||
|
$string = "tables = 'APPLICATION|APP_SEQUENCE|APP_DELEGATION|APP_DOCUMENT|APP_MESSAGE|APP_OWNER|CONFIGURATION|CONTENT|DEPARTMENT|DYNAFORM|GROUPWF|GROUP_USER|HOLIDAY|INPUT_DOCUMENT|ISO_COUNTRY|ISO_LOCATION|ISO_SUBDIVISION|LANGUAGE|LEXICO|OUTPUT_DOCUMENT|PROCESS|PROCESS_OWNER|REPORT_TABLE|REPORT_VAR|ROUTE|STEP|STEP_TRIGGER|SWIMLANES_ELEMENTS|TASK|TASK_USER|TRANSLATION|TRIGGERS|USERS|APP_THREAD|APP_DELAY|PROCESS_USER|SESSION|DB_SOURCE|STEP_SUPERVISOR|OBJECT_PERMISSION|CASE_TRACKER|CASE_TRACKER_OBJECT|CASE_CONSOLIDATED|STAGE|SUB_PROCESS|SUB_APPLICATION|LOGIN_LOG|USERS_PROPERTIES|ADDITIONAL_TABLES|FIELDS|SHADOW_TABLE|EVENT|GATEWAY|APP_EVENT|APP_CACHE_VIEW|DIM_TIME_DELEGATE|DIM_TIME_COMPLETE|APP_HISTORY|APP_FOLDER|FIELD_CONDITION|LOG_CASES_SCHEDULER|CASE_SCHEDULER|CALENDAR_DEFINITION|CALENDAR_BUSINESS_HOURS|CALENDAR_HOLIDAYS|CALENDAR_ASSIGNMENTS|PROCESS_CATEGORY|APP_NOTES|DASHLET|DASHLET_INSTANCE|APP_SOLR_QUEUE|SEQUENCES|SESSION_STORAGE|PROCESS_FILES|WEB_ENTRY|OAUTH_ACCESS_TOKENS|OAUTH_AUTHORIZATION_CODES|OAUTH_CLIENTS|OAUTH_REFRESH_TOKENS|OAUTH_SCOPES|PMOAUTH_USER_ACCESS_TOKENS|BPMN_PROJECT|BPMN_PROCESS|BPMN_ACTIVITY|BPMN_ARTIFACT|BPMN_DIAGRAM|BPMN_BOUND|BPMN_DATA|BPMN_EVENT|BPMN_FLOW|BPMN_GATEWAY|BPMN_LANESET|BPMN_LANE|BPMN_PARTICIPANT|BPMN_EXTENSION|BPMN_DOCUMENTATION|PROCESS_VARIABLES|APP_TIMEOUT_ACTION_EXECUTED|ADDONS_STORE|ADDONS_MANAGER|LICENSE_MANAGER|APP_ASSIGN_SELF_SERVICE_VALUE|APP_ASSIGN_SELF_SERVICE_VALUE_GROUP|LIST_INBOX|LIST_PARTICIPATED_HISTORY|LIST_PARTICIPATED_LAST|LIST_COMPLETED|LIST_PAUSED|LIST_CANCELED|LIST_MY_INBOX|LIST_UNASSIGNED|LIST_UNASSIGNED_GROUP|MESSAGE_TYPE|MESSAGE_TYPE_VARIABLE|EMAIL_SERVER|WEB_ENTRY_EVENT|MESSAGE_EVENT_DEFINITION|MESSAGE_EVENT_RELATION|MESSAGE_APPLICATION|ELEMENT_TASK_RELATION|ABE_CONFIGURATION|ABE_REQUESTS|ABE_RESPONSES|USR_REPORTING|PRO_REPORTING|DASHBOARD|DASHBOARD_INDICATOR|DASHBOARD_DAS_IND|CATALOG|SCRIPT_TASK|TIMER_EVENT|EMAIL_EVENT|NOTIFICATION_DEVICE|GMAIL_RELABELING|NOTIFICATION_QUEUE|PLUGINS_REGISTRY|APP_DATA_CHANGE_LOG|JOBS_PENDING|JOBS_FAILED|RBAC_PERMISSIONS|RBAC_ROLES|RBAC_ROLES_PERMISSIONS|RBAC_SYSTEMS|RBAC_USERS|RBAC_USERS_ROLES|RBAC_AUTHENTICATION_SOURCE|' ";
|
||||||
|
$systemTablesPath = PATH_CONFIG . 'system-tables.ini';
|
||||||
|
if (!file_exists($systemTablesPath)) {
|
||||||
|
file_put_contents($systemTablesPath, $string);
|
||||||
|
} else {
|
||||||
|
$systemTables = @parse_ini_file($systemTablesPath);
|
||||||
|
if (!isset($systemTables['tables'])) {
|
||||||
|
file_put_contents($systemTablesPath, $string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$fileName = PATH_METHODS . 'authSources/authSources_Edit.php';
|
||||||
|
$_REQUEST['AUTH_SOURCE_PROVIDER'] = 'ldapAdvanced';
|
||||||
|
|
||||||
|
$authenticationSource = factory(RbacAuthenticationSource::class)
|
||||||
|
->create();
|
||||||
|
|
||||||
|
$_GET['sUID'] = $authenticationSource->AUTH_SOURCE_UID;
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
require_once $fileName;
|
||||||
|
$content = ob_get_clean();
|
||||||
|
|
||||||
|
//check if the variable is in the html content
|
||||||
|
$this->assertTrue(strpos($content, 'var Fields = ') !== false);
|
||||||
|
|
||||||
|
//check one of the required fields in the html content
|
||||||
|
$this->assertTrue(strpos($content, 'AUTH_SOURCE_PROVIDER') !== false);
|
||||||
|
|
||||||
|
//verify that this field is no longer present in the html content
|
||||||
|
$this->assertTrue(!(strpos($content, 'USR_ID') !== false));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\unit\workflow\engine\methods\authSources;
|
||||||
|
|
||||||
|
use Faker\Factory;
|
||||||
|
use ProcessMaker\Model\User;
|
||||||
|
use RBAC;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AuthSourcesNewTest extends TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This set initial parameters for each test.
|
||||||
|
*/
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
$this->settingUserLogged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This starts a valid user in session with the appropriate permissions.
|
||||||
|
* @global object $RBAC
|
||||||
|
*/
|
||||||
|
private function settingUserLogged()
|
||||||
|
{
|
||||||
|
global $RBAC;
|
||||||
|
|
||||||
|
$user = User::where('USR_ID', '=', 1)
|
||||||
|
->get()
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$_SESSION['USER_LOGGED'] = $user['USR_UID'];
|
||||||
|
|
||||||
|
$RBAC = RBAC::getSingleton(PATH_DATA, session_id());
|
||||||
|
$RBAC->initRBAC();
|
||||||
|
$RBAC->loadUserRolePermission('PROCESSMAKER', $_SESSION['USER_LOGGED']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test the configuration page of a new authentication source.
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_should_test_new_configuration_page()
|
||||||
|
{
|
||||||
|
$string = "tables = 'APPLICATION|APP_SEQUENCE|APP_DELEGATION|APP_DOCUMENT|APP_MESSAGE|APP_OWNER|CONFIGURATION|CONTENT|DEPARTMENT|DYNAFORM|GROUPWF|GROUP_USER|HOLIDAY|INPUT_DOCUMENT|ISO_COUNTRY|ISO_LOCATION|ISO_SUBDIVISION|LANGUAGE|LEXICO|OUTPUT_DOCUMENT|PROCESS|PROCESS_OWNER|REPORT_TABLE|REPORT_VAR|ROUTE|STEP|STEP_TRIGGER|SWIMLANES_ELEMENTS|TASK|TASK_USER|TRANSLATION|TRIGGERS|USERS|APP_THREAD|APP_DELAY|PROCESS_USER|SESSION|DB_SOURCE|STEP_SUPERVISOR|OBJECT_PERMISSION|CASE_TRACKER|CASE_TRACKER_OBJECT|CASE_CONSOLIDATED|STAGE|SUB_PROCESS|SUB_APPLICATION|LOGIN_LOG|USERS_PROPERTIES|ADDITIONAL_TABLES|FIELDS|SHADOW_TABLE|EVENT|GATEWAY|APP_EVENT|APP_CACHE_VIEW|DIM_TIME_DELEGATE|DIM_TIME_COMPLETE|APP_HISTORY|APP_FOLDER|FIELD_CONDITION|LOG_CASES_SCHEDULER|CASE_SCHEDULER|CALENDAR_DEFINITION|CALENDAR_BUSINESS_HOURS|CALENDAR_HOLIDAYS|CALENDAR_ASSIGNMENTS|PROCESS_CATEGORY|APP_NOTES|DASHLET|DASHLET_INSTANCE|APP_SOLR_QUEUE|SEQUENCES|SESSION_STORAGE|PROCESS_FILES|WEB_ENTRY|OAUTH_ACCESS_TOKENS|OAUTH_AUTHORIZATION_CODES|OAUTH_CLIENTS|OAUTH_REFRESH_TOKENS|OAUTH_SCOPES|PMOAUTH_USER_ACCESS_TOKENS|BPMN_PROJECT|BPMN_PROCESS|BPMN_ACTIVITY|BPMN_ARTIFACT|BPMN_DIAGRAM|BPMN_BOUND|BPMN_DATA|BPMN_EVENT|BPMN_FLOW|BPMN_GATEWAY|BPMN_LANESET|BPMN_LANE|BPMN_PARTICIPANT|BPMN_EXTENSION|BPMN_DOCUMENTATION|PROCESS_VARIABLES|APP_TIMEOUT_ACTION_EXECUTED|ADDONS_STORE|ADDONS_MANAGER|LICENSE_MANAGER|APP_ASSIGN_SELF_SERVICE_VALUE|APP_ASSIGN_SELF_SERVICE_VALUE_GROUP|LIST_INBOX|LIST_PARTICIPATED_HISTORY|LIST_PARTICIPATED_LAST|LIST_COMPLETED|LIST_PAUSED|LIST_CANCELED|LIST_MY_INBOX|LIST_UNASSIGNED|LIST_UNASSIGNED_GROUP|MESSAGE_TYPE|MESSAGE_TYPE_VARIABLE|EMAIL_SERVER|WEB_ENTRY_EVENT|MESSAGE_EVENT_DEFINITION|MESSAGE_EVENT_RELATION|MESSAGE_APPLICATION|ELEMENT_TASK_RELATION|ABE_CONFIGURATION|ABE_REQUESTS|ABE_RESPONSES|USR_REPORTING|PRO_REPORTING|DASHBOARD|DASHBOARD_INDICATOR|DASHBOARD_DAS_IND|CATALOG|SCRIPT_TASK|TIMER_EVENT|EMAIL_EVENT|NOTIFICATION_DEVICE|GMAIL_RELABELING|NOTIFICATION_QUEUE|PLUGINS_REGISTRY|APP_DATA_CHANGE_LOG|JOBS_PENDING|JOBS_FAILED|RBAC_PERMISSIONS|RBAC_ROLES|RBAC_ROLES_PERMISSIONS|RBAC_SYSTEMS|RBAC_USERS|RBAC_USERS_ROLES|RBAC_AUTHENTICATION_SOURCE|' ";
|
||||||
|
$systemTablesPath = PATH_CONFIG . 'system-tables.ini';
|
||||||
|
if (!file_exists($systemTablesPath)) {
|
||||||
|
file_put_contents($systemTablesPath, $string);
|
||||||
|
} else {
|
||||||
|
$systemTables = @parse_ini_file($systemTablesPath);
|
||||||
|
if (!isset($systemTables['tables'])) {
|
||||||
|
file_put_contents($systemTablesPath, $string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$fileName = PATH_METHODS . 'authSources/authSources_New.php';
|
||||||
|
$_REQUEST['AUTH_SOURCE_PROVIDER'] = 'ldapAdvanced';
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
require_once $fileName;
|
||||||
|
$content = ob_get_clean();
|
||||||
|
|
||||||
|
//check if the variable is in the html content
|
||||||
|
$this->assertTrue(strpos($content, 'var Fields = ') !== false);
|
||||||
|
|
||||||
|
//check one of the required fields in the html content
|
||||||
|
$this->assertTrue(strpos($content, 'AUTH_SOURCE_PROVIDER') !== false);
|
||||||
|
|
||||||
|
//verify that this field is no longer present in the html content
|
||||||
|
$this->assertTrue(!(strpos($content, 'USR_ID') !== false));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,44 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* authSources_Edit.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
|
|
||||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
G::header('location: ../login/login');
|
G::header('location: ../login/login');
|
||||||
die();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($_GET['sUID'])) {
|
if (!isset($_GET['sUID'])) {
|
||||||
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
||||||
G::header('location: authSources_List');
|
G::header('location: authSources_List');
|
||||||
die();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['sUID'] == '') {
|
if ($_GET['sUID'] == '') {
|
||||||
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
||||||
G::header('location: authSources_List');
|
G::header('location: authSources_List');
|
||||||
die();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
$G_MAIN_MENU = 'processmaker';
|
||||||
@@ -88,7 +67,7 @@ if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
|
|||||||
|
|
||||||
if ($pluginEnabled == 1) {
|
if ($pluginEnabled == 1) {
|
||||||
$data = executeQuery("DESCRIBE USERS");
|
$data = executeQuery("DESCRIBE USERS");
|
||||||
$fieldSet = array("USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_CREATE_DATE", "USR_UPDATE_DATE", "USR_COUNTRY", "USR_CITY", "USR_LOCATION", "DEP_UID", "USR_RESUME", "USR_ROLE", "USR_REPORTS_TO", "USR_REPLACED_BY", "USR_UX");
|
$fieldSet = ["USR_ID", "USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_CREATE_DATE", "USR_UPDATE_DATE", "USR_COUNTRY", "USR_CITY", "USR_LOCATION", "DEP_UID", "USR_RESUME", "USR_ROLE", "USR_REPORTS_TO", "USR_REPLACED_BY", "USR_UX"];
|
||||||
$attributes = null;
|
$attributes = null;
|
||||||
|
|
||||||
foreach ($data as $value) {
|
foreach ($data as $value) {
|
||||||
@@ -102,23 +81,21 @@ if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
|
|||||||
$oHeadPublisher = headPublisher::getSingleton();
|
$oHeadPublisher = headPublisher::getSingleton();
|
||||||
|
|
||||||
$oHeadPublisher->assign("Fields", $fields);
|
$oHeadPublisher->assign("Fields", $fields);
|
||||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/library', false, true);
|
$oHeadPublisher->addExtJsScript(PATH_TPL . 'ldapAdvanced/library', false, true);
|
||||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedForm', false, true);
|
$oHeadPublisher->addExtJsScript(PATH_TPL . 'ldapAdvanced/ldapAdvancedForm', false, true);
|
||||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedList', false, true);
|
$oHeadPublisher->addExtJsScript(PATH_TPL . 'ldapAdvanced/ldapAdvancedList', false, true);
|
||||||
G::RenderPage('publish', 'extJs');
|
G::RenderPage('publish', 'extJs');
|
||||||
die();
|
return;
|
||||||
}
|
}
|
||||||
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||||
} else {
|
} else {
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING')
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', ['MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING')]);
|
||||||
));
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||||
} else {
|
} else {
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.'
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', ['MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.']);
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* authSources_New.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
|
|
||||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
G::header('location: ../login/login');
|
G::header('location: ../login/login');
|
||||||
die();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
$G_MAIN_MENU = 'processmaker';
|
||||||
@@ -34,7 +13,7 @@ $G_SUB_MENU = 'users';
|
|||||||
$G_ID_MENU_SELECTED = 'USERS';
|
$G_ID_MENU_SELECTED = 'USERS';
|
||||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||||
|
|
||||||
$fields = array('AUTH_SOURCE_PROVIDER' => $_REQUEST['AUTH_SOURCE_PROVIDER']);
|
$fields = ['AUTH_SOURCE_PROVIDER' => $_REQUEST['AUTH_SOURCE_PROVIDER']];
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||||
@@ -43,7 +22,7 @@ if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER']
|
|||||||
//The attributes the users
|
//The attributes the users
|
||||||
|
|
||||||
$data = executeQuery("DESCRIBE USERS");
|
$data = executeQuery("DESCRIBE USERS");
|
||||||
$fieldSet = array("USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_CREATE_DATE", "USR_UPDATE_DATE", "USR_COUNTRY", "USR_CITY", "USR_LOCATION", "DEP_UID", "USR_RESUME", "USR_ROLE", "USR_REPORTS_TO", "USR_REPLACED_BY", "USR_UX");
|
$fieldSet = ["USR_ID", "USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_CREATE_DATE", "USR_UPDATE_DATE", "USR_COUNTRY", "USR_CITY", "USR_LOCATION", "DEP_UID", "USR_RESUME", "USR_ROLE", "USR_REPORTS_TO", "USR_REPLACED_BY", "USR_UX"];
|
||||||
$attributes = null;
|
$attributes = null;
|
||||||
|
|
||||||
foreach ($data as $value) {
|
foreach ($data as $value) {
|
||||||
@@ -54,23 +33,23 @@ if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER']
|
|||||||
$fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes;
|
$fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes;
|
||||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||||
$oHeadPublisher = headPublisher::getSingleton();
|
$oHeadPublisher = headPublisher::getSingleton();
|
||||||
|
|
||||||
$oHeadPublisher->assign("Fields", $fields);
|
$oHeadPublisher->assign("Fields", $fields);
|
||||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/library', false, true);
|
$oHeadPublisher->addExtJsScript(PATH_TPL . 'ldapAdvanced/library', false, true);
|
||||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedForm', false, true);
|
$oHeadPublisher->addExtJsScript(PATH_TPL . 'ldapAdvanced/ldapAdvancedForm', false, true);
|
||||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedList', false, true);
|
$oHeadPublisher->addExtJsScript(PATH_TPL . 'ldapAdvanced/ldapAdvancedList', false, true);
|
||||||
G::RenderPage('publish', 'extJs');
|
G::RenderPage('publish', 'extJs');
|
||||||
die();
|
return;
|
||||||
}
|
}
|
||||||
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||||
} else {
|
} else {
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING')));
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', ['MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING')]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||||
} else {
|
} else {
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.'));
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', ['MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ProcessMaker\Model;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class RbacAuthenticationSource extends Model
|
||||||
|
{
|
||||||
|
protected $table = "RBAC_AUTHENTICATION_SOURCE";
|
||||||
|
public $incrementing = false;
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user