php - Wordpress create account and copy user information to another database -


i'm using woocommerce , customer must logged or create account buy. when create account need password send password web service , create new user other database.

this database used web application , have encrypt password phalcon hash method can't because wordpress password hashed.

how can do ?

there way this. can have access users plain password whenever user logs in there no way recursively of passwords of course. don't think create problem because functionality work logged users without interruption.

you need create hook called wp_authenticate_user:

add_filter('wp_authenticate_user', 'myplugin_auth_login',10,2);  // $priority 10, $accepted_args 2.  function myplugin_auth_login ($user, $password) {       $user_id = $user->id;      // check if passsword converted      $phalcon_hash = get_user_meta( $user_id, 'phalcon_hash' );       if($phalcon_hash == false) {       // convert password        $phalcon_password = use_your_phalcon_hash_method($password);       // connect other db , save pass       send_your_user_info_to_other_db($user_id, $phalcon_password);       // set user meta converted       add_user_meta( $user_id, 'phalcon_hash', true);      } } 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -