If you are not building a module (which is recommended way to extend the system), than best approach that you can take is to:
- Read activeCollab's session ID that's stored in a cookie (HTTP only, not available to JavaScript). Variable name is different from system to system and all start with
ac_activeCollab_sid_#UNIQUE-VALUE#
so you should check stored values for a system where you are already logged in to see which exact variable you should look at. - Once you get session key from a cookie, query
acx_user_sessions
table using that key to see if session exists and who is logged in. Key format is:#USER-ID#/#SESSION-ID#/#TIMESTAMP#
so explode the value to get the bits that you need.
Note that we do not recommend that you do external transformation of the data that's in the database. Read it, but don't write anything - leave that to activeCollab or implement desired functionality as a module (link provided above).