Ask your WordPress questions! Pay money and get answers fast! (more info)

redirection to previous page after custom registration

  • REFUNDED

Bonjour,

J'utilise pour un client le plugin wp-client qui permet aux utilisateurs de s'enregistrer eux mêmes (avec une validation automatique du compte) et de créer leur espace perso. Ce plugin utilise une page d'enregistrement customisé et renvoie sur une page de remerciement.

J'utilise en parallèle un deuxieme plugin 'Nextend auto Login on Register 'qui permet après l'inscription une auto connexion de l'utilisateur mais qui annule la redirection de la page remerciement pour revenir sur la page d'accueil.

Je voudrais qu’après l'inscription, l'utilisateur revienne automatiquement sur la page précédente (celle avant la page inscription) tout étant automatiquement connecté à son nouveau compte.


Comment puis je procéder ?

Merci
=========================================

Hello

I use for a client the plugin call "wp-client" that enables users to self register (after automatic validation of the account) and to create their own personnal space. This plugin uses a customised registration webpage that sends to a thank you page

I use in parallel a second plugin called 'nextend auto login on register' that enables an automatic connection after the registration process. This plugin cancels the redirection of the thank you page and brings the user back to the welcome page.

What i am looking for is that after the registration process, the user is automatically redirected to the previous (the one the user visited before the registration) whilst keeping the ability to auto connect.

How can i proceed?
Thanks

Answers (2)

2013-02-08

Francisco Javier Carazo Gil answers:

Maybe the best solution is to disable the second plugin, and look for documentation of the first one to see if there are a hook to be able to do the redirect.


neoseeyou comments:

Hello Francisco,

Thanks for the reply, unfortunatly the documentation is not very extended like their support.

In a perfect world, i wish to disable the second plugin and add php code in the first plugin to auto login and redirect to previous page of course ;-) but my knowledge in php and coding are not enaugh

I copy/past the small code of the second plugin here in case it help

function new_auto_log_in($user_id){
/*
If user not logged in, the register made on front-end.
*/
if(!is_user_logged_in()){
$secure_cookie = is_ssl();
$secure_cookie = apply_filters('secure_signon_cookie', $secure_cookie, array());
global $auth_secure_cookie; // XXX ugly hack to pass this to wp_authenticate_cookie
$auth_secure_cookie = $secure_cookie;

wp_set_auth_cookie($user_id, true, $secure_cookie);
$user_info = get_userdata($user_id);
do_action('wp_login', $user_info->user_login, $user_info);
}
}

add_action('user_register', 'new_auto_log_in');


neoseeyou comments:

if it need i can provide a link to my dev website and/or create an access in ftp to see the core files of the first plugins, just tell me


Francisco Javier Carazo Gil comments:

neoseeyou which link is the one that users go before going to sign up? It can be any?


neoseeyou comments:

yes it can be any

2013-02-08

Arnav Joy answers:

can you show me link of your site ?

i think you have to pass redirect_url parameter that will send user back to page.


neoseeyou comments:

Hello Arnay

here is the link http://www.totalwebdesign.fr/testclient123/