我想在中修改提交的密码wp_logon wp_authenticate
行动进行身份验证时,我想获取提交的密码,修改它,并传递回wp_logon
下面是一个动作do_action_ref_array(\'wp_authenticate\', array(&$credentials[\'user_login\'], &$credentials[\'user_password\']));
我正在添加这样的操作(正如@kaiser所建议的):
add_action("wp_authenticate", "myfunctionhere");
function myfunctionhere($credentials) {
return $credentials[\'user_password\'] = \'foo\';
}
问题是它不会返回到wp\\u signon。还有更多,$credentials
在里面myfunctionhere
值为string(3) "aka"
(用户名)我在这里做的事情,我想修改http://wordpress.org/plugins/login-encryption/ 使用当前wordpress的插件。
这是挂接在wp\\u authenticate上的原始函数
function add_decryption_function() {
global $user_pass;
if ($_REQUEST[\'encryption_code\']) {
// Obtenemos la clave DES usando nuestra clave privada RSA
$key = new RSA(get_option(\'le_rsa_modulus\'), get_option(\'le_rsa_public_key\'), get_option(\'le_rsa_private_key\'));
$code = $key->decrypt($_REQUEST[\'encryption_code\']);
// Obtenemos la clave usando la clave DES
$password = des ($code, hexToString($_REQUEST[\'pwd\']), 0, 0, null, null);
preg_match("/^([\\s\\w]*)/", $password, $res);
$user_pass = $res[1];
$_REQUEST[\'encryption_code\'] = "";
}
}
全局$user\\u pass当然为空我正在测试本地wp登录。php身份验证,没有其他插件。