简体   繁体   English

限制用户访问页面,直到他未登录magento1

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

I created a feedback module in Magento 1 . 我在Magento 1创建了一个反馈模块。 I want user can access that module only if he logged in I tried that code: 我希望用户只有logged in我尝试该代码logged in才能访问该模块:

https://magento.stackexchange.com/questions/121221/redirect-to-login-page-if-not-login-magento 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 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 您收到此错误,因为模块xml config中定义了一个依赖项

        <depends>
            <Magento_Customer/>
        </depends>

however Magento_Customer is not the valid core module name in Magento 1, correct one is Mage_Customer. 但是Magento_Customer在Magento 1中不是有效的核心模块名称,正确的名称是Mage_Customer。 So it should look like this: 所以它应该看起来像这样:

        <depends>
            <Mage_Customer/>
        </depends>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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