Announcement

Collapse
No announcement yet.

Reading Curent user info

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading Curent user info

    I use Joomla CMS and need to read Joomla session variable with curent Username --> into the SC App.
    Any ideas of the best approach ?

    Arthur
    -----------------------------------------
    Arthur Klisiewicz
    dATA POINT SOFTWARE
    www.datapointsoftware.com

  • #2
    I guess you need the configuration.php and change the $session_handler (see https://www.ostraining.com/blog/joom...rationphp-file)
    I guess you need to check jos_session for it. Just do a search on that table.

    Comment


    • #3
      I know is http://docs.joomla.org/JFactory/getUser but really don't know how from SC (and interested to). I guess the trick is in some includes.
      /Giuseppe

      Professional Scriptcase Services
      Some Customers opinions

      Comment


      • #4
        rr - thanks for great tip !

        unfortunately they do not explain the difference between dB and NONE handlers. I assume if it is set to dB then your next line is true and the jos_session holds that information.
        I tested this on standard default Joomla v3.2 installation and my working site.
        IT seems like testing against session table should be enough, although one more question arise:

        Say I want to test upon opening any SC app to see if the particular logged in user should be able to access the App or not. This should be easy, however I would like to have this implemented as function (or method) globally so I do not have to replicate the code for that in every App. What would be the best approach to do this ?
        I would like to see something simple like:

        IF useraccess(ID)=TRUE
        StartApp
        ELSE
        ShowError
        END
        -----------------------------------------
        Arthur Klisiewicz
        dATA POINT SOFTWARE
        www.datapointsoftware.com

        Comment


        • #5
          Sadly enough my joomla experience is rather ancient. I guess you could add it in the library, I would choose the public library for that. You can use functions from the public library over the whole application.

          Comment

          Working...
          X