Deleting bogus user accounts

4 views
Skip to first unread message

Paul Hoffman

unread,
Jul 11, 2013, 3:49:35 AM7/11/13
to irp...@googlegroups.com
I am looking for an automated way to delete the new, bogus, totally
unused (and unusable) user accounts created by user registration bots
that have been plaguing two of our repositories. Doing it manually in
the admin interface is just too tedious when there are several new ones
every day.

If you wanted to write a tool to do this, how would you go about it?

I want to be able to delete the user with username "foo" simply, like
this for example:

$ java -jar rmuser.jar org.flo.rmuser foo

Or I would be happy (happier!!) to do it all in SQL, if that's not
playing with fire. I just did this in our "sandbox" repository and it
seemed to do the trick:

DELETE FROM ir_user.user_department WHERE user_id = xxx;
DELETE FROM ir_user.user_role WHERE user_id = xxx;
UPDATE ir_user.ir_user SET default_email_id = NULL
WHERE user_id = xxx;
DELETE FROM ir_user.user_email WHERE user_id = xxx;
DELETE FROM ir_user.ir_user WHERE user_id = xxx;

(The UPDATE appears to be needed due to a cycle in the foreign key
constraints, though I'm not SQL-savvy enough to be sure of this.)

I'm a Unix/Linux snob who doesn't want to have to write a Java program
to do this but I will bite the bullet and write one if necessary and if
it's not too complicated. In other words, if it requires an IDE and a
dozen files (Java, XML, etc.) then I won't do it; but if I can use javac
and one file of Java code, then I'm game.

I'm guessing that I would import edu.ur.ir.user.UserService and call its
deleteUser method, but I don't know The Java Way well enough to know
what all else I would have to do.

Am I crazy? Am I dreaming?

Thanks in advance,

Paul.

--
Paul Hoffman <pa...@flo.org>
Systems Librarian
Fenway Libraries Online
c/o Wentworth Institute of Technology
550 Huntington Ave.
Boston, MA 02115
(617) 442-2384 (FLO main number)

Nate Sarr

unread,
Jul 11, 2013, 10:16:47 AM7/11/13
to irp...@googlegroups.com
Hi Paul,

    Unfortunately there is no easy way to do this.  Using the services is the best way as it cleans up the user index as well as deleting the account.  Writing a command line interface to do this would take a lot of work.  

-Nate 


--
You received this message because you are subscribed to the Google Groups "irplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irplus+un...@googlegroups.com.
To post to this group, send email to irp...@googlegroups.com.
Visit this group at http://groups.google.com/group/irplus.
For more options, visit https://groups.google.com/groups/opt_out.



Paul Hoffman

unread,
Jul 12, 2013, 5:22:10 AM7/12/13
to irp...@googlegroups.com
On Thu, Jul 11, 2013 at 10:16:47AM -0400, Nate Sarr wrote:
> Unfortunately there is no easy way to do this. Using the services is
> the best way as it cleans up the user index as well as deleting the
> account. Writing a command line interface to do this would take a lot of
> work.

Thanks, I forgot there's a user index outside of the database. Solr,
right? So I should be able to delete from it using HTTP?

Don't you also get a lot of bogus user registrations at Rochester? If
so, how do you deal with them?

I really *am* determined to do this, I just want to find the least
painful means. :-)

Paul.

Nate Sarr

unread,
Jul 12, 2013, 8:32:55 AM7/12/13
to irp...@googlegroups.com
Hi Paul,

   It's a lucene index so you can't access it through HTTP and will have to use the methods in IR+ .  We haven't seen much of an issue with bad accounts in our system as far as I know.

-Nate
Reply all
Reply to author
Forward
0 new messages