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?
1 Answer
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;
-
Thanks Piyush. Can you please help me how to get Users details with specific role? Commented Dec 7, 2016 at 10:59
-
-
Dear i want details of users created that have specific role. For example, All user details that have role id = '3' . Commented Dec 7, 2016 at 11:10
-