<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.1">
</HEAD>
<BODY>
Great!<BR>
<BR>
Thank you very much Roy for clarify this for me.<BR>
<BR>
<BR>
On Wed, 2010-02-10 at 10:18 +0000, Raed El-Hames wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Eduardo;

Assuming a user does not belong to a group, there will be 4 entries for 
it in the database:
1- A row in the Users table (name,email address, etc etc)
2- A row in the Groups table eg for a user with Users.id = 101
+-----+----------+-------------------------+----------------+-----------+----------+
| id  | Name     | Description             | Domain         | Type      
| Instance |
+-----+----------+-------------------------+----------------+-----------+----------+
| 102| User 101 | ACL equiv. for user 101 | ACLEquivalence | UserEquiv 
|      101 |
+-----+----------+-------------------------+----------------+-----------+----------+
3- 2 rows in the Principals table
+-----+---------------+----------+----------+
| id  | PrincipalType | ObjectId | Disabled |
+-----+---------------+----------+----------+
| 101 | User          |      101 |        0 |
+-----+---------------+----------+----------+
+-----+---------------+----------+----------+
| id  | PrincipalType | ObjectId | Disabled |
+-----+---------------+----------+----------+
| 102 | Group         |      102 |        0 |
+-----+---------------+----------+----------+

Disabling a user, will set the Disabled field to 1, for both Principals 
rows 101 and 102

Bare in mind tinkering in the database is not recommended , and as far 
as I know, later versions of RT include a Shredder which allow you to 
clean the database.

Hope that helped;

Regards;
Roy





Eduardo Cerqueira wrote:
&gt; I'd like to understand the DB relationship. would we have the ERM or 
&gt; DB schema in some place on twiki? I took a glace there but with no 
&gt; successful.
&gt;
&gt; at this point I want to clean up old users from my DB (I have 265 
&gt; records) in my Users table and I am not sure how can I filter users 
&gt; disabled as into table there is no
&gt; flag field for this, at least I didn't find this.
&gt;
&gt; and I really would love to understand where is going Disabled value, 
&gt; for this case below I copied it from 
&gt; rt3/share/html/Admin/Users/Modify.html so I can't see this field in 
&gt; Users table.
&gt;
&gt; */can my DB schema is no updated?/*
&gt;
&gt;
&gt;     if ( defined $id &amp;&amp; $id eq 'new') {
&gt; ( $val, $msg ) = $UserObj-&gt;Create(
&gt;     Name                  =&gt; $Name,
&gt;     EmailAddress          =&gt; $ARGS{'EmailAddress'},
&gt;     Name                  =&gt; $ARGS{'Name'},
&gt;     Comments              =&gt; $ARGS{'Comments'},
&gt;     Signature             =&gt; $ARGS{'Signature'},
&gt;     EmailAddress          =&gt; $ARGS{'EmailAddress'},
&gt;     FreeformContactInfo   =&gt; $ARGS{'FreeformContactInfo'},
&gt;     Organization          =&gt; $ARGS{'Organization'},
&gt;     RealName              =&gt; $ARGS{'RealName'},
&gt;     NickName              =&gt; $ARGS{'NickName'},
&gt;     Lang                  =&gt; $ARGS{'Lang'},
&gt;     EmailEncoding         =&gt; $ARGS{'EmailEncoding'},
&gt;     WebEncoding           =&gt; $ARGS{'WebEncoding'},
&gt;     ExternalContactInfoId =&gt; $ARGS{'ExternalContactInfoId'},
&gt;     ContactInfoSystem     =&gt; $ARGS{'ContactInfoSystem'},
&gt;     Gecos                 =&gt; $ARGS{'Gecos'},
&gt;     ExternalAuthId        =&gt; $ARGS{'ExternalAuthId'},
&gt;     AuthSystem            =&gt; $ARGS{'AuthSystem'},
&gt;     HomePhone             =&gt; $ARGS{'HomePhone'},
&gt;     WorkPhone             =&gt; $ARGS{'WorkPhone'},
&gt;     MobilePhone           =&gt; $ARGS{'MobilePhone'},
&gt;     PagerPhone            =&gt; $ARGS{'PagerPhone'},
&gt;     Address1              =&gt; $ARGS{'Address1'},
&gt;     Address2              =&gt; $ARGS{'Address2'},
&gt;     City                  =&gt; $ARGS{'City'},
&gt;     State                 =&gt; $ARGS{'State'},
&gt;     Zip                   =&gt; $ARGS{'Zip'},
&gt;     Country               =&gt; $ARGS{'Country'},
&gt;     Privileged           =&gt; $ARGS{'Privileged'},
&gt;     Disabled            =&gt; ($ARGS{'Enabled'} ? 0 : 1)
&gt; );
&gt;
&gt;
&gt; I really appreciate for your help.
&gt;
&gt; Thanks,
&gt; Eduardo 
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>