How to delete user or users in xnat

113 views
Skip to first unread message

Akshaykumar Kamble

unread,
May 25, 2023, 4:33:18 AM5/25/23
to xnat_discussion
Greetings
How to delete user or users from XNAT?
Is it possible to disable registration? So than only admin can manually add users?

Is it possible to only enable user's login for certain amount of time? say for few months etc.

Regards

Rick Herrick

unread,
May 25, 2023, 10:41:59 AM5/25/23
to xnat_di...@googlegroups.com
You can’t delete users from XNAT but you can de-activate users so they can’t log in (actually deleting user records is a nightmare for audibility).

You can disable open user registration: go to Administer -> Site Administration -> Site Settings -> Security, then look for the User Authentication Settings panel:


There’s no way to enable specific logins for a set period of time, but that's an interesting idea. The closest thing in XNAT at the moment is the User Inactivity Lockout setting (same page as 👆🏼just a bit farther down), but that only applies when a user doesn’t log into the system for that period of time, not just a specific deadline.

Rick Herrick
Senior Software Developer


------ Original Message ------
From "Akshaykumar Kamble" <drakshayk...@gmail.com>
To "xnat_discussion" <xnat_di...@googlegroups.com>
Date 5/25/23, 3:33:18 AM
Subject [XNAT Discussion] How to delete user or users in xnat

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/0518b425-b283-48de-a863-49abe6265fa8n%40googlegroups.com.

Akshaykumar Kamble

unread,
May 25, 2023, 2:15:11 PM5/25/23
to xnat_discussion
Thank you.
This helps.
The instance limit at point change, and password rest intervals does it apply to admin as well?
I think password reset interval can be good work around for the time limit for users.
Regards

Rick Herrick

unread,
May 25, 2023, 4:07:47 PM5/25/23
to xnat_di...@googlegroups.com
The user inactivity setting applies to all users, including administrators, with the exception of users that are explicitly set to have non-expiring passwords. The non-expiring password configuration is on the user admin page.

Rick Herrick
Senior Software Developer


------ Original Message ------
From "Akshaykumar Kamble" <drakshayk...@gmail.com>
To "xnat_discussion" <xnat_di...@googlegroups.com>
Date 5/25/23, 1:15:11 PM
Subject Re: [XNAT Discussion] How to delete user or users in xnat

Tashrif

unread,
Jan 15, 2024, 6:20:18 PMJan 15
to xnat_discussion
This issue bothered me for a long time. I finally ran the extra mile and figured this out:

# Enter your Postgres database
$ psql -h pgsql2.host.org -U your_xnat
(Your password may be in /opt/hcpep-xnat/XNAT_HOME/config/xnat-conf.properties. My previous admin put it there long ago.)

# I found the table names using:
your_xnat=> \dt

# Then I examined the columns of xdat_user:
your_xnat=> \dt

# Then I printed a few rows of xdat_user to confirm it is the table I am looking for:
your_xnat=> SELECT * FROM xdat_user limit 5;

# Finally I deleted long inactive users as:
your_xnat=> DELETE FROM xdat_user WHERE login = 'user_name'

Single quote around user_name is important! I also found out that my Postgres did not accept lowercase select, from, where, etc. that I smoothly use in mysql.

Cheers,
Tashrif

Tashrif

unread,
Jan 17, 2024, 10:48:15 PMJan 17
to xnat_discussion
Dear community, although I posted about how to delete users, our application broke because of deletion of guest user. Rick Herrick sternly recommended against any user deletion. In any case, if you ever delete your guest user, here is how you can restore it:

Best,
Tashrif
Reply all
Reply to author
Forward
0 new messages