View Full Version : Redirect on Login for custom pages
tinkabellsbitch
06-30-08, 11:45 PM
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
XN-Matt
08-27-08, 02:55 AM
Did you ever have any further joy with this?
M
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
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
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}
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" />
The goto should not include the .php
It 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?
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.
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.
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
offsitenoc
01-19-11, 12:26 PM
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}
I think you are right.
MichaelJDance
01-27-11, 08:48 AM
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?
Alistair
01-27-11, 11:17 AM
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.
yrdesign
01-30-11, 12:56 AM
Study, study.Study, study.
Mr-Yellow
02-21-11, 06:08 PM
$_SESSION['loginurlredirect'] = $_SERVER['REQUEST_URI'];
$templatefile = "login";
outputClientArea($templatefile);
jose.felipe
03-04-11, 02:14 AM
$_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?
himansu
03-19-11, 11:11 AM
Nice information
jckjones29
04-21-11, 06:07 PM
Hi,
This is wonderful topic and describe the full detail of login scenario.By default after connecting login redirects the user to a page of your profile and account or if you edit the LOGIN_REDIRECT_URL you can send the user to another page you specify in settings.py.This is great, but I'd like the user (after connecting) to be redirected to a personalized page where you show the link to that page something like: mysite.com. LOGIN_REDIRECT_URL settings/default profile or accounts would not work in this case because both are somehow static. In my case the address section username is modified for each user.
computers.wheneva
04-24-11, 04:28 PM
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
wilmatan
05-07-11, 02:05 PM
Study, study.Study, study.
Nice one dude! I'll need to study about this too! ;)
Manchester Web Hosting
07-17-11, 02:29 PM
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..
simone45
10-11-11, 11:05 AM
Thanks for letting me know about other good stuff!
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.