Yes, I’m sure all of the above is certainly possible. To access the current logged in user’s credentials (for further processing) use the info found in the $_SESSION variables.
Note that Manager users (backend) and Web Users (front end) are two seperate entities so the following snippet will only show the output if you are logged in as a webuser, although if you are logged in to the manager at the same time, both arrays will be shown.
To be able to see exactly what you have to work with, create a new snippet named SessionInfo, with the following code, log in as a Webuser and navigate to the page which has the snippet call.
<?php
/* SessionInfo
usage: call snippet uncached in the content section of a page
[!SessionInfo!]
*/
$output .='';
// show this only if the user is logged in as a web user
if(isset($_SESSION['webValidated'])){
$output .='<p>Welcome, '.$_SESSION['webShortname'].' - you are logged in</p>';
$output .='<p>'.print_r($_SESSION).'</p>';
}
return $output;
?>
The $_SESSION is available no matter which login method you use (default weblogin or WebloginPE).