'Compute userPassword',
'body'=>plugin_md5_show_form(isset($post['phrase']), $value));
} else {
// Compute (Don't show its $phrase at the same time)
$prefix = isset($post['prefix']);
$salt = isset($post['salt']) ? $post['salt'] : '';
// With scheme-prefix or not
if (! preg_match('/^\{.+\}.*$/', $salt)) {
$scheme = isset($post['scheme']) ? '{' . $post['scheme'] . '}': '';
$salt = $scheme . $salt;
}
return array(
'msg' =>'Result',
'body'=>
//($prefix ? 'userPassword: ' : '') .
pkwk_hash_compute($phrase, $salt, $prefix, TRUE));
}
}
// $nophrase = Passphrase is (submitted but) empty
// $value = Default passphrase value
function plugin_md5_show_form($nophrase = FALSE, $value = '')
{
if (PKWK_SAFE_MODE || PKWK_READONLY) die_message('Prohibited');
if (strlen($value) > PKWK_PASSPHRASE_LIMIT_LENGTH)
die_message('Limit: malicious message length');
if ($value != '') $value = 'value="' . htmlsc($value) . '" ';
$sha1_enabled = function_exists('sha1');
$sha1_checked = $md5_checked = '';
if ($sha1_enabled) {
$sha1_checked = 'checked="checked" ';
} else {
$md5_checked = 'checked="checked" ';
}
$self = get_script_uri();
$form = <<
* = Salt enabled