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

@@ -19,6 +19,15 @@ EOT
}
*/
CLI::taskName('change-password-hash-method');
CLI::taskDescription(<<<EOT
Create .po file for the plugin
EOT
);
CLI::taskArg('workspace', false);
CLI::taskArg('hash', false);
CLI::taskRun("change_hash");
//function run_addon_install($args, $opts) {
function run_addon_install($args)
{
@@ -92,3 +101,46 @@ function run_addon_install($args)
//echo "** Installation finished\n";
}
function change_hash($command, $opts)
{
if (count($command) < 2) {
$hash = 'md5';
} else {
$hash = array_pop($command);
}
$workspaces = get_workspaces_from_args($command);
require_once (PATH_GULLIVER . PATH_SEP . 'class.bootstrap.php');
Bootstrap::LoadClass("plugin");
foreach ($workspaces as $workspace) {
CLI::logging("Checking workspace: ".pakeColor::colorize($workspace->name, "INFO")."\n");
$path = PATH_DATA . 'sites' . PATH_SEP . $workspace->name . PATH_SEP;
try {
if (file_exists($path . 'plugin.singleton')) {
define('SYS_SYS', $workspace->name);
define('PATH_DATA_SITE', $path);
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->setupPlugins();
$oPluginRegistry->unSerializeInstance(file_get_contents($path . 'plugin.singleton'));
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->unSerializeInstance(file_get_contents($path . 'plugin.singleton'));
if ($oPluginRegistry->existsTrigger ( PM_HASH_PASSWORD )) {
$response = new stdclass();
$response->workspace = $workspace;
$response->hash = $hash;
$workspace->changeHashPassword($workspace->name, $response);
$workspace->close();
CLI::logging(pakeColor::colorize("Changed...", "ERROR") . "\n");
} else {
CLI::logging(pakeColor::colorize("You can't use the \"change-password-hash-method\" option because the license has expired or your workspace doesn't have the Enteprise plugin enabled.", "ERROR") . "\n");
}
} else {
CLI::logging(pakeColor::colorize("You can't use the \"change-password-hash-method\" option because the license has expired or your workspace doesn't have the Enteprise plugin enabled.", "INFO") . "\n");
}
} catch (Exception $e) {
echo "> Error: ".CLI::error($e->getMessage()) . "\n";
}
}
}