Magento News

 

Programmatically disabling Admin users

by farhan.munir (Posted Tue, 03 Jan 2012 11:19:28 GMT)
Hi Guys,

Due to customer requirements – i need to create a separate view/page where all user accounts will be listed and can be enabled/disabled

I have actually created such a functionality using following code:

Code:
$user = Mage::getModel('admin/user')->loadByUsername($ecadmin);
$user->setData('is_active',$newvalue);
$user->save();

Where $new value can be 0/1 indicating the new status of account to be.

Account can be disabled successfully.

However I am having issues with enabling it – is_active is set correctly to 1 upon enable – however I couldn’t login to magento

Any ideas what I might be missing

Thanks in advance



http://magento-forum.co.uk/viewtopic.php?f=5&t=968#p3158

Magento Forum

Possibly Related Posts:


 

Leave a Reply