Adding the feature license validations
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Features\ActionsByEmail;
|
||||
|
||||
/**
|
||||
* Description of ActionsByEmailService
|
||||
*
|
||||
*/
|
||||
class ActionsByEmailService
|
||||
{
|
||||
|
||||
public function saveConfiguration($params)
|
||||
{
|
||||
if (\PMLicensedFeatures
|
||||
::getSingleton()
|
||||
->verifyfeature('zCeazVrMjVTQVVLcTdwSHNaSzMwTGNCdXRqTm9aYlEzVnI=')) {
|
||||
switch ($params['type']) {
|
||||
case 'configuration':
|
||||
require_once 'classes/model/AbeConfiguration.php';
|
||||
@@ -22,10 +28,15 @@ class ActionsByEmailService
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function loadConfiguration($params)
|
||||
{
|
||||
if ($params['type'] != 'activity') {
|
||||
if ($params['type'] != 'activity'
|
||||
|| (\PMLicensedFeatures
|
||||
::getSingleton()
|
||||
->verifyfeature('zCeazVrMjVTQVVLcTdwSHNaSzMwTGNCdXRqTm9aYlEzVnI=')))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
set_include_path(PATH_FEATURES . 'ActionsByEmail' . PATH_SEPARATOR . get_include_path());
|
||||
@@ -50,4 +61,5 @@ class ActionsByEmailService
|
||||
$configuration['SYS_LANG'] = SYS_LANG;
|
||||
return $configuration;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class PMFeatureRegistry
|
||||
{
|
||||
private $features = array ();
|
||||
private $triggers = array ();
|
||||
private $keys = array ('ActionsByEmail' => 'zCeazVrMjVTQVVLcTdwSHNaSzMwTGNCdXRqTm9aYlEzVnI=');
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
@@ -65,6 +65,9 @@ class PMFeatureRegistry
|
||||
*/
|
||||
public function registerFeature ($featureName, $filename = null)
|
||||
{
|
||||
if (!$this->validateFeatureLicense($featureName)) {
|
||||
return false;
|
||||
}
|
||||
$className = $featureName . "Feature";
|
||||
$feature = new $className( $featureName, $filename );
|
||||
if (isset( $this->features[$featureName] )) {
|
||||
@@ -98,7 +101,7 @@ class PMFeatureRegistry
|
||||
{
|
||||
$feature = $this->retrieveFeature($featureName);
|
||||
if ($feature) {
|
||||
$feature->enable();
|
||||
$feature->disable();
|
||||
}
|
||||
throw new Exception( "Unable to disable feature '$featureName' (feature not found)" );
|
||||
}
|
||||
@@ -168,5 +171,18 @@ class PMFeatureRegistry
|
||||
}
|
||||
}
|
||||
|
||||
public function validateFeatureLicense($featureName)
|
||||
{
|
||||
if (
|
||||
isset($this->keys[$featureName])
|
||||
&& PMLicensedFeatures
|
||||
::getSingleton()
|
||||
->verifyfeature($this->keys[$featureName])
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
/*----------------------------------********---------------------------------*/
|
||||
switch ($_REQUEST['action']) {
|
||||
if (PMLicensedFeatures
|
||||
::getSingleton()
|
||||
->verifyfeature('zCeazVrMjVTQVVLcTdwSHNaSzMwTGNCdXRqTm9aYlEzVnI=')) {
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'processABE' :
|
||||
$G_PUBLISH = new Publisher();
|
||||
try {
|
||||
@@ -82,7 +85,7 @@ switch ($_REQUEST['action']) {
|
||||
$message = '<strong>The answer has been submited. Thank you</strong>';
|
||||
|
||||
//Save Cases Notes
|
||||
include_once PATH_FEATURES.'ActionsByEmail'.DS.'Services'.DS.'utils.php';
|
||||
include_once PATH_FEATURES . 'ActionsByEmail' . DS . 'Services' . DS . 'utils.php';
|
||||
|
||||
$dataAbeRequests = loadAbeRequest($_REQUEST['ABER']);
|
||||
$dataAbeConfiguration = loadAbeConfiguration($dataAbeRequests['ABE_UID']);
|
||||
@@ -111,5 +114,6 @@ switch ($_REQUEST['action']) {
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
Reference in New Issue
Block a user