I wanted to delete an admin user programmatically, I have only FTP access.
1 Answer
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.– NivedOct 2, 2013 at 7:32
-
1Please update your answer with the error thrown and also explain how you executed this code. Oct 2, 2013 at 7:33
-
Confirmed, this method works. My code: $model = Mage::getModel('admin/user'); $user = $model->loadByUsername($username); $user->delete();– ProntoAug 25, 2014 at 9:09
Mage_Adminhtml_Permissions_UserController::deleteAction()
you will find a code similar to what @SanderMangel posted as an answer.