bluetreehost Posted May 29, 2007 Share Posted May 29, 2007 Hello to all! I am working to integrate the login form on my main page, external to the WHMCS templating system. Adding a login form is easy - it is just HTML code that points to the whmcs code. However, I only want to display this code if the client has not already logged in. I think what I need to do is create some PHP code to check for the login cookie or session information. However, everything I have tried to do has not worked properly. Does anyone know of information relating to this? Namely, I am looking for session or cookie information that I can retreive from an external page outside of whmcs. 0 Quote Link to comment Share on other sites More sharing options...
l0gic Posted May 29, 2007 Share Posted May 29, 2007 Edit: Whoops, just saw that you said "external" from the templating system. Yeah, you'll have to manually check the session ID and stuff, I think. Sorry for my airheaded response. ------------------ If you include the smarty stuff from the WHMCS folders, then you can do a simple smarty if statement using the $loggedin variable. Otherwise... hrm... well that's how I'd do it. 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted May 29, 2007 Share Posted May 29, 2007 You could also use the cookies to auto populate the login fields. 0 Quote Link to comment Share on other sites More sharing options...
bluetreehost Posted May 29, 2007 Author Share Posted May 29, 2007 After sleeping overnight on this, I realized that I could do this by setting my own cookie with javascript. After setting this cookie on the WHMcs page (using the $loggedin variable) then I can read it on my other pages. Thanks for the inspiration 0 Quote Link to comment Share on other sites More sharing options...
trine Posted May 29, 2007 Share Posted May 29, 2007 (off-topic) dave, I like your logo! 0 Quote Link to comment Share on other sites More sharing options...
bluetreehost Posted May 29, 2007 Author Share Posted May 29, 2007 Thank you! To anyone who would find this interesting, what I am doing is putting an {if} switched loggedin parameter on the support area of the site. If it is logged in, I display a welcome message along with javascript code to set a simple cookie. That handles WHMcs branded areas of the site. For non-WHMcs areas, I am then reading this cookie and displaying either a login form, or the same welcome message. The tricky part is that I want to make sure that my custom cookie and the whmcs session mesh as far as whether they are logged in or not. I think it is possible because the session only lasts as long as you are logged in, unless you check that "keep me logged in" box. So I still have sonme debugging to go as far as making sure that all lines up correctly. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted May 29, 2007 WHMCS CEO Share Posted May 29, 2007 If your pages are PHP, you can include the file dbconnect.php and then just check if $_SESSION['loggedinstatus'] is set. Matt 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.