[rt-users] How to look for dsabled user in the database

Ruslan U. Zakirov cubic at acronis.ru
Fri Oct 24 12:22:40 EDT 2003


Asif Iqbal wrote:
> On Fri, 24 Oct 2003, Asif Iqbal wrote:
> 
> 
>>On Thu, 23 Oct 2003, Ruslan U. Zakirov wrote:
>>
>>
>>>Asif Iqbal wrote:
>>>
>>>>Hi All
>>>>
>>>>I know how to look for disabed user in the RT gui. But how do I look for the
>>>>same in the rt3 database ? What flag should I look for ?
>>>
>>>select u.Name from Users u, Principals p where u.id = p.id and
>>>p.Disabled = 1 and p.PrincipalType = 'User';
> 
> 
> I noticed if I choose p.Disabled = 0 it actually picks up the users whose
> account has "Let this user be granted rights" unchecked. Is there anyway to
> avoid that ?
> 
> I like to grep only the users whose account in Access control box has both of
> the follwoing options *must* be checked
> 
> "Let this user access RT"
> "Let this user be granted rights"
> 
> Something like this:
> 
> select EmailAddress from Users where "Let this user access RT" = 1 and "Let this
> user be granted rights" = 1
> 
> Would you et al. know what mysql statement(s) would accomplish that ?
> 
> Thanks a lot
> 
> - Asif
> 
Slightly harder:

select distinct u.* from Users u, Principals p, Principals p1, Groups g, 
CachedGroupMembers cm where u.id = p.id and p.Disabled = 0 and 
p.PrincipalType = 'User' and g.Domain = 'SystemInternal' and g.Instance 
= '' and g.Name = '' and g.Type = 'Privileged' and p1.id = g.id and 
cm.MemberId = p.id and p1.id = cm.GroupId;

:)




More information about the rt-users mailing list