tinkabellsbitch Posted June 30, 2008 Share Posted June 30, 2008 Hey All, I have custom template and .tpl files that include client login's and redirect back to custom page once loggin occurs via the ?goto= in the form. As is dologin.php?goto=clientarea is the default and prior to an update I used dologin.php?goto=custom (where custom.php and .tpl was my custom pages) Prior to update this seemed to work fine.. now after update it defaults back to the clientarea on login. I am on the latest version of WHMCS. Can someone shed some light on a redirect from a custom page? I am simply wanting it to stay on the custom page after login and not go back to the client area. Thanks CG 0 Quote Link to comment Share on other sites More sharing options...
XN-Matt Posted August 27, 2008 Share Posted August 27, 2008 Did you ever have any further joy with this? M 0 Quote Link to comment Share on other sites More sharing options...
DavidM Posted November 3, 2010 Share Posted November 3, 2010 Does anyone know how to do the redirect mentioned below? The process described doesn't work for me either. David Hey All, I have custom template and .tpl files that include client login's and redirect back to custom page once loggin occurs via the ?goto= in the form. As is dologin.php?goto=clientarea is the default and prior to an update I used dologin.php?goto=custom (where custom.php and .tpl was my custom pages) Prior to update this seemed to work fine.. now after update it defaults back to the clientarea on login. I am on the latest version of WHMCS. Can someone shed some light on a redirect from a custom page? I am simply wanting it to stay on the custom page after login and not go back to the client area. Thanks CG 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted November 3, 2010 Share Posted November 3, 2010 This should help you out... use this in your php file if ($_SESSION["uid"]) { YOUR LOGGED IN CODE HERE } else { $goto = 'testpage'; include 'login.php'; } testpage is the name of the php file in this example 0 Quote Link to comment Share on other sites More sharing options...
DavidM Posted November 4, 2010 Share Posted November 4, 2010 This should help you out... use this in your php file testpage is the name of the php file in this example Sorry, that's of no use to me. I have a logon form in a template that is submitting to the WHMCS encrypted dologin.php file. Somehow a parameter needs to be passed to changed the default profile page that is displayed upon logon unless there is some setting somewhere that does it? In the original post here it was shown that a goto parameter could be passed with the new page you wanted the user directed to. They also stated this no longer works. So I'm asking if there is another way to do this when having to call the dologin.php page. Unless your implying I create my own logon.php file? Here's my form code from the template: {if !$loggedin} <form method="post" action="{$systemsslurl}dologin.php?goto=home.php"> <dl> <dt>{$LANG.loginemail}</dt><dd><input name="username" type="text" value="{$username}" class="inputbox1" /></dd> <dt>{$LANG.loginpassword}</dt><dd><input name="password" type="password" value="{$password}" class="inputbox1" /></dd> <dd><input type="checkbox" name="rememberme" class="style_checkbox" />{$LANG.loginrememberme}</dd> <dd><button type="submit" class="BtnSmall"><span>{$LANG.loginbutton}</span></button></dd> </dl></form> <small><a href="pwreset.php">{$LANG.loginforgotten}</a></small> {else} <p class="greeting">Hi {$loggedinuser.firstname}, {$greeting} !</p> <ul> <li><a href="clientarea.php">{$LANG.ii_mydashboard}</a></li> <li><a href="logout.php">{$LANG.logouttitle}</a></li> </ul> {/if} 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted November 4, 2010 Share Posted November 4, 2010 (edited) The goto should not include the .php It should be like <form method="post" action="{$systemsslurl}dologin.php?goto=home">You can also try to have the goto as a hidden var like this so that it gets passed as a post variable <form method="post" action="{$systemsslurl}dologin.php"> <input type="hidden" name="goto" value="home" /> Edited November 4, 2010 by sparky 0 Quote Link to comment Share on other sites More sharing options...
DavidM Posted November 4, 2010 Share Posted November 4, 2010 The goto should not include the .phpIt should be like You can also try to have the goto as a hidden var like this so that it gets passed as a post variable Thanks, I actually tried the hidden tag and tried using the parameter with and without the .php. I guess the point I should have made is the goto parameter has no effect on redirecting the home page. The user at the beginning of the thread said it used to work for him but then stopped after an upgrade. So the question is should goto actually work in WHMCS? 0 Quote Link to comment Share on other sites More sharing options...
cksp@herodata.com Posted November 4, 2010 Share Posted November 4, 2010 (edited) I've tried it as well as a goto parameter, without success. I would like to have a way to use the DoLogin and have it go to any page I want. Has anyone figured this out? The more I try to do with my trial of Whmcs, the more I keep running into restrictions when I want add features. Maybe I'm asking for too much, since my basis of comparison of my last project was using CubeCart, which only php encodes a handful of files, and everything else is open. Edited November 4, 2010 by cksp@herodata.com 0 Quote Link to comment Share on other sites More sharing options...
dannyl Posted December 22, 2010 Share Posted December 22, 2010 Because someone has found a solution? I'm trying for quite a while to find a way to redirect the user after login to index.php. 0 Quote Link to comment Share on other sites More sharing options...
DavidM Posted December 22, 2010 Share Posted December 22, 2010 This is now working for me with the 4.4.1 update: <form action="{$systemsslurl}dologin.php?goto=index.php" method="post" name="frmlogin"> David 0 Quote Link to comment Share on other sites More sharing options...
MichaelJDance Posted January 27, 2011 Share Posted January 27, 2011 is there a good way i could set up a whmcs page where our sales and support can view the Support Center when they log in so they cant see the Admin Summary, as i personally dont want the sales and support team seeing that page. And a way to log IPs who log in? 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted January 27, 2011 Share Posted January 27, 2011 is there a good way i could set up a whmcs page where our sales and support can view the Support Center when they log in so they cant see the Admin Summary, as i personally dont want the sales and support team seeing that page. And a way to log IPs who log in? Have a look at Setup > Administrator Roles. You can set a whole range of permissions for each type of staff user. 0 Quote Link to comment Share on other sites More sharing options...
yrdesign Posted January 30, 2011 Share Posted January 30, 2011 Study, study.Study, study. 0 Quote Link to comment Share on other sites More sharing options...
Mr-Yellow Posted February 21, 2011 Share Posted February 21, 2011 $_SESSION['loginurlredirect'] = $_SERVER['REQUEST_URI']; $templatefile = "login"; outputClientArea($templatefile); 0 Quote Link to comment Share on other sites More sharing options...
jose.felipe Posted March 4, 2011 Share Posted March 4, 2011 $_SESSION['loginurlredirect'] = $_SERVER['REQUEST_URI']; $templatefile = "login"; outputClientArea($templatefile); Hi, Thanks for the code. It may work on your custom page, but what if we havevto do it in a whmcs 'core page' (i.e., a page you cant add these lines of php code)? In the register page, for examp´le? 0 Quote Link to comment Share on other sites More sharing options...
computers.wheneva Posted April 24, 2011 Share Posted April 24, 2011 the following also works <form method='post' action='http://{systemurl}/dologin.php?goto=clientarea.php?action=invoices'> Email Address: <input type='text' name='username' size='50' /><br /> Password: <input type='password' name='password' size='20' /><br /> <input type='submit' value='Login' /></form>"; Thanks Computers Wheneva http://www.wheneva.co.za 0 Quote Link to comment Share on other sites More sharing options...
wilmatan Posted May 7, 2011 Share Posted May 7, 2011 Study, study.Study, study. Nice one dude! I'll need to study about this too! 0 Quote Link to comment Share on other sites More sharing options...
Manchester Web Hosting Posted July 17, 2011 Share Posted July 17, 2011 is there a good way i could set up a whmcs page where our sales and support can view the Support Center when they log in so they cant see the Admin Summary, as i personally dont want the sales and support team seeing that page. And a way to log IPs who log in? Have been looking for a way to this for ages now. even though you could possibly redirect initial login to a custom page or even support center, the links would still be shown and if you try to access then you get an ugly page that says you don't have permission to perform this action. ideally it would be good to either remove the links and have a redirect if the link was used, say back to support center.. 0 Quote Link to comment Share on other sites More sharing options...
simone45 Posted October 11, 2011 Share Posted October 11, 2011 Thanks for letting me know about other good stuff! 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 28, 2013 Share Posted July 28, 2013 (edited) Here is an updated version for WHMCS 5.2.x define("CLIENTAREA",true); require("init.php"); $ca = new WHMCS_ClientArea(); $ca->initPage(); $ca->requireLogin(); if ($ca->isLoggedIn()) { } The $ca->requireLogin() line saves in the session where to redirect back to after your login. Edited July 28, 2013 by jclarke 0 Quote Link to comment Share on other sites More sharing options...
Hamsaffar Posted January 18, 2018 Share Posted January 18, 2018 Hello, Would you please write an updated version for whmcs 7.4 ? Yours Sincerely, Hamsaffar 1 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.