I have created a magento extension. I want to implement access to the extension. The extension creates a page in frontend and i want only admin to access that page. So basically
If you are using cm redis session try this: (worked for me)
$sesId = isset($_COOKIE['adminhtml']) ? $_COOKIE['adminhtml'] : false ;
if($sesId){
$session = Mage::getSingleton('core_mysql4/session')->read($sesId);
}
$loggedIn = false;
if($session)
{
if(stristr($session,'Mage_Admin_Model_User'))
{
$loggedIn = true;
}
}
var_dump($loggedIn);
because if you are using cm redis its rewrites db session module with its own model.