简体   繁体   中英

restrict user to access pages until he is not logged in for magento1

I created a feedback module in Magento 1 . I want user can access that module only if he logged in I tried that code:

https://magento.stackexchange.com/questions/121221/redirect-to-login-page-if-not-login-magento

but it makes an error and store it into log:

a:4:{i:0;s:60:"Module "Folio3_Feedback" requires module "Magento_Customer".";i:1;s:772:"#0 /opt/lampp/htdocs/magento1937/app/code/core/Mage/Core/Model/Config.php(852): Mage::throwException('Module "Folio3_...')

I tried to search out that link

https://magento.stackexchange.com/questions/88072/how-to-get-current-customer-in-external-file

but I don't know how can I use it and where to put the code?

you are getting this error because there is a dependency defined in module xml config

        <depends>
            <Magento_Customer/>
        </depends>

however Magento_Customer is not the valid core module name in Magento 1, correct one is Mage_Customer. So it should look like this:

        <depends>
            <Mage_Customer/>
        </depends>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM