Recent Topics

1 Sep 17, 2007 22:06    

My b2evolution Version: 1.10.x

(common - someone must know the post-login function and where to find it. That's all I need to write the mod myself.)

I'd like to redirect blog owners to their own blogspace when they login.

I've narrowed it down to modifying:
\htsrv\login.php

and/or

\inc\MODEL\users\_user.funcs.php

Seems that if you could pull the user-id, you could dynamically write the $redirect_to variable to send them to their blog.

I haven't found any clear directions/hacks to do this. Any tips?

2 Sep 18, 2007 16:44

Find /inc/_main.inc.php, and add the REDIRECT HACK snippet. This will redirect the user to their own blogspace (www.site.com/joe). This assumes you're using the mod_rewrite function.

		if( ! empty($login_action) )
		{ // We're coming from the Login form and need to redirect to the requested page:
			if( $login_action == 'redirect_to_backoffice' )
			{ // user pressed the "Log into backoffice!" button
				$redirect_to = $admin_url;
			}
			else
			{
				param( 'redirect_to', 'string', $baseurl );
				if( $redirect_to != $baseurl )
				{ // taken from param, decode:
					$redirect_to = str_replace('&', '&', $redirect_to);
				}

				// REDIRECT HACK
				// if user not admin, redirect to users blog
				// ie. www.site.com/loginname
				if($current_User->get('level') != '10'){
					$redirect_to = "/".$current_User->get('login');
				}
			}

			header_redirect( $redirect_to );
			exit();
		}


Form is loading...