I wanted to delete an admin user programmatically, I have only FTP access.
3
Although untested it stands to reason that you can use the normal Magento flow like with all models
Mage::getModel('admin/user')->load('user id')->delete();
But again, I didn't test it.
-
I tried the above code, not working, now I am not able to access admin, getting an error. – Nived Oct 2 '13 at 7:32
-
1Please update your answer with the error thrown and also explain how you executed this code. – Sander Mangel♦ Oct 2 '13 at 7:33
-
Confirmed, this method works. My code: $model = Mage::getModel('admin/user'); $user = $model->loadByUsername($username); $user->delete(); – Pronto Aug 25 '14 at 9:09
Mage_Adminhtml_Permissions_UserController::deleteAction()
you will find a code similar to what @SanderMangel posted as an answer. – Marius♦ Oct 2 '13 at 7:09