Current User Details


#1

Hi,

I am new to PHP and oxid.I am developing a webshop. How can I take the details of current user who is logged in. I need the code in PHP. The page is not in application folder . I put the page outside the application folder and gave the connection with the database. the page path is public_html/page.php. In this page i need to get the user details(oxid,oxusername etc…) of person who is currently loggged in.

Please help me. Urgent

Thanks in advance.


#2

it will not worl without oxid framework, so you need to include oxid bootstrap first:


require_once "../path/to/oxid/bootstrap.php";
$user = oxRegistry::getSession()->getUser();

$user will give a oxUser object with all the data if user is logged in


#3

Hey vanilla_thunder,

Could you please tell me how can I put require_once “…/path/to/oxid/bootstrap.php”; in a smarty block?

Thank you!


#4

you should not, templates and php backend are two very different things