PDA

View Full Version : Login/Out Redirect



Joel
09-11-06, 04:18 PM
This should be an easy one.

Would it be possible to have a setting in the admin panel for redirecting the clients upon logging in/out? For instance, I'm using the integrated login form on my site's index, so once they log in, I'd like them to return there. And when they log out, I'd also like them to return to that page (or a different one).

And if you choose not to set this value, then it'll default to the support home page like it already does.

Anyone else think this would be useful?

Adam
09-11-06, 11:11 PM
Hey,

I don't see the purpose in that. I mean you click the login button to login into the WHMCS area and not your homepage? Right?

From,
Adam

Joel
09-13-06, 01:29 PM
My homepage changes if the client is logged in. And since I've got a login form on my homepage, I'd like them to return there.

And there might be times when I want to redirect everyone to an announcement page (or something).

And when the client is logging out, what's the point of having them return to the support page? I'd like to kick them back to the hompage.

For integration purposes there's probably 1001 uses for this feature.

Adam
09-14-06, 12:32 AM
Hey,

I like the logout idea, but thats about it. I guess it wouldn't hurt to add the other option, as long as we can have an off button...

Anyone else?

From,
Adam

Joel
09-14-06, 12:55 AM
Yeah that was the thing... If you don't want to use it, just leave it blank and it'll default to the support page.

MACscr
01-10-07, 04:59 AM
Id like to be able to specify the url in the login form, but i have no problem with that being and admin setting as well.

Basically admin setting would set variable $clientredirect, which would be placed in the login.tpl as so:


<input type="hidden" name="redirecturl" value="{$clientredirect}">

This would give us the option for setting this on other remote login forms as well, just in case we want to send them somewhere else than the default that we had set.


<input type="hidden" name="redirecturl" value="http://SomeWhereElse.com">

I am running into this problem right now as i am working on an integrated solution for whmcs.

P.S. Can anyone think of a way around this until when/if Matt gives us this feature? Ive tried all kinds of things, but since dologin.php never accesses the templates and its encrypted, i cant think of anything that would work.

dan76
10-17-09, 10:46 PM
This thread is old...Is there a solution to this now? I tried running an action hook after login, but it doesn't seem to be working for some reason. (I got a redirect hook working for the logout page, but not the login).

It would be extremely helpful to have access to the dologin.php page so it can be easier to integrate with other systems.

Anyone have any recommendations?

herpherp
10-17-09, 11:08 PM
Anyone have any recommendations?
make a file named go.php (with the following code)and add it to whmcs root directory

<?php
header("Location: /index.php");
?>
You can change index.php to whatever page you want them to land on

Format your login url in your login form to the following or something similar


action="https://YourDomainName.com/YourWHMCS_Directory/dologin.php?goto=go"

Just tested to make sure this method still works and it does... You can also just create extra files for example go2.php if you want to be able to redirect if they login from another page(and change the url path on that page) etc...

There may be more practical ways to accomplish this but it works for now...

Would probably work the same way with logout but I have not tested that theory, just checked and this method only works on login...

dan76
10-18-09, 01:21 AM
Thank you for your help! I'll give this a try.

One quick follow-up question - would it be secure if I included a php or CURL function in the go.php file that passes the login information into a separate system?

Basically, I'm trying to get a user logged into WHMCS while logging into a separate system at the same time.

Thanks again.

blymp
11-26-09, 01:43 AM
Hello everyone, does anybody knows how to include the error information and if in case of invalid email address or password it could return to the login page: /clientarea.php ?

Thanks!