I want to get magento admin users and assign them a mobile number, from each particular agent panel, agent can able make a call from that number.

1 Answer 1


To get Users

//By Username get admin User's Details
$username = 'admin';
$user_data = Mage::getModel('admin/user')->getCollection()->addFieldToFilter('username',$username)->getData();

//By Username get admin User's Role Details
$username = 'admin';
$role_data = Mage::getModel('admin/user')->getCollection()->addFieldToFilter('username',$username)->getFirstItem()->getRole()->getData();

//By ID get admin User's Details
$id = 1;
$user_data = Mage::getModel('admin/user')->load($id)->getData();

//By ID get admin User's Role Details
$id = 1;
$role_data = Mage::getModel('admin/user')->load($id)->getRole()->getData();

To change or update user details, you can follow the given code

$user = Mage::getModel('admin/user')->load($userId);

in the above code, you can use your field name which you want to update

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.