I was trying to make a front end login form by using the WebLogin snippet and found it rather confusing, so I decided to simply send the login form data directly to the manager login processor.
This lets me log in, but I can no longer use $modx->getLoginUserName() in custom snippets. Doing some snooping around (I’m quite new to PHP) I found that the getLoginUserXXX functions return data based on which way the user logged in. In one case we have $_SESSION[’mgrShortname’] and in another we have $_SESSION[’webShortname’].
My question is: what is the purpose for this distinction? The role and privileges of the user is already defined elsewhere in the session.
If I use the standard manager login procedure and then do a preview of my web page, the functions mentioned above all return NULL since my name is in the mgrShortname but I’m actually in the front end..
I’m confused..