Conditionally add new unprivileged users

Hello all,

I’m currently learning rt - this thing is amazing and I wish I knew
about it earlier!

I’d like to be able to extend the user creation via email process, but
I’m not sure where to start.

Specifically, when someone emails rt@example.com and they don’t yet
have a user account, I’d like to search through all my groups to see
if their domain name exists in a custom field.

If the group is found, then I’d like them to be added to that group,
and the ticket created.

If no group is found, I’d like rt to send them a message telling them
to contact an admin, and the user account would not be created.

I’m not asking how to code this functionality (I’ll try and figure
that out myself), but I’ve no idea how I can hook into the account
creation process.

If anyone could give any pointers for me to get started that’d be wonderful.

I’m running rt 4.0.4 on Ubuntu 12.04.

Thanks,

Al

Hi,

Sadly there are no scrips for other objects except tickets. What you want
is not hard to do by wrapping Create method in RT::User class. Basicly you
let RT do creation and when it successfuly returns to the caller, you can
do required lookups and put user into a group.On Fri, Jun 21, 2013 at 8:20 AM, Al Twohill moebiusproject@gmail.comwrote:

Hello all,

I’m currently learning rt - this thing is amazing and I wish I knew
about it earlier!

I’d like to be able to extend the user creation via email process, but
I’m not sure where to start.

Specifically, when someone emails rt@example.com and they don’t yet
have a user account, I’d like to search through all my groups to see
if their domain name exists in a custom field.

If the group is found, then I’d like them to be added to that group,
and the ticket created.

If no group is found, I’d like rt to send them a message telling them
to contact an admin, and the user account would not be created.

I’m not asking how to code this functionality (I’ll try and figure
that out myself), but I’ve no idea how I can hook into the account
creation process.

If anyone could give any pointers for me to get started that’d be
wonderful.

I’m running rt 4.0.4 on Ubuntu 12.04.

Thanks,

Al

Best regards, Ruslan.

Thanks Ruslan,On 22 June 2013 00:25, Ruslan Zakirov ruz@bestpractical.com wrote:

snip<
Sadly there are no scrips for other objects except tickets. What you want is
not hard to do by wrapping Create method in RT::User class. Basicly you let
RT do creation and when it successfuly returns to the caller, you can do
required lookups and put user into a group.

Yes, I’d discovered that I couldn’t run scrips on things other than
tickets, so was looking at wrapping or extending a user method.

I’d got as far as learning about overlays, and am thinking I want to
use an overlay to rewrite RT::User::LoadOrCreateByEmail, so that I can
refuse creating a user if they’re not from a valid domain etc.

So I’ve created a User_Overlay.pm, that overrides that method but I
can’t find any documentation on how to get it to be run instead of the
original. I’ve put it in /usr/local/share/request-tracker4/lib/, but
not sure where to go from here.

Thanks, Al

So I’ve created a User_Overlay.pm, that overrides that method but I
can’t find any documentation on how to get it to be run instead of the
original. I’ve put it in /usr/local/share/request-tracker4/lib/, but
not sure where to go from here.

You want to use User_Local.pm, User_Overlay is technically for core,
and put it in the local lib directory, which you can find on your
System Configuration page (you’re running the debian/ubuntu packages,
so I’m not sure where it goes).

You may want to read through:
http://requesttracker.wikia.com/wiki/Customizing

Assuming your file is named correctly and a valid perl package,
nothing other than restarting apache should be required.

-kevin