×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: bejoy balan
Added: Jul 11, 2016 8:48 AM
Views: 9
  1. $roles = Mage::getModel('admin/roles')->getCollection();
  2. foreach ($roles as $role):
  3.  
  4.     $options .='<optgroup label="' . $role->getRoleName() . '">';
  5.     $roles_users = Mage::getModel('admin/roles')->load($role->getId())->getRoleUsers();
  6.     foreach ($roles_users as $roleuser):
  7.         $user = Mage::getModel('admin/user')->load($roleuser);
  8.         $options .='<option value="' . $user->getFirstname() . ' ' . $user->getLastname() . '">' . $user->getFirstname() . ' ' . $user->getLastname() . '</option>';
  9.  
  10.     endforeach;
  11. endforeach;
  12. ?>