PM-399 Las funcionalidades del enterprise ya no tiene SOLVED

- A validation was added when use plugin.singleton.
This commit is contained in:
Marco Antonio Nina
2014-09-25 16:55:16 -04:00
parent 92d699a7ae
commit d5d50e724c
7 changed files with 82 additions and 112 deletions

View File

@@ -114,31 +114,13 @@ function change_hash($command, $opts)
Bootstrap::LoadClass("plugin");
foreach ($workspaces as $workspace) {
CLI::logging("Checking workspace: ".pakeColor::colorize($workspace->name, "INFO")."\n");
$path = PATH_DATA . 'sites' . PATH_SEP . $workspace->name . PATH_SEP;
try {
if (file_exists($path . 'plugin.singleton')) {
define('SYS_SYS', $workspace->name);
define('PATH_DATA_SITE', $path);
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->setupPlugins();
$oPluginRegistry->unSerializeInstance(file_get_contents($path . 'plugin.singleton'));
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->unSerializeInstance(file_get_contents($path . 'plugin.singleton'));
if ($oPluginRegistry->existsTrigger ( PM_HASH_PASSWORD )) {
$response = new stdclass();
$response->workspace = $workspace;
$response->hash = $hash;
$workspace->changeHashPassword($workspace->name, $response);
$workspace->close();
CLI::logging(pakeColor::colorize("Changed...", "ERROR") . "\n");
} else {
CLI::logging(pakeColor::colorize("You can't use the \"change-password-hash-method\" option because the license has expired or your workspace doesn't have the Enteprise plugin enabled.", "ERROR") . "\n");
}
} else {
CLI::logging(pakeColor::colorize("You can't use the \"change-password-hash-method\" option because the license has expired or your workspace doesn't have the Enteprise plugin enabled.", "INFO") . "\n");
}
$response = new stdclass();
$response->workspace = $workspace;
$response->hash = $hash;
$workspace->changeHashPassword($workspace->name, $response);
$workspace->close();
CLI::logging(pakeColor::colorize("Changed...", "ERROR") . "\n");
} catch (Exception $e) {
echo "> Error: ".CLI::error($e->getMessage()) . "\n";
}

View File

@@ -1162,7 +1162,7 @@ class PMPluginRegistry
} else {
$aux = explode( chr( 92 ), $detail->sFilename );
}
$sFilename = PATH_PLUGINS . $aux[count( $aux ) - 1];
$sFilename = (($detail->sNamespace == 'enterprise') ? PATH_CORE. 'methods' . PATH_SEP . 'enterprise' . PATH_SEP : PATH_PLUGINS) . $aux[count( $aux ) - 1];
if (! file_exists( $sFilename )) {
continue;
}

View File

@@ -1624,12 +1624,11 @@ class workspaceTools
}
}
public function changeHashPassword ($workspace,$response) {
G::LoadClass("patch");
public function changeHashPassword ($workspace, $response)
{
$this->initPropel( true );
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers ( PM_HASH_PASSWORD , $response );
G::LoadClass("enterprise");
enterpriseClass::setHashPassword($response);
}
}

View File

