Jump to content

Login redirects to clientarea.php


Recommended Posts

So just come accross this issue which seems to pop up every nw and again when whmcs is updated. Everything was working fine prior to the update we did to 7.9 (nope not on 7.10 too buggy me thinks).

Anyway, the issue is when a client logs in. The login redirects to the clientarea.php file AND NOT the homepgae i.e. index.php page.

Before the update we had:

<input type="hidden" name="goto" value="index.php">

which worked an prior to that configured the url to have: dologin.php?goto=index which worked in earlier versions. Here is a very old post on the topic:

Did a search on the community and only a hand full of posts pop up:

Thats not helped. That setting is OFF in whmcs so its not that.

BTW no active hooks in place either and using the default template...

Essentially all we are looking to do is on login to redirect to the homepage.tpl i.e. index.php file.

I may be a bit stupid here BUT have they moved this to a hook? or is a hook needed?

Goes a bit beyond me why simple things like this that work suddently stop working with updates.

Can anyone shed some insight here? @brian! or even @Kian

Edited by Manchester Web Hosting
text addition
Link to comment
Share on other sites

8 minutes ago, Manchester Web Hosting said:

Anyway, the issue is when a client logs in. The login redirects to the clientarea.php file AND NOT the homepgae i.e. index.php page.

personally, i'd just use a hook - it's virtually a one-liner... 🙂

<?php

function clientlogin_hook($vars){
	
	echo '<meta http-equiv="refresh" content="0; url=index.php">';
	exit;
}
add_hook("ClientLogin", 1, "clientlogin_hook");
Link to comment
Share on other sites

@brian! thanks.

I thought it may have been a hook 🤮

Didnt wana use a hook due to the refresh (personal preference) and the coded way of just using the input OR updated url worked just fine. Frankly dont understand why stuff like this gets changed. Goes beyond me tbh.

You know. Why dont they just make the whole whmcs a hook. A hook for everything 😒

 

Link to comment
Share on other sites

1 hour ago, Manchester Web Hosting said:

Before the update we had

the obvious question has to be asked - before the update, where did you have this code... and after the update, if updating removed it, did you remember to put it back ??

1 hour ago, Manchester Web Hosting said:

which worked an prior to that configured the url to have: dologin.php?goto=index which worked in earlier versions.

having just tried it, it still works in v7.9 - I added your code to login.tpl in Six (before the submit button) - and upon logging in, I was redirected to the URL in the code (I redirected to Apple) - redirecting just to index.php doesn't seem to work, but if you put your full URL in, then that should.

21 minutes ago, Manchester Web Hosting said:

noticed that using that hook there is an ever so small delay during which the dologin url appears (plus blank white page) I know its only for a second or 2...

nature of the beast with a meta refresh... hopefully the above will make your previous method work again.

Link to comment
Share on other sites

7 minutes ago, brian! said:

the obvious question has to be asked - before the update, where did you have this code... and after the update, if updating removed it, did you remember to put it back ??

Yup added it back in. It was:

<input type="hidden" name="goto" value="index.php">

so are you saying:

8 minutes ago, brian! said:

having just tried it, it still works in v7.9 - I added your code to login.tpl in Six (before the submit button) - and upon logging in, I was redirected to the URL in the code (I redirected to Apple) - redirecting just to index.php doesn't seem to work, but if you put your full URL in, then that should.

to add this back in:

<input type="hidden" name="goto" value="index.php">

BUT with a full url i.e.

<input type="hidden" name="goto" value="https://example.com/index.php">

will give that whirl if it is indeed a full url instead.

Link to comment
Share on other sites

9 minutes ago, Manchester Web Hosting said:

I suspect thats because you are too busy providing 'unofficial' support to whmcs users 👏

more likely it was expecting to have four days away from the internet... yet here I am on Good Friday (though bank holidays mean nothing these days!)... suspect i'll have reason to come online tomorrow, but after that, I shouldn't be here until Tuesday.

Link to comment
Share on other sites

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.

×
×
  • 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