BUG-15561 Cambiar el algoritmo o metodo de cifrado... SOLVED

- It don't have the functionality.
- A function was add in class bootstrap hasPassword.
- a function was add in class enterprise.
This commit is contained in:
Marco Antonio Nina
2014-09-22 09:58:50 -04:00
parent c4f0578bd1
commit 48d963a033
23 changed files with 2182 additions and 1937 deletions

View File

@@ -105,6 +105,12 @@ class enterprisePlugin extends PMPlugin
public function install()
{
$pluginRegistry = &PMPluginRegistry::getSingleton();
$pluginDetail = $pluginRegistry->getPluginDetails("enterprise.php");
$pluginRegistry->enablePlugin($pluginDetail->sNamespace);
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
}
public function uninstall()
@@ -113,25 +119,16 @@ class enterprisePlugin extends PMPlugin
public function setup()
{
$urlPart = substr(SYS_SKIN, 0, 2) == 'ux' && SYS_SKIN != 'uxs' ? 'main/login' : 'login/login';
$this->registerMenu("setup", "menuEnterprise.php");
//including the file inside the enterprise folder
////including the file inside the enterprise folder
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.pmLicenseManager.php';
$this->registerTrigger(PM_LOGIN, "enterpriseSystemUpdate");
$licenseManager = &pmLicenseManager::getSingleton();
$oHeadPublisher = &headPublisher::getSingleton();
$this->registerTrigger(PM_HASH_PASSWORD, 'setHashPassword');
}
public function enable()
{
$this->setConfiguration();
$pluginRegistry = &PMPluginRegistry::getSingleton();
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
require_once (PATH_CORE . 'classes/model/AddonsStore.php');
AddonsStore::checkLicenseStore();
@@ -348,6 +345,28 @@ class enterprisePlugin extends PMPlugin
fclose($file);
}
}
public function hashPassword ($pass, $previous=false)
{
G::LoadClass( "configuration" );
$config= new Configurations();
$typeEncrypt = $config->getConfiguration('ENTERPRISE_SETTING_ENCRYPT', '');
//$typeEncrypt = ($typeEncrypt == null) ? 'md5' : isset($typeEncrypt['current']) ? $typeEncrypt['current'] : 'md5';
$encrypt = 'md5';
if ($typeEncrypt != null) {
if (isset($typeEncrypt['current']) && $typeEncrypt['current'] != '') {
$encrypt = $typeEncrypt['current'];
error_log('hashPassword bootstrap ' . $encrypt);
}
if ($previous && isset($typeEncrypt['previous']) && $typeEncrypt['previous'] != '' ) {
$encrypt = $typeEncrypt['previous'];
error_log('hashPassword bootstrap ' . $encrypt);
}
}
eval("\$var = hash('" . $encrypt . "', '" . $pass . "');");
return $var;
}
}
$oPluginRegistry = &PMPluginRegistry::getSingleton();