Jump to content

EASY: Admin vs. Client as well as getting language


Recommended Posts

I have 2 simple questions I'd like to ask as a developer.

 

 

First off, how can I see whether the user logged in is an administrator or client as well as if it's from the admin or client side?

Some hooks run both admin and client side and for some I may only want to run when it's an administrator in the admin area, such as editing a client details. I don't want it to screen clients from themselves if not needed, and possibly vice versa later on, so I was just curious as to the best method of doing so. Keep in mind a user can be logged in as an administrator and client at the same time as well as spoof the headers. I could check the URL with the admin area but I want to be on the safe side with it.

 

 

Secondly, how can I get the admin or client's set language? I figured out how to get the system's language but not a specific user's. If I can't do that then how can I load a proper language file from an addon when visiting a page that doesn't normally load it itself?

 

 

I'll look through the original source code later to find out if need be but I was just wondering and hoping to save some time, WHMCS has a lot of files to look through :roll:

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