MACscr Posted October 7, 2008 Share Posted October 7, 2008 dologin.php?goto=custom no longer works? It only redirects you to the clientarea and not the custom page that was specified. Why? What should we do instead? I found another thread with this topic, but for some reason there was no way to reply to it even though it wasnt locked. 0 Quote Link to comment Share on other sites More sharing options...
herpherp Posted October 7, 2008 Share Posted October 7, 2008 (edited) I am not sure why this is not working, but what I did is create a php file named go and placed it in my whmcs root directory <?php header("Location: http://www.mysite.com"); ?> I utilize this on my homepage so that when someone logs in from my homepage they are not redirected to another page it simply changes the login box to the links provided and the dologin.php?goto=go does the trick I would think as long as you have the .php file in your main directory that it should forward to that page, I am not utilizing any "custom whmcs pages" so I am not sure how that worked in the past. Hope this is somewhat helpful for a work around... Now if I could just get the logout to utilize the goto command that would be nice Edited October 7, 2008 by herpherp 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted October 8, 2008 Author Share Posted October 8, 2008 I am not sure why this is not working, but what I did is create a php file named go and placed it in my whmcs root directory <?php header("Location: http://www.mysite.com"); ?> I utilize this on my homepage so that when someone logs in from my homepage they are not redirected to another page it simply changes the login box to the links provided and the dologin.php?goto=go does the trick I would think as long as you have the .php file in your main directory that it should forward to that page, I am not utilizing any "custom whmcs pages" so I am not sure how that worked in the past. Hope this is somewhat helpful for a work around... Now if I could just get the logout to utilize the goto command that would be nice so this method you mentioned is working for you with 3.7.2? If so, then goto is obviously working and its something else. 0 Quote Link to comment Share on other sites More sharing options...
ppw Posted November 20, 2008 Share Posted November 20, 2008 Hi, I had the same problem and I make the next tricky solution (at the moment it works for me): In your custompage.php put: //... if ($_SESSION['uid']) { # User is Logged In - put any code you like here } else{ # User is NOT Logged In # Define the template filename to be used without the .tpl extension $templatefile = "login"; # To assign variables in Smarty use the following syntax. This can then be used as {$variablename} in the template setcookie('mycustomgoto', 'custompage.php', 0, '/'); $smartyvalues["formaction"] = 'dologin.php?goto=clientarea'; $smartyvalues["incorrect"] = ''; $smartyvalues["username"] = ''; $smartyvalues["password"] = ''; $smartyvalues["rememberme"] = ''; } //... And in template file header.tpl write at the begin of the file: {if $loggedin && $pagetitle == $LANG.clientareatitle} {php} global $smarty; $cgt = $_COOKIE['mycustomgoto']; setcookie('mycustomgoto', '', -3600, '/'); // Don't need it anymore if($cgt){ $ssluri = $smarty->get_template_vars('systemsslurl'); $redirecturi = $ssluri ? $ssluri : $smarty->get_template_vars('systemurl'); header("Location: $redirecturi/$cgt"); /* Redirect browser */ } {/php} {/if} I know that it is not the best solution, but works. Only three comments: 1.- The browser must has the cookie activated. 2.- Login data is send plain without https. 3.- If you have ssl access to your whmcs client area, IE shows a ssl warning redirection. 2 and 3 can be solved making all pages https (view http://forum.whmcs.com/showthread.php?t=8481), and 1, in my case is a requirement for other issues and neither is a problem. Hope this help, and any advice will be welcomed. Regards. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.