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!
I think $modx->getLoginUserID() is working only in manager. Use $_SESSION[’mgrInternalKey’] instead to get user id.
-
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.