Phil Homewood wrote:
Phil R Lawrence wrote:
By default, a new user is auto-created if an unrecognized email
address is used. How can I disable this? I only want users that I
create to have the right to create Tickets.
Untested: try enabling LookupSenderInExternalDatabase
and SenderMustExistInExternalDatabase in config.pm. The
LookupExternalUserInfo shim in config.pm shouldn’t need
touching. This could perhaps be considered slight abuse
of the ExternalUserInfo stuff.
This certainly blocked the creation of new users… it also disabled
the ability for anyone create tickets via email (because everyone
fails the LookupExternalUserInfo function).
So I guess I want to replace this function with one that authenticates
against the RT database. I had the bright idea that I might use one of
the RT::* modules to do this…
Before I list out my lame first test script (which didn’t work) perhaps
someone already know the best way to do this?
Anyway, here is my attempt, which fails with:
Can’t use string (“RT::User”) as a HASH ref while “strict refs” in use
at /usr/lib/perl5/site_perl/5.8.0/DBIx/SearchBuilder/Record.pm line 890.
use lib “/opt/rt2/lib”;
use lib “/opt/rt2/etc”;
use RT::Interface::CLI qw(CleanEnv LoadConfig DBConnect
#Clean out all the nasties from the environment
#Load etc/config.pm and drop privs
#Connect to the database and get RT::SystemUser
and RT::Nobody loaded
$user = RT::User->Load(“tjs5”);