Magento check admin is logged or not and get admin details

Here is a simple script to check admin is logged or not and if logged get admin details of Magento.You can call to the session and the call to user function to get all details.

     $userDetails = Mage::getSingleton('admin/session');    // Get data from the session
     $userID      = $userDetails->getUser()->getUserId();   // Get user ID
     $userID      = $userDetails->getUser()->getEmail();   // Get user Email

Following example will show check admin is logged or not.

   //get the admin session
   Mage::getSingleton('core/session', array('name'=>'adminhtml'));
  //verify if the user is logged in to the backend
   if(Mage::getSingleton('admin/session')->isLoggedIn()){
        // admin login
   }
   else
   {
       //  not admin login
   }