From 7c05625506d4ea11a3a5f8994c45b70e27e8beca Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Mon, 15 Apr 2013 10:50:09 -0400 Subject: [PATCH] DOC SYSTEM I added a part for enabled enterprise SOLVED I added a part for enabled enterprise --- .../engine/methods/login/authentication.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index ca5fdd3fb..45ee55bf3 100755 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -295,6 +295,41 @@ try { die; } + ///// VERIFY PLUGIN ENTERPRISE IF IS ENABLED AND PARTNER FLAG EXIST + $partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false; + if ($partnerFlag) { + $flagEnableEnterprise = true; + G::loadClass('PMPluginRegistry'); + $sSerializedFile = PATH_DATA_SITE . 'plugin.singleton'; + $oPluginRegistry = & PMPluginRegistry::getSingleton(); + if (file_exists( $sSerializedFile )) { + $oPluginRegistry->unSerializeInstance( file_get_contents( $sSerializedFile ) ); + $attributes = $oPluginRegistry->getAttributes(); + if ( isset($attributes['_aPluginDetails']['enterprise']) && + $attributes['_aPluginDetails']['enterprise']->enabled == 1 + ) { + $flagEnableEnterprise = false; + } + } + + if ($flagEnableEnterprise) { + $pluginFile = 'enterprise.php'; + require_once (PATH_PLUGINS . $pluginFile); + $details = $oPluginRegistry->getPluginDetails( $pluginFile ); + @$oPluginRegistry->enablePlugin( $details->sNamespace ); + @$oPluginRegistry->setupPlugins(); + + $language = new Language(); + $pathPluginTranslations = PATH_PLUGINS . 'enterprise' . PATH_SEP . 'translations' . PATH_SEP; + if (file_exists($pathPluginTranslations . 'translations.php')) { + if (!file_exists($pathPluginTranslations . 'enterprise' . '.' . SYS_LANG . '.po')) { + @$language->createLanguagePlugin('enterprise', SYS_LANG); + } + @$language->updateLanguagePlugin('enterprise', SYS_LANG); + } + } + } + $oHeadPublisher = &headPublisher::getSingleton(); $oHeadPublisher->extJsInit = true;