diff --git a/workflow/engine/methods/authSources/authSources_Edit.php b/workflow/engine/methods/authSources/authSources_Edit.php index 20d7e6b39..9c28a2628 100755 --- a/workflow/engine/methods/authSources/authSources_Edit.php +++ b/workflow/engine/methods/authSources/authSources_Edit.php @@ -55,7 +55,7 @@ if (is_array( $fields['AUTH_SOURCE_DATA'] )) { } $fields['AUTH_SOURCE_SHOWGRID_FLAG'] = 0; if (isset($fields['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID']) && $fields['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID'] == 'on') { - $fields['AUTH_SOURCE_SHOWGRID_FLAG'] = 1; + $fields["AUTH_SOURCE_SHOWGRID_FLAG"] = 1; } unset( $fields['AUTH_SOURCE_DATA'] ); @@ -84,19 +84,34 @@ if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap') { G::RenderPage( 'publish', 'extJs' ); } else { if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) { - if (class_exists( $fields['AUTH_SOURCE_PROVIDER'] )) { - // The attributes the users - G::loadClass('pmFunctions'); - $data = executeQuery('DESCRIBE USERS'); - $fieldSet = array('USR_UID', 'USR_USERNAME', 'USR_PASSWORD', 'USR_EMAIL', '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 = ''; + $pluginEnabled = 0; + + if (file_exists(PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . ".php")) { + $pluginRegistry = &PMPluginRegistry::getSingleton(); + $pluginDetail = $pluginRegistry->getPluginDetails($fields["AUTH_SOURCE_PROVIDER"] . ".php"); + + if ($pluginDetail && $pluginDetail->enabled) { + $pluginEnabled = 1; + } + } + + if ($pluginEnabled == 1) { + //The attributes the users + G::LoadClass("pmFunctions"); + + $data = executeQuery("DESCRIBE USERS"); + $fieldSet = array("USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_EMAIL", "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; + foreach ($data as $value) { - if (!(in_array($value['Field'], $fieldSet))) { - $attributes .= $value['Field'] . '|'; + if (!(in_array($value["Field"], $fieldSet))) { + $attributes = $attributes . $value["Field"] . "|"; } } - $fields['AUTH_SOURCE_ATTRIBUTE_IDS'] = $attributes; - $G_PUBLISH->AddContent( 'xmlform', 'xmlform', "../plugins/".$fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save' ); + + $fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes; + + $G_PUBLISH->AddContent("xmlform", "xmlform", $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . $fields["AUTH_SOURCE_PROVIDER"] . "Edit", "", $fields, "../authSources/authSources_Save"); } else { $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_MISSING' ) ) ); @@ -109,6 +124,7 @@ if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap') { ) ); } } - G::RenderPage( 'publish', 'blank' ); + + G::RenderPage("publish", "blank"); } diff --git a/workflow/engine/methods/authSources/authSources_New.php b/workflow/engine/methods/authSources/authSources_New.php index 1c3c1dcba..b8ceeaf98 100755 --- a/workflow/engine/methods/authSources/authSources_New.php +++ b/workflow/engine/methods/authSources/authSources_New.php @@ -39,8 +39,34 @@ $fields = array ('AUTH_SOURCE_PROVIDER' => $_REQUEST['AUTH_SOURCE_PROVIDER']); $G_PUBLISH = new Publisher(); if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) { - 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' ); + $pluginEnabled = 0; + + if (file_exists(PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . ".php")) { + $pluginRegistry = &PMPluginRegistry::getSingleton(); + $pluginDetail = $pluginRegistry->getPluginDetails($fields["AUTH_SOURCE_PROVIDER"] . ".php"); + + if ($pluginDetail && $pluginDetail->enabled) { + $pluginEnabled = 1; + } + } + + if ($pluginEnabled == 1) { + //The attributes the users + G::LoadClass("pmFunctions"); + + $data = executeQuery("DESCRIBE USERS"); + $fieldSet = array("USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_EMAIL", "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; + + foreach ($data as $value) { + if (!(in_array($value["Field"], $fieldSet))) { + $attributes = $attributes . $value["Field"] . "|"; + } + } + + $fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes; + + $G_PUBLISH->AddContent("xmlform", "xmlform", $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . $fields["AUTH_SOURCE_PROVIDER"] . "Edit", "", $fields, "../authSources/authSources_Save"); } else { $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_MISSING' )) ); } @@ -51,4 +77,6 @@ if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fi $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.') ); } } -G::RenderPage( 'publish', 'blank' ); \ No newline at end of file + +G::RenderPage("publish", "blank"); + diff --git a/workflow/engine/methods/setup/systemInfo.php b/workflow/engine/methods/setup/systemInfo.php index f07d550f1..20926f253 100644 --- a/workflow/engine/methods/setup/systemInfo.php +++ b/workflow/engine/methods/setup/systemInfo.php @@ -30,17 +30,17 @@ switch ($option) { $oHeadPublisher->addContent("setup/systemInfo"); //Adding a html file .html $oHeadPublisher->addExtJsScript("setup/systemInfo", false); //Adding a javascript file .js - $oHeadPublisher->assign("SYSINFO_PHP", "\"" . $systemInfo->php->version . "\", " . $systemInfo->php->result); - $oHeadPublisher->assign("SYSINFO_MYSQL", "\"" . $systemInfo->mysql->version . "\", " . $systemInfo->mysql->result); - $oHeadPublisher->assign("SYSINFO_MSSQL", "\"" . $systemInfo->mssql->version . "\", " . $systemInfo->mssql->result); - $oHeadPublisher->assign("SYSINFO_CURL", "\"" . $systemInfo->curl->version . "\", " . $systemInfo->curl->result); - $oHeadPublisher->assign("SYSINFO_OPENSSL", "\"" . $systemInfo->openssl->version . "\", " . $systemInfo->openssl->result); - $oHeadPublisher->assign("SYSINFO_DOMXML", "\"" . $systemInfo->dom->version . "\", " . $systemInfo->dom->result); - $oHeadPublisher->assign("SYSINFO_GD", "\"" . $systemInfo->gd->version . "\", " . $systemInfo->gd->result); - $oHeadPublisher->assign("SYSINFO_MULTIBYTESTRING", "\"" . $systemInfo->multibyte->version . "\", " . $systemInfo->multibyte->result); - $oHeadPublisher->assign("SYSINFO_SOAP", "\"" . $systemInfo->soap->version . "\", " . $systemInfo->soap->result); - $oHeadPublisher->assign("SYSINFO_LDAP", "\"" . $systemInfo->ldap->version . "\", " . $systemInfo->ldap->result); - $oHeadPublisher->assign("SYSINFO_MEMORYLIMIT", "\"" . $systemInfo->memory->version . "\", " . $systemInfo->memory->result); + $oHeadPublisher->assign("SYSINFO_PHP", "\"" . $systemInfo->php->version . "\", " . (($systemInfo->php->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_MYSQL", "\"" . $systemInfo->mysql->version . "\", " . (($systemInfo->mysql->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_MSSQL", "\"" . $systemInfo->mssql->version . "\", " . (($systemInfo->mssql->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_CURL", "\"" . $systemInfo->curl->version . "\", " . (($systemInfo->curl->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_OPENSSL", "\"" . $systemInfo->openssl->version . "\", " . (($systemInfo->openssl->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_DOMXML", "\"" . $systemInfo->dom->version . "\", " . (($systemInfo->dom->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_GD", "\"" . $systemInfo->gd->version . "\", " . (($systemInfo->gd->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_MULTIBYTESTRING", "\"" . $systemInfo->multibyte->version . "\", " . (($systemInfo->multibyte->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_SOAP", "\"" . $systemInfo->soap->version . "\", " . (($systemInfo->soap->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_LDAP", "\"" . $systemInfo->ldap->version . "\", " . (($systemInfo->ldap->result)? 1 : 0)); + $oHeadPublisher->assign("SYSINFO_MEMORYLIMIT", "\"" . $systemInfo->memory->version . "\", " . (($systemInfo->memory->result)? 1 : 0)); G::RenderPage("publish", "extJs"); break;