I can detect if a user is logged in or not by $lite = Am_Lite::getInstance(); if($lite->isLoggedIn()){ ....} My question is how can I add a text "logged in as johndoe@example.com" to any page on the site.
if the above code works have you tried inserting between the {} brackets echo 'Is logged in as '.Am_Lite::getInstance()->getUsername() ; Is the line of code in your post correct? I thought it should be: if(Am_Lite::getInstance()->isLoggedIn()){...} this would make your required code something like- if(Am_Lite::getInstance()->isLoggedIn()){ echo 'Is logged in as '. Am_Lite::getInstance()->getUsername() ; } but haven't tried it. I will include some 'if logged in' code in my own site but haven't gotten around to it yet so haven't tried the above yet.
i just used $lite variable, basically the code is the same. getEmail() instead of getUsername(). The problem is solved it works. Thanks