<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Hey Gene,</DIV>
<DIV> </DIV>
<DIV>I know what you mean and I would never manually change something in the database or in the whole files of the RT installation since I didnt install it but im supposed to configure it via the interface.</DIV>
<DIV> </DIV>
<DIV>What i actually thought that you mean is that there is one database which contains all objects (like queue, user, group, etc) and all preferences of them (user mail address, queue name, etc.). I thought that i then can enter this database and can have a look on all these preferences to (i.e.) find out what your code below actually should do :D... or how I can find out the queues a user is watcher of (regarding to another problem I floated). Because you wrote an example condition for me...after that condition I would have to do the same progress the template from the wiki does (creating a username, creating a password -> both for new users). But i cant access this scrip...so i have no idea how to find out what the code to generate a password and send it via email looks like.</DIV>
<DIV> </DIV>
<DIV>But ok, i will try out something. I hope you understand that its a little bit hard without any perl knowledge and wihtout knowing all the objects and preferences RT uses and I theoretically could access.</DIV>
<DIV> </DIV>
<DIV>I let you know, if i have a specific problem with my codes.</DIV>
<DIV> </DIV>
<DIV>Thanks for your efforts.</DIV>
<DIV> </DIV>
<DIV>best regards,</DIV>
<DIV>Tommy!<BR><BR>>>> Gene  LeDuc <gleduc@mail.sdsu.edu> 2009-05-20 20:35:43 >>><BR></DIV>
<DIV style="COLOR: #000000">Hi Tommy,<BR><BR>The database is whatever database that was decided on when RT was <BR>installed; it has nothing to do with perl.  We use MySQL for our database <BR>and I use Toad to do my snooping.  I really can't tell you anything about <BR>your installation's database or how to access it.<BR><BR>Here there be dragons, lad...  Pretty much everyone agrees that accessing <BR>the database directly, instead of letting RT do the grunt work, is not <BR>generally a great idea.  I did it because I wanted to understand what is <BR>going on behind the scenes with RT.  These observations have often been <BR>helpful, but at other times have led me down the wrong path.  You should <BR>never modify the database directly.<BR><BR>Gene<BR><BR>At 11:09 AM 5/20/2009, Thomas Fluch wrote:<BR>>thank you for your example code!<BR>><BR>>You said, that you poked aroung in the database. I guess, that this <BR>>database would help me a lot finding objects and their preferences I can <BR>>use in a custom condition or custom action. Would you tell where i can <BR>>find this database exactly so that i can try to understand perl a little?<BR>><BR>>Thank you!<BR>>Best regards, Tommy!<BR>><BR>> >>> Gene  LeDuc <gleduc@mail.sdsu.edu> 2009-05-18 18:39 >>><BR>>Ah, didn't realize you meant creating a user via the web.  Poking around in<BR>>the database, I'd guess that something like the following might work as<BR>>your custom condition:<BR>><BR>>{ ### True when new user created via web<BR>>    my $TA = $self->TransactionObj;<BR>>    my $val = $TA->ObjectType eq 'RT::User'<BR>>           && $TA->Type eq 'Create'<BR>>           && $TA->CreatorObj->Id > != 1;<BR>>    return $val;<BR>>}<BR>><BR>>I haven't tried the above (or used ObjectType), but I think it's at least a<BR>>good place to start.  The following observations are for v3.6.3.  When a<BR>>user is created via an e-mail ticket, the Creator is the System user, and<BR>>the System user is #1.  When a user is created via a web session, the<BR>>Creator is the logged in user, which is always > #12.  Set this up in a<BR>>global scrip and use a variant of the auto-password template you're already<BR>>using for tickets.  If it doesn't work, throw some debug logging stuff in<BR>>and see what you get.  Once you get it working, this would be a good wiki<BR>>addition!<BR><BR><BR>-- <BR>Gene LeDuc, GSEC<BR>Security Analyst<BR>San Diego State University <BR><BR></DIV></BODY></HTML>