Forums | Mahara Community
Support
/
Delete users on database level
21 March 2012, 15:24
Hello, i have run into technical problems during a CSV install of several users.
In order to cure the problem, these users need to be removed from the database.
Is there any documentation or even script available which will accomplish this?
Moreover i would like to be able to edit (correct) the user names after installation. Is there any other way except of doing the edits in a database backup file and subsequently restoring that file?
Thanks
Beate
21 March 2012, 18:04
Hi Beate,
Soon you'll be able to delete users in bulk, but in 1.4 you're stuck with deleting them one by one. I don't have a script handy, but it's easy enough to create a little script on a dummy page to do it, you just need to get a list of the user ids, and call the delete_user function on each one. Something like this:
define('INTERNAL', 1);
require('init.php');
delete_user(1234);
delete_user(1235);
....
in a php file in your code directory should do it.
Changing usernames is also possible in the account settings page, but not in bulk without writing a script either.