Jump to content

Redirect on Login for custom pages


Recommended Posts

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

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

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

Link to comment
Share on other sites

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}

Link to comment
Share on other sites

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 by sparky
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by cksp@herodata.com
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
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.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
$_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?

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
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..

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...

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 by jclarke
Link to comment
Share on other sites

  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated