Question

I have created users from backend admin i.e. System->Permissions->Users . Now I want to obtain details of every users that are created. Can anyone please answer me how to obtain created user details?

Was it helpful?

Solution

Try this- To get all user

$adminUserModel = Mage::getModel('admin/user');
$userCollection = $adminUserModel->getCollection()->load(); 
print_r($userCollection->getData());

To get all the Roles

   $roles = Mage::getModel('admin/roles')->getCollection();
   foreach($roles as $role):
      echo '<br/>Role : '.$role->getId()." | ".$role->getRoleName();
   endforeach;

To get the Role users

  $roles_users = Mage::getResourceModel('admin/roles_user_collection');
  foreach($roles_users as $roleuser):
   $user = Mage::getModel('admin/user')->load($roleuser->getUserId());
   echo '<br/>User : '.$user->getUsername()." | ".$user->getFirstname();
  endforeach;
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top