Improvement enable features enterprise

This commit is contained in:
Marco Antonio Nina
2014-10-10 16:17:07 -04:00
parent 3152dd7661
commit ea42cf711b
8 changed files with 41 additions and 20 deletions

View File

@@ -5279,7 +5279,8 @@ class G
$sflagAudit = $oServerConf->getAuditLogProperty( 'AL_OPTION', SYS_SYS );
$ipClient = G::getIpAddress();
if ($sflagAudit) {
$licensedFeatures = & PMLicensedFeatures::getSingleton();
if ($sflagAudit && $licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) {
$workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
$username = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : 'Unknow User';
$fullname = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : '-';

View File

@@ -614,6 +614,11 @@ class Propel {
*/
public static function getDbConnection($name)
{
$licensedFeatures = & PMLicensedFeatures::getSingleton();
if (! $licensedFeatures->verifyfeature('02YeEFKNnVoOWFKMzN4ZmpXT0V3MU9SVklnOXNCcE9zcXJKa0tpemNmQkJ5OTUvOWlLdFhibGp0MHVHUlV0VmNpNw==')) {
return null;
}
if (! empty(self::$configuration['datasources'][$name]['connection'])) {
return self::getConnection($name);
}

View File

@@ -118,7 +118,18 @@ function change_hash($command, $opts)
$response = new stdclass();
$response->workspace = $workspace;
$response->hash = $hash;
$workspace->changeHashPassword($workspace->name, $response);
if (!defined("SYS_SYS")) {
define("SYS_SYS", $workspace->name);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
}
$_SESSION['__sw__'] = '';
if (!$workspace->changeHashPassword($workspace->name, $response)) {
CLI::logging(pakeColor::colorize("This command cannot be used because your license does not include it.", "ERROR") . "\n");
$workspace->close();
die;
}
$workspace->close();
CLI::logging(pakeColor::colorize("Changed...", "ERROR") . "\n");
} catch (Exception $e) {

View File

@@ -65,25 +65,19 @@ class PMLicensedFeatures
public function verifyfeature ($featureName)
{
if (!class_exists("pmLicenseManager")) {
require_once ("classes" . PATH_SEP . "class.pmLicenseManager.php");
}
$licenseManager = &pmLicenseManager::getSingleton();
$_SESSION['__sw__'] = true;
$padl = new padl();
$value = $padl->_decrypt($featureName);
$enable = in_array($padl->_decrypt($featureName), $licenseManager->features);
$enable = in_array($value[0], $licenseManager->licensedfeatures);
$this->featuresDetails[$padl->_decrypt($featureName)]->enabled = $enable;
$this->featuresDetails[$value[0]]->enabled = $enable;
return $enable;
}
public static function loadSingleton($file)
{
self::$instancefeature = unserialize(file_get_contents($file));
if (! is_object(self::$instancefeature) || get_class(self::$instancefeature) != "PMLicensedFeatures") {
throw new Exception("Can't load main PMLicensedFeatures object.");
}
return self::$instancefeature;
}
}

View File

@@ -920,7 +920,8 @@ class wsBase
if (!class_exists('System')) {
G::LoadClass('system');
}
$aSetup = !empty($config) ? $config : System::getEmailConfiguration();
$licensedFeatures = & PMLicensedFeatures::getSingleton();
$aSetup = (!empty($config) && $licensedFeatures->verifyfeature('nKaNTNuT1MzK0RsMEtXTnYzR09ucHF2WGNuS0hRdDBBak42WXJhNVVOOG1INEVoaU1EaTllbjBBeEJNeG9wRVJ6NmxQelhyVTBvdThzPQ==') ) ? $config : System::getEmailConfiguration();
$oSpool = new spoolRun();

View File

@@ -1668,7 +1668,13 @@ class workspaceTools
{
$this->initPropel( true );
G::LoadClass("enterprise");
$licensedFeatures = & PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('95OY24wcXpEMzIyRmlNSnF0STNFSHJzMG9wYTJKekpLNmY2ZmRCeGtuZk5oUDloaUNhUGVjTDJBPT0=')) {
enterpriseClass::setHashPassword($response);
} else {
return false;
}
return true;
}
public function verifyEnterprise ($workspace)

View File

@@ -28,6 +28,7 @@ $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
@@ -98,7 +99,7 @@ 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) {
if (isset($sAudit) && $sAudit != false && $licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) {
$G_TMP_MENU->AddIdRawOption('AUDIT_LOG', '../setup/auditLog', ucfirst (G::LoadTranslation('ID_AUDITLOG_DISPLAY')), '', '', 'logs');
}
}
@@ -107,7 +108,9 @@ 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';

View File

@@ -1709,7 +1709,7 @@ Ext.onReady(function() {
title: _('ID_ENTERPRISE_PLUGINS'),
items : addonsGrid
},{
title: _('ID_ENTERPRISE_FIXTURES'),
title: _('ID_ENTERPRISE_FEATURES'),
items : addonsFeatureGrid
}
]