From c31d0716a9efe05e6cc61879879edd3d2b7adf5f Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Fri, 12 Oct 2012 15:59:10 -0400 Subject: [PATCH] BUG 9675 Advanced LDAP Sync Plugin 1.4.27 Error al editar un authentication sources SOLVED - Missing validation when edit a authentication source related to a deactivated plugin - Add validation for deactivated plugins --- workflow/engine/methods/authSources/authSources_Edit.php | 7 ++++++- workflow/engine/methods/authSources/authSources_New.php | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/workflow/engine/methods/authSources/authSources_Edit.php b/workflow/engine/methods/authSources/authSources_Edit.php index 76729df6f..52f0f5cde 100755 --- a/workflow/engine/methods/authSources/authSources_Edit.php +++ b/workflow/engine/methods/authSources/authSources_Edit.php @@ -74,7 +74,12 @@ if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap' ) { } else { if (file_exists(PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) { - $G_PUBLISH->AddContent('xmlform', 'xmlform', $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml', '', $fields, '../authSources/authSources_Save'); + if (class_exists($fields['AUTH_SOURCE_PROVIDER'])) { + $G_PUBLISH->AddContent('xmlform', 'xmlform', $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml', '', $fields, '../authSources/authSources_Save'); + } + else { + $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING'))); + } } else { if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) { diff --git a/workflow/engine/methods/authSources/authSources_New.php b/workflow/engine/methods/authSources/authSources_New.php index d863e538b..4e6273ab1 100755 --- a/workflow/engine/methods/authSources/authSources_New.php +++ b/workflow/engine/methods/authSources/authSources_New.php @@ -22,7 +22,7 @@ * 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'); @@ -41,7 +41,12 @@ $G_PUBLISH = new Publisher(); if (file_exists(PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) { - $G_PUBLISH->AddContent('xmlform', 'xmlform', $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml', '', $fields, '../authSources/authSources_Save'); + if (class_exists($fields['AUTH_SOURCE_PROVIDER'])) { + $G_PUBLISH->AddContent('xmlform', 'xmlform', $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml', '', $fields, '../authSources/authSources_Save'); + } + else { + $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING'))); + } } else { if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {