bucasia Posted March 28, 2009 Share Posted March 28, 2009 Hi guys, Just customizing WHMCS for the first time - cool software, I like it. I want a login page on my website which I've created based on instructions in this forum. I also want my login page to be the only login page that the customer can get to. So I've edited includes/actionhooks.php and added a line to actionhook_ClientLogout so that when the user logs out they are redirected to my site and my custom login page works well. They only thing I can't figure out how to do is if the user enters an incorrect username/password they end up at /clientarea.php?incorrect=true Any way I can change that so that they end up back at my login page instead? Thanks, Matt 0 Quote Link to comment Share on other sites More sharing options...
Shaun Posted March 29, 2009 Share Posted March 29, 2009 Hi guys, Just customizing WHMCS for the first time - cool software, I like it. I want a login page on my website which I've created based on instructions in this forum. I also want my login page to be the only login page that the customer can get to. So I've edited includes/actionhooks.php and added a line to actionhook_ClientLogout so that when the user logs out they are redirected to my site and my custom login page works well. They only thing I can't figure out how to do is if the user enters an incorrect username/password they end up at /clientarea.php?incorrect=true Any way I can change that so that they end up back at my login page instead? Thanks, Matt there are 2 teplate files login.tpl abd logout.tpl. You could edit these or place php/js redirect code in them 0 Quote Link to comment Share on other sites More sharing options...
bucasia Posted March 29, 2009 Author Share Posted March 29, 2009 Hi Shaun, Thanks for the reply. The closest I've got so far is modifying the line at the top of login.tpl that checks if is an incorrect login to this - {if $incorrect} <meta http-equiv="refresh" content="0; url=https://mysite.com/custlogin.html"> {/if} This works but it briefly loads the normal customer area before redirecting to my site. It looks like I can't use a PHP header line as text has already been sent to the browser, and I don't want to have to rely on javascript being enabled on the client. I guess I could check out doing a redirect using .htaccess if there's nothing in WHCMS to help with it? Thanks, Matt 0 Quote Link to comment Share on other sites More sharing options...
bucasia Posted March 29, 2009 Author Share Posted March 29, 2009 Just an update ... I did what I wanted with Rewrite rules in httpd.conf - Options +FollowSymLinks RewriteEngine on RewriteCond %{QUERY_STRING} ^incorrect=true$ RewriteRule ^clientarea\.php$ [url]https://mysite.com/custlogin.html?[/url] [R=301,L] 0 Quote Link to comment Share on other sites More sharing options...
Shaun Posted March 30, 2009 Share Posted March 30, 2009 Awesome thats a nice little hint! 0 Quote Link to comment Share on other sites More sharing options...
blymp Posted November 26, 2009 Share Posted November 26, 2009 Another update! I did the way with go.php You have to create a go.php file with the code: <?php if ($incorrect) { header( "Location: http://www.your-whmcs-domain.com/clientarea.php?incorrect=true" ); } else { header("Location: /index.php"); // here you can set any page of destination after logging } ?> After edit the login.tpl and where it says: <form action="{$formaction}" method="post" name="frmlogin" id="frmlogin"> replace by: <form action="dologin.php?goto=go" method="post" name="frmlogin" id="frmlogin"> Don't forget to save go.php on the root of WHMCS. 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.