Jump to content

Check if client is logged in (on website homepage)


Recommended Posts

Hello,

 

I was wondering if there is any way to check whether a client is logged in on my homepage.

 

I have the WHMCS portal/panel integrated already and I want to show a log in box on my homepage.

 

I want it so that if they are not signed in, a login form appears (already have the code for that) and if they are signed in, then it shows the following:

 

Welcome Back, [first name]!

[Link to portal]

[sign out link]

 

I was also wondering if it was possible to show an admin page link if the user is an admin.

 

Any suggestions about how to show different text if they are signed in or if they are signed out?

 

The current portal is at http://portal.willhosting.com/ and the website is at http://willhosting.com (though, we are working on a beta one, too)

 

If anyone could help, it would be greatly appreciated by Will Hosting and by our clients. :-)

Link to comment
Share on other sites

Code to check if user is logged in or not

{if !$loggedin }

 

Show text A and login form

 

{else}

 

Show text B

 

{/if}

 

Code for Welcome message

 

{if $loggedin}

 

Welcome <strong>{$loggedinuser.firstname}</strong>,  

 

{else}

 

<a href="clientarea.php" title="{$LANG.loginbutton}"><strong>

 

{$LANG.loginbutton}</strong></a>

 

{/if}

 

I hope this will help you :) Best of luck!

Link to comment
Share on other sites

On my site I use a plain XHTML/CSS design for the main site and then WHMCS for the billing/support. I try to make my website and WHMCS flow together without noticing but the problem with that is that I can't really use scripts that only work on WHMCS because it will disappear on other pages. :(

 

Jack

Link to comment
Share on other sites

well in all fairness i have WHMCS in one folder and my website in the public

 

So passing the session over to the main website is needed to make for a seemless intergration.

 

Now in all fairness i know i have had a email somewhere with veriables in it so i will have a look and get back to you.

Link to comment
Share on other sites

  • 2 months later...
well in all fairness i have WHMCS in one folder and my website in the public

 

So passing the session over to the main website is needed to make for a seemless intergration.

 

Now in all fairness i know i have had a email somewhere with veriables in it so i will have a look and get back to you.

 

Thanks mate. I'd love to hear how it goes for you.

 

Jack

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.

  • 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