I have a custom module in my magento (version 1.5) and it's meant to load the currently logged in admin username like this in one of my controller:
$current_user = Mage::getSingleton('admin/session')->getUser();
if ($current_user) {
$this->current_user = $current_user->getUsername();
} else {
$this->current_user = '';
}
When the code runs, $this->current_user
is empty, so I did a var_dump($current_user); exit();
and it appears to be null
akways (even if I am logged in).
Any ideas why this might be?