From d6fedf2d2d4d3dca608f62e23666c66559e20620 Mon Sep 17 00:00:00 2001 From: norahmollo Date: Mon, 24 Nov 2014 11:06:28 -0400 Subject: [PATCH] PM-921 Installer for community distribution. Marker added in files with licensed features. --- gulliver/thirdparty/propel/Propel.php | 14 +++++++++----- workflow/engine/classes/class.licensedFeatures.php | 3 ++- workflow/engine/classes/class.wsBase.php | 10 +++++++++- workflow/engine/classes/class.wsTools.php | 2 ++ workflow/engine/menus/setup.php | 12 ++++++++++-- workflow/engine/methods/login/authentication.php | 3 ++- 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/gulliver/thirdparty/propel/Propel.php b/gulliver/thirdparty/propel/Propel.php index b6a7377c6..4cf122349 100755 --- a/gulliver/thirdparty/propel/Propel.php +++ b/gulliver/thirdparty/propel/Propel.php @@ -614,11 +614,15 @@ class Propel { */ public static function getDbConnection($name) { - $licensedFeatures = & PMLicensedFeatures::getSingleton(); - if (! $licensedFeatures->verifyfeature('02YeEFKNnVoOWFKMzN4ZmpXT0V3MU9SVklnOXNCcE9zcXJKa0tpemNmQkJ5OTUvOWlLdFhibGp0MHVHUlV0VmNpNw==')) { - return null; - } - + /*----------------------------------********---------------------------------*/ + $licensedFeatures = & PMLicensedFeatures::getSingleton(); + if (! $licensedFeatures->verifyfeature('02YeEFKNnVoOWFKMzN4ZmpXT0V3MU9SVklnOXNCcE9zcXJKa0tpemNmQkJ5OTUvOWlLdFhibGp0MHVHUlV0VmNpNw==')) { + /*----------------------------------********---------------------------------*/ + return null; + /*----------------------------------********---------------------------------*/ + } + /*----------------------------------********---------------------------------*/ + if (! empty(self::$configuration['datasources'][$name]['connection'])) { return self::getConnection($name); } diff --git a/workflow/engine/classes/class.licensedFeatures.php b/workflow/engine/classes/class.licensedFeatures.php index c7e1469e6..a7baf8d45 100644 --- a/workflow/engine/classes/class.licensedFeatures.php +++ b/workflow/engine/classes/class.licensedFeatures.php @@ -62,7 +62,7 @@ class PMLicensedFeatures } return self::$instancefeature; } - + /*----------------------------------********---------------------------------*/ public function verifyfeature ($featureName) { if (!class_exists("pmLicenseManager")) { @@ -82,5 +82,6 @@ class PMLicensedFeatures $this->featuresDetails[$value[0]]->enabled = $enable; return $enable; } + /*----------------------------------********---------------------------------*/ } diff --git a/workflow/engine/classes/class.wsBase.php b/workflow/engine/classes/class.wsBase.php index 43965394e..76be0ade5 100755 --- a/workflow/engine/classes/class.wsBase.php +++ b/workflow/engine/classes/class.wsBase.php @@ -921,7 +921,15 @@ class wsBase G::LoadClass('system'); } $licensedFeatures = & PMLicensedFeatures::getSingleton(); - $aSetup = (!empty($config) && $licensedFeatures->verifyfeature('nKaNTNuT1MzK0RsMEtXTnYzR09ucHF2WGNuS0hRdDBBak42WXJhNVVOOG1INEVoaU1EaTllbjBBeEJNeG9wRVJ6NmxQelhyVTBvdThzPQ==') ) ? $config : System::getEmailConfiguration(); + /*----------------------------------********---------------------------------*/ + if (!empty($config) && $licensedFeatures->verifyfeature('nKaNTNuT1MzK0RsMEtXTnYzR09ucHF2WGNuS0hRdDBBak42WXJhNVVOOG1INEVoaU1EaTllbjBBeEJNeG9wRVJ6NmxQelhyVTBvdThzPQ==')) { + $aSetup = $config; + } else { + /*----------------------------------********---------------------------------*/ + $aSetup = System::getEmailConfiguration(); + /*----------------------------------********---------------------------------*/ + } + /*----------------------------------********---------------------------------*/ $oSpool = new spoolRun(); diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 0324f447a..8b715140c 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -1717,11 +1717,13 @@ class workspaceTools $this->initPropel( true ); G::LoadClass("enterprise"); $licensedFeatures = & PMLicensedFeatures::getSingleton(); + /*----------------------------------********---------------------------------*/ if ($licensedFeatures->verifyfeature('95OY24wcXpEMzIyRmlNSnF0STNFSHJzMG9wYTJKekpLNmY2ZmRCeGtuZk5oUDloaUNhUGVjTDJBPT0=')) { enterpriseClass::setHashPassword($response); } else { return false; } + /*----------------------------------********---------------------------------*/ return true; } diff --git a/workflow/engine/menus/setup.php b/workflow/engine/menus/setup.php index 1b8c48b4e..a4615f9c3 100755 --- a/workflow/engine/menus/setup.php +++ b/workflow/engine/menus/setup.php @@ -26,9 +26,11 @@ global $G_TMP_MENU; global $RBAC; $partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false; +/*----------------------------------********---------------------------------*/ $oServerConf = & serverConf::getSingleton(); $sAudit = $oServerConf->getAuditLogProperty( 'AL_OPTION', SYS_SYS ); $licensedFeatures = & PMLicensedFeatures::getSingleton(); +/*----------------------------------********---------------------------------*/ if ($RBAC->userCanAccess('PM_SETUP') == 1 ) { //settings options @@ -99,20 +101,24 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) { $G_TMP_MENU->AddIdRawOption('LOG_CASE_SCHEDULER', '../cases/cases_Scheduler_Log', G::LoadTranslation('ID_CASE_SCHEDULER'), "icon-logs-list.png",'', 'logs'); $G_TMP_MENU->AddIdRawOption("CRON", "../setup/cron", G::LoadTranslation("ID_CRON_ACTIONS"), null, null, "logs"); $G_TMP_MENU->AddIdRawOption('EMAILS', '../mails/emailList', ucfirst (strtolower ( G::LoadTranslation('ID_EMAILS'))), '', '', 'logs'); + /*----------------------------------********---------------------------------*/ if (isset($sAudit) && $sAudit != false && $licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) { $G_TMP_MENU->AddIdRawOption('AUDIT_LOG', '../setup/auditLog', ucfirst (G::LoadTranslation('ID_AUDITLOG_DISPLAY')), '', '', 'logs'); } + /*----------------------------------********---------------------------------*/ } 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"); + /*----------------------------------********---------------------------------*/ if ($licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) { $G_TMP_MENU->AddIdRawOption("AUDIT_LOG", "auditLogConfig", G::LoadTranslation("ID_AUDITLOG_DISPLAY"), "", "", "settings"); } + /*----------------------------------********---------------------------------*/ } - +/*----------------------------------********---------------------------------*/ require_once 'classes/class.pmLicenseManager.php'; if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) { require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php'; @@ -137,9 +143,11 @@ if ((isset($pmLicenseManagerO->plan)) && ($pmLicenseManagerO->plan != "")) { if ($licenseStatusInfo["message"] != "") { $licStatusMsg = " (" . $licenseStatusInfo["message"] . ")"; } - +/*----------------------------------********---------------------------------*/ 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"); } diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index 6c0d191eb..018e1cd56 100755 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -39,7 +39,7 @@ try { $usr = mb_strtolower(trim($frm['USR_USERNAME']), 'UTF-8'); $pwd = trim($frm['USR_PASSWORD']); } - + /*----------------------------------********---------------------------------*/ require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php'; if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) { @@ -47,6 +47,7 @@ try { $enterprise->enable(); $enterprise->setup(); } + /*----------------------------------********---------------------------------*/ $uid = $RBAC->VerifyLogin($usr , $pwd); $RBAC->cleanSessionFiles(72); //cleaning session files older than 72 hours