Fix license validation support for the actions by email feature

This commit is contained in:
Gustavo Cruz
2015-03-10 16:32:57 -04:00
parent ff73432671
commit d7380b182e
6 changed files with 42 additions and 19 deletions

View File

@@ -46,11 +46,15 @@ class ActionsByEmailFeature extends PMFeature
public function executeTriggers($triggerId, $data)
{
if (PMLicensedFeatures
::getSingleton()
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
$method = $this->triggers[$triggerId];
require_once PATH_FEATURES. $this->sFeatureFolder . DS .$this->classInstance['filename'];
$actionsByEmail = new $this->classInstance['classname']();
$actionsByEmail->$method($data);
}
}
public function registerTrigger($triggerId, $method)
{

View File

@@ -13,7 +13,7 @@ class ActionsByEmailService
{
if (\PMLicensedFeatures
::getSingleton()
->verifyfeature('zCeazVrMjVTQVVLcTdwSHNaSzMwTGNCdXRqTm9aYlEzVnI=')) {
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
switch ($params['type']) {
case 'configuration':
require_once 'classes/model/AbeConfiguration.php';
@@ -33,11 +33,11 @@ class ActionsByEmailService
public function loadConfiguration($params)
{
if ($params['type'] != 'activity'
|| (\PMLicensedFeatures
|| !\PMLicensedFeatures
::getSingleton()
->verifyfeature('zCeazVrMjVTQVVLcTdwSHNaSzMwTGNCdXRqTm9aYlEzVnI=')))
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0='))
{
return NULL;
return false;
}
set_include_path(PATH_FEATURES . 'ActionsByEmail' . PATH_SEPARATOR . get_include_path());
require_once 'classes/model/AbeConfiguration.php';

View File

@@ -6,16 +6,10 @@ namespace Features;
*/
class FeaturesHandler
{
public function retrieveConfigurations($params)
{
foreach ($this->getFeatureList() as $feature) {
}
}
public function loadConfiguration($params)
{
$features = $this->getFeatureList();
$configurations = array();
foreach ($features as $feature) {
$service = $this->getFeatureService(array('name' => $feature->name));
$configurations[] = $service->loadConfiguration($params);

View File

@@ -28,7 +28,7 @@
class PMFeatureRegistry
{
private $features = array ();
private $keys = array ('ActionsByEmail' => 'zCeazVrMjVTQVVLcTdwSHNaSzMwTGNCdXRqTm9aYlEzVnI=');
private $keys = array ('ActionsByEmail' => 'zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=');
private static $instance = null;
/**

View File

@@ -2,7 +2,7 @@
/*----------------------------------********---------------------------------*/
if (PMLicensedFeatures
::getSingleton()
->verifyfeature('zCeazVrMjVTQVVLcTdwSHNaSzMwTGNCdXRqTm9aYlEzVnI=')) {
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
switch ($_REQUEST['action']) {
case 'processABE' :
$G_PUBLISH = new Publisher();

View File

@@ -29,5 +29,30 @@ class System extends Api
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}
/**
* @return array
*
* @author Gustavo Cruz <gustavo.cruz@colosa.com>
* @copyright Colosa - Bolivia
*
* @url GET /enabled-features
*/
public function doGetEnabledFeatures()
{
try {
$enabledFeatures = [];
$keys = array ('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=');
foreach ($keys as $key) {
if (\PMLicensedFeatures
::getSingleton()
->verifyfeature($key)) {
$enabledFeatures[] = $key;
}
}
return $enabledFeatures;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}