@@ -27,45 +27,45 @@ global $RBAC;
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
if ($RBAC->userCanAccess('PM_SETUP') == 1 ) {
//settings options
// $G_TMP_MENU->AddIdRawOption('LOGO', 'uplogo', G::LoadTranslation('ID_LOGO'), 'icon-pmlogo.png', '', 'settings');
$G_TMP_MENU->AddIdRawOption('LOGO', '../admin/pmLogo', G::LoadTranslation('ID_LOGO'), 'icon-pmlogo.png','', 'settings');
$G_TMP_MENU->AddIdRawOption('EMAILS','../admin/emails', G::LoadTranslation('ID_EMAIL'), 'icon-email-settings1.png', '', 'settings');
$G_TMP_MENU->AddIdRawOption('CALENDAR', 'calendarList', G::LoadTranslation('ID_CALENDAR'), 'icon-calendar.png', '', 'settings' );
//if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1)
// $G_TMP_MENU->AddIdRawOption('CASES_LIST_SETUP', '../cases/casesListSetup', G::LoadTranslation('ID_CASES_LIST_SETUP'), "",'', 'settings');
$G_TMP_MENU->AddIdRawOption('PROCESS_CATEGORY', '../processCategory/processCategoryList', G::LoadTranslation('ID_PROCESS_CATEGORY'), "rules.png",'', 'settings');
//settings options
// $G_TMP_MENU->AddIdRawOption('LOGO', 'uplogo', G::LoadTranslation('ID_LOGO'), 'icon-pmlogo.png', '', 'settings');
$G_TMP_MENU->AddIdRawOption('LOGO', '../admin/pmLogo', G::LoadTranslation('ID_LOGO'), 'icon-pmlogo.png','', 'settings');
$G_TMP_MENU->AddIdRawOption('EMAILS','../admin/emails', G::LoadTranslation('ID_EMAIL'), 'icon-email-settings1.png', '', 'settings');
$G_TMP_MENU->AddIdRawOption('CALENDAR', 'calendarList', G::LoadTranslation('ID_CALENDAR'), 'icon-calendar.png', '', 'settings' );
//if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1)
// $G_TMP_MENU->AddIdRawOption('CASES_LIST_SETUP', '../cases/casesListSetup', G::LoadTranslation('ID_CASES_LIST_SETUP'), "",'', 'settings');
$G_TMP_MENU->AddIdRawOption('PROCESS_CATEGORY', '../processCategory/processCategoryList', G::LoadTranslation('ID_PROCESS_CATEGORY'), "rules.png",'', 'settings');
}
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1) {
$G_TMP_MENU->AddIdRawOption('LANGUAGES', 'languages', G::LoadTranslation('ID_LANGUAGES'), 'icon-language.png', '', 'settings');
$G_TMP_MENU->AddIdRawOption('LANGUAGES', 'languages', G::LoadTranslation('ID_LANGUAGES'), 'icon-language.png', '', 'settings');
}
if ($RBAC->userCanAccess('PM_SETUP') == 1 ) {
$G_TMP_MENU->AddIdRawOption('SKINS', 'skinsList', G::LoadTranslation('ID_SKINS'), 'icon-skins.png', '', 'settings');
$G_TMP_MENU->AddIdRawOption('SKINS', 'skinsList', G::LoadTranslation('ID_SKINS'), 'icon-skins.png', '', 'settings');
if (!$partnerFlag) {
$G_TMP_MENU->AddIdRawOption('HEARTBEAT', 'processHeartBeatConfig', G::LoadTranslation('ID_HEARTBEAT_CONFIG'), "heartBeat.jpg",'', 'settings');
}
$G_TMP_MENU->AddIdRawOption('ENVIRONMENT_SETTINGS', 'environmentSettings', G::LoadTranslation('ID_ENVIRONMENT_SETTINGS'), "",'', 'settings');
$G_TMP_MENU->AddIdRawOption('ENVIRONMENT_SETTINGS', 'environmentSettings', G::LoadTranslation('ID_ENVIRONMENT_SETTINGS'), "",'', 'settings');
}
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1) {
$G_TMP_MENU->AddIdRawOption('APPCACHEVIEW_SETUP', '../setup/appCacheViewConf', G::LoadTranslation('ID_APPCACHE_SETUP'), "",'', 'settings');
$G_TMP_MENU->AddIdRawOption('APPCACHEVIEW_SETUP', '../setup/appCacheViewConf', G::LoadTranslation('ID_APPCACHE_SETUP'), "",'', 'settings');
}
if ($RBAC->userCanAccess('PM_SETUP') == 1) {
$G_TMP_MENU->AddIdRawOption('CLEAR_CACHE', 'clearCompiled', G::LoadTranslation('ID_CLEAR_CACHE'), 'icon-rebuild-clean.png', "", 'settings' );
//$G_TMP_MENU->AddIdRawOption('ADDITIONAL_TABLES', '../additionalTables/additionalTablesList', G::LoadTranslation('ID_ADDITIONAL_TABLES'), 'icon-tables.png','', 'settings');
//$G_TMP_MENU->AddIdRawOption('REPORT_TABLES', '../reportTables/main', 'Report Tables', 'icon-tables.png','', 'settings');
$G_TMP_MENU->AddIdRawOption('CLEAR_CACHE', 'clearCompiled', G::LoadTranslation('ID_CLEAR_CACHE'), 'icon-rebuild-clean.png', "", 'settings' );
//$G_TMP_MENU->AddIdRawOption('ADDITIONAL_TABLES', '../additionalTables/additionalTablesList', G::LoadTranslation('ID_ADDITIONAL_TABLES'), 'icon-tables.png','', 'settings');
//$G_TMP_MENU->AddIdRawOption('REPORT_TABLES', '../reportTables/main', 'Report Tables', 'icon-tables.png','', 'settings');
$G_TMP_MENU->AddIdRawOption('PM_TABLES', '../pmTables', G::LoadTranslation('ID_ADDITIONAL_TABLES'), 'icon-tables.png','', 'settings');
$G_TMP_MENU->AddIdRawOption('PM_TABLES', '../pmTables', G::LoadTranslation('ID_ADDITIONAL_TABLES'), 'icon-tables.png','', 'settings');
if (!$partnerFlag) {
$G_TMP_MENU->AddIdRawOption('WEBSERVICES', 'webServices', G::LoadTranslation('ID_WEB_SERVICES'), 'icon-webservices.png', '', 'settings');
}
$G_TMP_MENU->AddIdRawOption('LOGIN', 'loginSettings', G::LoadTranslation('LOGIN'), "",'', 'settings');
$G_TMP_MENU->AddIdRawOption('DASHBOARD', '../dashboard/dashletsList', ucfirst(G::LoadTranslation('ID_DASHBOARD')), '', '', 'settings');
if (!$partnerFlag) {
$G_TMP_MENU->AddIdRawOption('WEBSERVICES', 'webServices', G::LoadTranslation('ID_WEB_SERVICES'), 'icon-webservices.png', '', 'settings');
}
$G_TMP_MENU->AddIdRawOption('LOGIN', 'loginSettings', G::LoadTranslation('LOGIN'), "",'', 'settings');
$G_TMP_MENU->AddIdRawOption('DASHBOARD', '../dashboard/dashletsList', ucfirst(G::LoadTranslation('ID_DASHBOARD')), '', '', 'settings');
}
//tools options
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1 ) {
@@ -76,18 +76,18 @@ if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1 ) {
//users options
if ($RBAC->userCanAccess('PM_USERS') == 1) {
$G_TMP_MENU->AddIdRawOption('USERS', '../users/users_List', G::LoadTranslation('ID_USERS_LIST'), 'icon-webservices.png', '', 'users');
$G_TMP_MENU->AddIdRawOption('USERS', '../users/users_List', G::LoadTranslation('ID_USERS_LIST'), 'icon-webservices.png', '', 'users');
$G_TMP_MENU->AddIdRawOption('GROUPS', '../groups/groups', G::LoadTranslation('ID_GROUPS'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('DEPARTAMENTS', '../departments/departments', G::LoadTranslation('ID_DEPARTMENTS_USERS'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('ROLES', '../roles/roles_List', G::LoadTranslation('ID_ROLES'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('GROUPS', '../groups/groups', G::LoadTranslation('ID_GROUPS'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('DEPARTAMENTS', '../departments/departments', G::LoadTranslation('ID_DEPARTMENTS_USERS'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('ROLES', '../roles/roles_List', G::LoadTranslation('ID_ROLES'), '', '', 'users');
}
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1 && $RBAC->userCanAccess('PM_USERS') == 1) {
$G_TMP_MENU->AddIdRawOption('AUTHSOURCES', '../authSources/authSources_List', G::LoadTranslation('ID_AUTH_SOURCES'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', G::LoadTranslation('ID_USER_EXPERIENCE'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('SYSTEM', '../admin/system', G::LoadTranslation('ID_SYSTEM'), '', '', 'settings');
$G_TMP_MENU->AddIdRawOption('INFORMATION', '../setup/systemInfo?option=processInfo', G::LoadTranslation('ID_SYSTEM_INFO'), '', '', 'settings');
$G_TMP_MENU->AddIdRawOption('AUTHSOURCES', '../authSources/authSources_List', G::LoadTranslation('ID_AUTH_SOURCES'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', G::LoadTranslation('ID_USER_EXPERIENCE'), '', '', 'users');
$G_TMP_MENU->AddIdRawOption('SYSTEM', '../admin/system', G::LoadTranslation('ID_SYSTEM'), '', '', 'settings');
$G_TMP_MENU->AddIdRawOption('INFORMATION', '../setup/systemInfo?option=processInfo', G::LoadTranslation('ID_SYSTEM_INFO'), '', '', 'settings');
}
if ($RBAC->userCanAccess('PM_SETUP') == 1) {
@@ -98,20 +98,38 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) {
}
if ($RBAC->userCanAccess("PM_SETUP") == 1) {
$G_TMP_MENU->AddIdRawOption("PM_REQUIREMENTS", "../setup/systemInfo", G::LoadTranslation("ID_PROCESSMAKER_REQUIREMENTS_CHECK"), "", "", "settings");
$G_TMP_MENU->AddIdRawOption("PHP_INFO", "../setup/systemInfo?option=php", G::LoadTranslation("ID_PHP_INFO"), "", "", "settings");
//$G_TMP_MENU->AddIdRawOption("PHP_MAINTENANCE", "../admin/maintenance", 'Maintenance', "", "", "settings");
$G_TMP_MENU->AddIdRawOption("PM_REQUIREMENTS", "../setup/systemInfo", G::LoadTranslation("ID_PROCESSMAKER_REQUIREMENTS_CHECK"), "", "", "settings");
$G_TMP_MENU->AddIdRawOption("PHP_INFO", "../setup/systemInfo?option=php", G::LoadTranslation("ID_PHP_INFO"), "", "", "settings");
//$G_TMP_MENU->AddIdRawOption("PHP_MAINTENANCE", "../admin/maintenance", 'Maintenance', "", "", "settings");
}
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
$enterprise = new enterprisePlugin('enterprise');
require_once 'classes/class.pmLicenseManager.php';
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
$enterprise->install();
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
$enterprise = new enterprisePlugin('enterprise');
$enterprise->enable();
$enterprise->setup();
}
$enterprise->setup();
$pmLicenseManagerO = &pmLicenseManager::getSingleton();
$licenseStatusInfo = $pmLicenseManagerO->getCurrentLicenseStatus();
$licStatusMsg = null;
if ((isset($pmLicenseManagerO->plan)) && ($pmLicenseManagerO->plan != "")) {
$lines = explode(" - ", $pmLicenseManagerO->plan);
if (isset($lines[0])) {
$licStatusMsg .= "<br><i><small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $lines[0] . "</small></i>";
}
if ((isset($lines[1])) && ($lines[1] != $lines[0])) {
$licStatusMsg .= "<br><i><small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $lines[1] . "</small></i>";
}
}
if ($licenseStatusInfo["message"] != "") {
$licStatusMsg = "&nbsp;<font color=\"red\">(" . $licenseStatusInfo["message"] . ")</font>";
}
if ($RBAC->userCanAccess("PM_SETUP") == 1) {
$G_TMP_MENU->AddIdRawOption("PMENTERPRISE", "../enterprise/addonsStore", G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg, "", "", "plugins");
$G_TMP_MENU->AddIdRawOption("CASES_LIST_SETUP", "../cases/casesListSetup", G::LoadTranslation('ID_CASES_LIST'), "", "", "settings");
}

View File

@@ -24,7 +24,7 @@ class enterprisePlugin extends PMPlugin
$this->sFriendlyName = "ProcessMaker Enterprise Edition";
$this->sDescription = "ProcessMaker Enterprise Edition $VERSION";
$this->sPluginFolder = "enterprise";
$this->sSetupPage = "../enterprise/pluginsList.php";
$this->sSetupPage = "../enterprise/addonsStore.php";
$this->iVersion = $VERSION;
$this->iPMVersion = "2.0.31";
$this->aDependences = null;
@@ -119,11 +119,12 @@ class enterprisePlugin extends PMPlugin
public function setup()
{
$this->registerMenu("setup", "menuEnterprise.php");
////including the file inside the enterprise folder
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.pmLicenseManager.php';
$this->registerTrigger(PM_LOGIN, "enterpriseSystemUpdate");
$this->registerTrigger(PM_HASH_PASSWORD, 'setHashPassword');
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
$pluginRegistry = &PMPluginRegistry::getSingleton();
$pluginDetail = $pluginRegistry->getPluginDetails("enterprise.php");
$pluginRegistry->enablePlugin($pluginDetail->sNamespace);
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
}
}
public function enable()

View File

@@ -1,31 +0,0 @@
<?php
global $G_TMP_MENU;
if (class_exists("pmLicenseManager")) {
$pmLicenseManagerO = &pmLicenseManager::getSingleton();
$licenseStatusInfo = $pmLicenseManagerO->getCurrentLicenseStatus();
$licStatusMsg = null;
if ((isset($pmLicenseManagerO->plan)) && ($pmLicenseManagerO->plan != "")) {
$lines = explode(" - ", $pmLicenseManagerO->plan);
if (isset($lines[0])) {
$licStatusMsg .= "<br><i><small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $lines[0] . "</small></i>";
}
if ((isset($lines[1])) && ($lines[1] != $lines[0])) {
$licStatusMsg .= "<br><i><small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $lines[1] . "</small></i>";
}
}
if ($licenseStatusInfo["message"] != "") {
$licStatusMsg = "&nbsp;<font color=\"red\">(" . $licenseStatusInfo["message"] . ")</font>";
}
$G_TMP_MENU->AddIdRawOption("PMENTERPRISE", "../enterprise/addonsStore", G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg, "", "", "plugins");
if (isset($pmLicenseManagerO->result) && ($pmLicenseManagerO->result == "OK")) {
if (file_exists(PATH_HOME . "engine" . PATH_SEP . "methods" . PATH_SEP . "cases" . PATH_SEP . "casesListExtJs.php")) {
$G_TMP_MENU->AddIdRawOption("CASES_LIST_SETUP", "../cases/casesListSetup", G::LoadTranslation('ID_CASES_LIST'), "", "", "settings");
}
}
}

View File

@@ -42,12 +42,11 @@ try {
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
$enterprise = new enterprisePlugin('enterprise');
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
$enterprise = new enterprisePlugin('enterprise');
$enterprise->enable();
$enterprise->setup();
}
$enterprise->setup();
$uid = $RBAC->VerifyLogin($usr , $pwd);
$RBAC->cleanSessionFiles(72); //cleaning session files older than 72 hours
@@ -161,11 +160,13 @@ try {
//Execute the SSO Script from plugin
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$lSession="";
$loginInfo = new loginInfo ($usr, $pwd, $lSession );
if ($oPluginRegistry->existsTrigger ( PM_LOGIN )) {
$lSession="";
$loginInfo = new loginInfo ($usr, $pwd, $lSession );
$oPluginRegistry->executeTriggers ( PM_LOGIN , $loginInfo );
}
G::LoadClass("enterprise");
enterpriseClass::enterpriseSystemUpdate($loginInfo);
$_SESSION['USER_LOGGED'] = $uid;
$_SESSION['USR_USERNAME'] = $usr;
} else {