[rt-devel] RE: comments on my active directory experience
Senoner Samuel
Samuel.Senoner at eurac.edu
Wed Jul 30 03:40:11 EDT 2003
This is a part of my autohandler, I used this to activate do an
Externaluserinfo lookup:
# If RT is configured for external auth, let's get REMOTE_USER
elsif ($RT::WebExternalAuth and length($ENV{'REMOTE_USER'})) {
my $orig_user = $user;
$user = $ENV{'REMOTE_USER'};
$session{'CurrentUser'} = RT::CurrentUser->new();
my $load_method = $RT::WebExternalGecos ? 'LoadByGecos' : 'Load';
if ($^O eq 'MSWin32' and $RT::WebExternalGecos) {
my $NodeName = Win32::NodeName();
$user =~ s/^\Q$NodeName\E\\//i;
}
$session{'CurrentUser'}->$load_method($user);
if ($RT::WebExternalAuto and !$session{'CurrentUser'}->Id() ) {
# Create users on-the-fly with default attributes
my $UserObj = RT::User->new(RT::CurrentUser->new('root'));
#Lines inserted for LDAP User Lookup
my %UserInfo = ();
my $ UserFoundInExternalDatabase;
( $UserFoundInExternalDatabase, %UserInfo) =
RT::EmailParser::LookupExternalUserInfo($user, $user);
my ($val, $msg) = $UserObj->Create(
%{ref($RT::AutoCreate) ? $RT::AutoCreate : {}},
Name => $user,
Gecos => $user,
%UserInfo #added by SeS
);
LookupExternalUserInfo is in EmailParser_Local, but this function is
also in Emailparser, but empty.
So, I think, it whouldn't be bad to insert this code in the
distribution, because I saw that there are many interested in
externallookup?
Jesse?
I also had to add in /usr/share/perl5/HTML/Mason/Request.pm a use
RT::EmailParser, so autohandler is able to call the lookupfunction.
Also the change in the normal user creation whould be interesting, I
already sent it, also as bug, this whould be interesting so anyone who
has an externallookup functions can only insert this function in
EmaiParser_Local and a controlled rest of the system.
Samuel
-----Original Message-----
From: John Jasen [mailto:jjasen at datafoundation.com]
Sent: Monday,28 July,2003 20:15
To: Senoner Samuel
Subject: comments on my active directory experience
Do you have a diff or a text file of what you did to
var/mason_data/obj/standard/autohandler? There's a lot of mungery in the
html archive...
http://lists.fsck.com/pipermail/rt-users/2003-July/015399.html
More information about the Rt-devel
mailing list