Any advice on fixing my "loginRedirect" error?
spit
Joined: 2007-08-20
Posts: 14 |
Posted: Mon, 2007-08-20 17:04 |
My problem: I can't get "loginRedirect" to redirect to the page I want. Detail: What I want to achieve: The code I currently have is exactly as Valiant suggested (it works like a dream in terms of embedding, but I can't get any redirection working): require_once(dirname(__FILE__) . '/../embed.php'); I believe I need to use something along the lines of the following but I can't get it to work: Any help would be gratefully received. Thanks, |
|
Posts: 14
I've since (partly) solved this and can now get "loginRedirect" working, however I misunderstood it's purpose. I thought it would redirect to a different page AFTER successful login, however all it does is redirect to a new login page BEFORE logging in.
Is there any way to be transferred to a different logged-IN page AFTER logging in?
Posts: 32509
> Is there any way to be transferred to a different logged-IN page AFTER logging in?
yes. the useralbum module does that already. it redirects the user to his own user-album after login.
you can create your own g2 module to redirect anywhere you want.
sample code:
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 14
Valiant,
Thanks for the fast reply.
How would I enter my URL - would I replace the line:
with something like:
I have also just found a previous post of yours that approaches this from a different angle: http://gallery.menalto.com/node/58797
Is there an advantage of one method over the other?
Thanks in advance.
Posts: 32509
change the line to:
$redirectUrlParams = array('href' => 'http://www.mysite.com/mypageiwant');
'href' is for any URL. 'view' and 'controller' are for G2 views/controllers (Model View Controller pattern).
@other approach:
i already forgot about that. yes, that could work too.
the approaches are a bit different. the other approach has the advantage that you can put the login form anywhere on your site, it doesn't have to be in G2.
this approach here is an integrated solution, using the normal login form of G2.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage