We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7016
    • 1 Posts
    hi all, i`ve got eform finally working, but there’s still one problem: i’m doing some validation wiht events and want to access the userid from within the snippet-function over $modx->getLoginUserID(); everything else like database access over the $modx is working, but i just can^t figure out how and why this one won’t... anyone can help? or is there some other way i can pass the modx-userid to the validation-snippet...
    thanks!
      • 16610
      • 634 Posts
      I think $modx->getLoginUserID() is working only in manager. Use $_SESSION[’mgrInternalKey’] instead to get user id.
        Mikko Lammi, Owner at Maagit
        • 22303 MODX Staff
        • 10,725 Posts
        $modx->getLoginUserID() works fine from manager or front-end; but it will only return the user ID for web_users from the front-end, and manager users from the back-end, unless you tell it to look for the user in a specific context. In other words, $modx->getLoginUserID() called from the front-end would get the current web user id from session, while adding $modx->getLoginUserID(’mgr’) would get the manager user id from session.