WordPress.org

Ready to get started?Download WordPress

Forums

Page Restrict
redirect too>> (4 posts)

  1. Tork
    Member
    Posted 1 year ago #

    is there a way that peeps after login getting redirected strait intoo web itself instead the dashboard???
    i wanted them to get strait to webcontent.....

    thank you!

    http://wordpress.org/extend/plugins/pagerestrict/

  2. Tork
    Member
    Posted 1 year ago #

    sofar the support.... ill guess

  3. g60dave
    Member
    Posted 1 year ago #

    i would like to know if this can be done too, at present i have created a hyper link on the first page but its not ideal

  4. squalyl
    Member
    Posted 1 year ago #

    I had a similar problem.

    The page restrict form correctly contains an

    <input type="hidden" name="redirect_to" value="' . $_SERVER['REQUEST_URI'] . '" />

    that redirects the user logging in to the original page, okay.

    My problem was registration of new users.

    The page restrict form contains this following code to add a "register" link:

    if ( get_option('users_can_register') )
    $pr_page_content .= '	<a href="' . get_bloginfo ( 'wpurl' ) . '/wp-register.php">'.__('Register','pagerestrict').'</a> | ';

    I modified the plugin to add a register_to parameter to the wp-register URL.

    The problem is that wp-register does NOT forward this redirection variable after the user has completed the registration dialog, so the following "login" page does not redirect ok.

    The solution was to replace the call to wp-register.php by a call to wp-login.php?action=register&redirect_to=...

    I don't know the difference, but it works!

    So now the plugin code to generate the register link reads:

    if ( get_option('users_can_register') ) {
    	//if the redirect url is not empty, pass this to the register dialog
    	if(strlen(trim($_SERVER['REQUEST_URI']))>0) {
    		$redir="&redirect_to=".$_SERVER['REQUEST_URI'];
    	} else {
    		$redir="";
    	}
    	$pr_page_content .= '	<a href="' . get_bloginfo ( 'wpurl' ) . '/wp-login.php?action=register'.$redir.'">'.__('Register','pagerestrict').'</a> | ';
    }

    and it works.
    It would be nice if the plugin author was ok to integrate this change in the next version of the page restrict plugin... thanks!

    Also note, that I had problems with Theme My login. I choose to delete this plugin, and use the standard wordpress login/register page instead.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.