[rt-users] WebExternalAuth vs mod_ntlm_winbind vs SelfService vs rt-mailgate vs my tattered sanity

Jesse Vincent jesse at bestpractical.com
Wed Mar 23 21:48:49 EST 2005




> ...we've been running without WebExternalAuth for the better part of a
> year now, so most users already have an "account" created by
> rt-mailgate where the account username is "user at company.com", and if
> they log into the SelfService interface via WebExternalAuth, a _new_
> user gets created for them that can't see the "other" user's tickets.
> 
>Is there a simple way to make rt-mailgate create new users with only a
> short username?  (Obviously this would have to be smart enough to fall
> back to user at domain if there's an existing user with the same short
> username but a different address.)
> 

You want to create RT/User_Local.pm and override CanonicalizeUserInfo


=item CanonicalizeUserInfo HASH of ARGS

# CanonicalizeUserInfo can convert all User->Create options.
# it takes a hashref of all the params sent to User->Create and
# returns that same hash, by default nothing is done.

# This function is intended to allow users to have their info looked up via
# an outside source and modified upon creation.

=cut


> And, if anyone's ever dealt with this problem before, I'd love to be
> able to pick your brains about the merge issues.

Sounds like a job for a small perl script. Something along these lines...
(I was going to warn you that it was untested, but it does work here ;)


#!/usr/bin/perl
use lib qw(/opt/rt3/lib/);
use RT;
RT::LoadConfig(); 
RT::Init();
use RT::Users;
my $users = RT::Users->new($RT::SystemUser);
$users->UnLimit();
while (my $user = $users->Next) {
  	next unless ($user->Name =~ /^(.*?)\@example.com$/);
	my ($ret,$msg) = $user->SetName($1);	
	print "$msg\n";
}




More information about the rt-users mailing list