Magento: Check if an admin is logged in or not
If you are writing a custom module, and you want it to be accessed only by admins, then you possibly need the following code in your controller. //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()){ echo "Admin Logged in"; } else { echo "You need to
iOS: Check whether internet connection is available
Here, i am just checking whether network connectivity is available to a server and its done synchronously. You can use Reachability if you need notifications when there is any change in the network connectivity. For this you have to include the SystemConfiguration.framework in your project. Now add, #import "SystemConfiguration/SystemConfiguration.h" and the below function to your
Read More