Here is a possible solution on how to make cms mages available only to logged in customers.
Override the Mage_Cms_PageController. Here is a how to do it: http://www.extensionprogrammer.com/skin/frontend/default/dermodpro/pdf/magento-cheatsheet.pdf
Now add the following method in your new controller
public function preDispatch(){
$restrictedIdentifiers = array('about-magento-demo-store');
$pageId = $this->getRequest()
->getParam('page_id', $this->getRequest()->getParam('id', false));
$page = Mage::getModel('cms/page')->load($pageId);
parent::preDispatch();
if (in_array($page->getIdentifier(), $restrictedIdentifiers)){
if (!Mage::getSingleton('customer/session')->authenticate($this)) {
$this->setFlag('', 'no-dispatch', true);
}
}
}
That's it. Enjoy.
I know it's not 100% clean solution.
If you want the clean solution, add a new field for the cms_page table (let's call it 'password_protect'), add the field in the admin form. After doing this the code above becomes:
public function preDispatch(){
$pageId = $this->getRequest()
->getParam('page_id', $this->getRequest()->getParam('id', false));
$page = Mage::getModel('cms/page')->load($pageId);
parent::preDispatch();
if ($page->getPasswordProtect()){
if (!Mage::getSingleton('customer/session')->authenticate($this)) {
$this->setFlag('', 'no-dispatch', true);
}
}
}
Marius.