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:
Fernando Ontiveros
2011-04-11 20:27:13 -04:00
parent f65e47c606
commit 1ec225281b
3 changed files with 92 additions and 77 deletions

View File

@@ -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;

View File

@@ -22,6 +22,7 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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');
@@ -54,6 +55,13 @@ if (is_array($aFields['AUTH_SOURCE_DATA'])) {
} }
unset($aFields['AUTH_SOURCE_DATA']); 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(); $G_PUBLISH = new Publisher();
if ($aFields['AUTH_SOURCE_PROVIDER'] == 'ldap') { if ($aFields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/ldapEdit', '', $aFields, '../authSources/authSources_Save'); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/ldapEdit', '', $aFields, '../authSources/authSources_Save');

View File

@@ -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,6 +22,7 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * 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');
@@ -44,6 +45,7 @@ $aCommonFields = array('AUTH_SOURCE_UID',
'AUTH_SOURCE_BASE_DN', 'AUTH_SOURCE_BASE_DN',
'AUTH_SOURCE_OBJECT_CLASSES', 'AUTH_SOURCE_OBJECT_CLASSES',
'AUTH_SOURCE_ATTRIBUTES'); 'AUTH_SOURCE_ATTRIBUTES');
$aFields = $aData = array(); $aFields = $aData = array();
foreach ($_POST['form'] as $sField => $sValue) { foreach ($_POST['form'] as $sField => $sValue) {
if (in_array($sField, $aCommonFields)) { if (in_array($sField, $aCommonFields)) {