BUG 6529 fixing other minor problems in ldap syncrhonization
fixed bug in saving imported root department fixed bug in saving an display dropdowns in authSources edit
This commit is contained in:
@@ -33,6 +33,11 @@ class AuthenticationSource extends BaseAuthenticationSource {
|
|||||||
$oAuthenticationSource = AuthenticationSourcePeer::retrieveByPK($sUID);
|
$oAuthenticationSource = AuthenticationSourcePeer::retrieveByPK($sUID);
|
||||||
if (!is_null($oAuthenticationSource)) {
|
if (!is_null($oAuthenticationSource)) {
|
||||||
$aFields = $oAuthenticationSource->toArray(BasePeer::TYPE_FIELDNAME);
|
$aFields = $oAuthenticationSource->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
|
//fixing the problem where the BaseDN has spaces. we are removing the spaces.
|
||||||
|
$baseDn = explode(',', $aFields['AUTH_SOURCE_BASE_DN']);
|
||||||
|
foreach ($baseDn as $key => $val ) $baseDn[$key] = trim($val);
|
||||||
|
$aFields['AUTH_SOURCE_BASE_DN'] = implode (',', $baseDn);
|
||||||
|
|
||||||
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
|
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
|
||||||
$aFields['AUTH_SOURCE_DATA'] = ($aFields['AUTH_SOURCE_DATA'] != '' ? unserialize($aFields['AUTH_SOURCE_DATA']) : array());
|
$aFields['AUTH_SOURCE_DATA'] = ($aFields['AUTH_SOURCE_DATA'] != '' ? unserialize($aFields['AUTH_SOURCE_DATA']) : array());
|
||||||
return $aFields;
|
return $aFields;
|
||||||
|
|||||||
@@ -22,48 +22,56 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
global $RBAC;
|
|
||||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_GET['sUID'])) {
|
global $RBAC;
|
||||||
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||||
G::header('location: authSources_List');
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
die;
|
G::header('location: ../login/login');
|
||||||
}
|
die;
|
||||||
|
|
||||||
if ($_GET['sUID'] == '') {
|
|
||||||
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
|
||||||
G::header('location: authSources_List');
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
|
||||||
$G_SUB_MENU = 'users';
|
|
||||||
$G_ID_MENU_SELECTED = 'USERS';
|
|
||||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
|
||||||
|
|
||||||
$aFields = $RBAC->getAuthSource($_GET['sUID']);
|
|
||||||
if (is_array($aFields['AUTH_SOURCE_DATA'])) {
|
|
||||||
foreach($aFields['AUTH_SOURCE_DATA'] as $sField => $sValue) {
|
|
||||||
$aFields[$sField] = $sValue;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
unset($aFields['AUTH_SOURCE_DATA']);
|
if (!isset($_GET['sUID'])) {
|
||||||
|
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
||||||
$G_PUBLISH = new Publisher();
|
G::header('location: authSources_List');
|
||||||
if ($aFields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
|
die;
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/ldapEdit', '', $aFields, '../authSources/authSources_Save');
|
}
|
||||||
}
|
|
||||||
else {
|
if ($_GET['sUID'] == '') {
|
||||||
if (file_exists(PATH_XMLFORM . 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $aFields, '../authSources/authSources_Save');
|
G::header('location: authSources_List');
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
|
$G_MAIN_MENU = 'processmaker';
|
||||||
|
$G_SUB_MENU = 'users';
|
||||||
|
$G_ID_MENU_SELECTED = 'USERS';
|
||||||
|
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||||
|
|
||||||
|
$aFields = $RBAC->getAuthSource($_GET['sUID']);
|
||||||
|
if (is_array($aFields['AUTH_SOURCE_DATA'])) {
|
||||||
|
foreach($aFields['AUTH_SOURCE_DATA'] as $sField => $sValue) {
|
||||||
|
$aFields[$sField] = $sValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($aFields['AUTH_SOURCE_DATA']);
|
||||||
|
|
||||||
|
//fixing a problem with dropdown with int values,
|
||||||
|
//the problem : the value was integer, but the dropdown was expecting a string value, and they returns always the first item of dropdown
|
||||||
|
if ( isset($aFields['AUTH_SOURCE_ENABLED_TLS']))
|
||||||
|
$aFields['AUTH_SOURCE_ENABLED_TLS'] = sprintf('%d', $aFields['AUTH_SOURCE_ENABLED_TLS'] );
|
||||||
|
if ( isset($aFields['AUTH_ANONYMOUS']))
|
||||||
|
$aFields['AUTH_ANONYMOUS'] = sprintf('%d', $aFields['AUTH_ANONYMOUS'] );
|
||||||
|
|
||||||
|
$G_PUBLISH = new Publisher();
|
||||||
|
if ($aFields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
|
||||||
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/ldapEdit', '', $aFields, '../authSources/authSources_Save');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.'));
|
if (file_exists(PATH_XMLFORM . 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||||
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $aFields, '../authSources/authSources_Save');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
G::RenderPage('publish','blank');
|
||||||
G::RenderPage('publish','blank');
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
* authSources_Save.php
|
* authSources_Save.php
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
* Copyright (C) 2004 - 2008 Colosa Inc.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -22,44 +22,46 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
global $RBAC;
|
|
||||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($_POST['form']['btnSave']);
|
global $RBAC;
|
||||||
|
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||||
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
|
G::header('location: ../login/login');
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
$aCommonFields = array('AUTH_SOURCE_UID',
|
unset($_POST['form']['btnSave']);
|
||||||
'AUTH_SOURCE_NAME',
|
|
||||||
'AUTH_SOURCE_PROVIDER',
|
$aCommonFields = array('AUTH_SOURCE_UID',
|
||||||
'AUTH_SOURCE_SERVER_NAME',
|
'AUTH_SOURCE_NAME',
|
||||||
'AUTH_SOURCE_PORT',
|
'AUTH_SOURCE_PROVIDER',
|
||||||
'AUTH_SOURCE_ENABLED_TLS',
|
'AUTH_SOURCE_SERVER_NAME',
|
||||||
'AUTH_ANONYMOUS',
|
'AUTH_SOURCE_PORT',
|
||||||
'AUTH_SOURCE_SEARCH_USER',
|
'AUTH_SOURCE_ENABLED_TLS',
|
||||||
'AUTH_SOURCE_PASSWORD',
|
'AUTH_ANONYMOUS',
|
||||||
'AUTH_SOURCE_VERSION',
|
'AUTH_SOURCE_SEARCH_USER',
|
||||||
'AUTH_SOURCE_BASE_DN',
|
'AUTH_SOURCE_PASSWORD',
|
||||||
'AUTH_SOURCE_OBJECT_CLASSES',
|
'AUTH_SOURCE_VERSION',
|
||||||
'AUTH_SOURCE_ATTRIBUTES');
|
'AUTH_SOURCE_BASE_DN',
|
||||||
$aFields = $aData = array();
|
'AUTH_SOURCE_OBJECT_CLASSES',
|
||||||
foreach ($_POST['form'] as $sField => $sValue) {
|
'AUTH_SOURCE_ATTRIBUTES');
|
||||||
if (in_array($sField, $aCommonFields)) {
|
|
||||||
$aFields[$sField] = $sValue;
|
$aFields = $aData = array();
|
||||||
|
foreach ($_POST['form'] as $sField => $sValue) {
|
||||||
|
if (in_array($sField, $aCommonFields)) {
|
||||||
|
$aFields[$sField] = $sValue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$aData[$sField] = $sValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$aFields['AUTH_SOURCE_DATA'] = $aData;
|
||||||
|
|
||||||
|
if ($aFields['AUTH_SOURCE_UID'] == '') {
|
||||||
|
$RBAC->createAuthSource($aFields);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$aData[$sField] = $sValue;
|
$RBAC->updateAuthSource($aFields);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$aFields['AUTH_SOURCE_DATA'] = $aData;
|
G::header('location: authSources_List');
|
||||||
|
|
||||||
if ($aFields['AUTH_SOURCE_UID'] == '') {
|
|
||||||
$RBAC->createAuthSource($aFields);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$RBAC->updateAuthSource($aFields);
|
|
||||||
}
|
|
||||||
|
|
||||||
G::header('location: authSources_List');
|
|
||||||
Reference in New Issue
Block a user