Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Access Issue for Created Users
 
iPhony
Member
 
Avatar
Total Posts:  37
Joined:  2007-09-01
 

I created another role called store assistant to which I assigned only the catalog permission.
Then I created a new user and assigned the user to this role.

When the new user logs in to the admin page, he get a bunch of errors on the screen as follows:

NoticeUndefined variablelast in /home/storemos/public_html/estore/app/code/core/Mage/Adminhtml/Block/Page/Menu.php on line 121
[0] in Mage_Adminhtml_Block_Page_Menu
->_buildMenuArray() in /home/storemos/public_html/estore/app/code/core/Mage/Adminhtml/Block/Page/Menu.php on line 51
[1] in Mage_Adminhtml_Block_Page_Menu
->getMenuArray() in /home/storemos/public_html/estore/app/design/adminhtml/default/default/template/page/menu.phtml on line 23
[2] in 
include("/home/storemos/public_html/estore/app/design/adminhtml/default/default/template/page/menu.phtml"in /home/storemos/public_html/estore/app/code/core/Mage/Core/Block/Template.php on line 118
[3] in Mage_Core_Block_Template
->fetchView("adminhtml/default/default/template/page/menu.phtml"in /home/storemos/public_html/estore/app/code/core/Mage/Core/Block/Template.php on line 144
[4] in Mage_Core_Block_Template
->renderView() in /home/storemos/public_html/estore/app/code/core/Mage/Core/Block/Template.php on line 189
[5] in Mage_Core_Block_Template
->toHtml() in /home/storemos/public_html/estore/app/code/core/Mage/Core/Block/Abstract.php on line 437
[6] in Mage_Core_Block_Abstract
->_getChildHtml("menu"1in /home/storemos/public_html/estore/app/code/core/Mage/Core/Block/Abstract.php on line 415
[7] in Mage_Core_Block_Abstract
->getChildHtml("menu"in /home/storemos/public_html/estore/app/design/adminhtml/default/default/template/page.phtml on line 107
[8] in 
include("/home/storemos/public_html/estore/app/design/adminhtml/default/default/template/page.phtml"in /home/storemos/public_html/estore/app/code/core/Mage/Core/Block/Template.php on line 118
[9] in Mage_Core_Block_Template
->fetchView("adminhtml/default/default/template/page.phtml"in /home/storemos/public_html/estore/app/code/core/Mage/Core/Block/Template.php on line 144
[10] in Mage_Core_Block_Template
->renderView() in /home/storemos/public_html/estore/app/code/core/Mage/Core/Block/Template.php on line 189
[11] in Mage_Core_Block_Template
->toHtml() in /home/storemos/public_html/estore/app/code/core/Mage/Core/Model/Layout.php on line 417
[12] in Mage_Core_Model_Layout
->getOutput() in /home/storemos/public_html/estore/app/code/core/Mage/Core/Controller/Varien/Action.php on line 309
[13] in Mage_Core_Controller_Varien_Action
->renderLayout() in /home/storemos/public_html/estore/app/code/core/Mage/Adminhtml/controllers/DashboardController.php on line 36
[14] in Mage_Adminhtml_DashboardController
->indexAction() in /home/storemos/public_html/estore/app/code/core/Mage/Core/Controller/Varien/Action.php on line 332
[15] in Mage_Core_Controller_Varien_Action
->dispatch("index"in /home/storemos/public_html/estore/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php on line 136
[16] in Mage_Core_Controller_Varien_Router_Admin
->match(Mage_Core_Controller_Request_Httpin /home/storemos/public_html/estore/app/code/core/Mage/Core/Controller/Varien/Front.php on line 166
[17] in Mage_Core_Controller_Varien_Front
->dispatch() in /home/storemos/public_html/estore/app/Mage.php on line 411
[18] in Mage
::run("base"in /home/storemos/public_html/estore/index.php on line 29

Has anyone had the same issue? If so what would be a fix? Is this bug?

 
Magento Community Magento Community
Magento Community
Magento Community
 
bopfer
Jr. Member
 
Total Posts:  14
Joined:  2007-10-25
 

I have the same issue since switching to 0.7.14800.  Worked fine in 0.6.13700

Also, the resources for my roles are not being saved.  It seems that I set them up, then try to access the system as a user in the role.  At that point I get the “Undefined variable: last” error.  Then if I go back to the Role Resources as ‘admin’, they are all unchecked.

-Bryan

 
Magento Community Magento Community
Magento Community
Magento Community
 
iPhony
Member
 
Avatar
Total Posts:  37
Joined:  2007-09-01
 

I confirm what you said.
Any magneto guy can enlighten us in this please?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Try this: edit app/code/core/Mage/Adminhtml/Block/Page/Menu.php, end of function _buildMenuArray:

// replace
        $parentArr[$last]['last'true;

// with
        
if (isset($last)) {
            $parentArr[$last][
'last'true;
        
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
bopfer
Jr. Member
 
Total Posts:  14
Joined:  2007-10-25
 

Well, it got rid of the “last” error, but all the role resources still get wiped out.  I made the code change, cleared the cache, set the role resources, then loaded the administration dashboard as the user in the role.  The admin menu didn’t show up at all.  Then I went back to the role resources as the ‘admin’ user and they were all unchecked.

Edit:
To the Magento devs: I have it setup on a publicly accessible server.  So, if you want to get in and see this in action, PM me for the login details.

 
Magento Community Magento Community
Magento Community
Magento Community
 
iPhony
Member
 
Avatar
Total Posts:  37
Joined:  2007-09-01
 

I tried your suggestion and it fixed the error code but it did not fix the permission. Additionally the admin menu does not display. The user enters on the dashboard page without any menu. I assume that it could be because the Roles Resources do not remain saved?!

Any further clue?
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top