Tested the code but provide the following: [Wed Jun 11 11:30:24 2014] [notice] child pid 32468 exit signal Segmentation fault (11)
On Wed, Jun 11, 2014 at 11:26 AM, Darly Senecal Baptiste < dsenec...@gmail.com> wrote: > Hi Community, > > I am looking to implement a perl script that gathers the login information > (specifically, the username) before that information logs into the system. > My current setting is the following > > PerlRequire /etc/httpd/conf/perl/startup.pl >> PerlModule MyApache2::Authm >> <Location "/git"> >> AuthType Basic >> SetHandler perl-script >> PerlAuthenHandler MyApache2::Authm::authn_handler >> AuthName "My Git Repository" >> AuthBasicProvider ldap-ny ldap-mia >> AuthzLDAPAuthoritative off >> AuthGroupFile /git/htgroups >> Require valid-user >> </Location> > > > Sometimes, some users login as darly.senecal but others loging as > DOMAIN\darly.senecal. > > I'm writing a perl module in which if the user logs in as DOMAIN\username, > then the script has to strip the DOMAIN\ and makes the username as login. > Otherwise, the script the skips the changes and logs in normally > > This is my script (At this time) > > package MyApache2::Authm; >> use warnings; >> use Apache2::Access (); >> use Apache2::RequestRec (); >> use Apache2::Const -compile => qw(OK DECLINED HTTP_UNAUTHORIZED); >> sub authn_handler >> { >> my $r = shift; >> #Get Authentication Credentials >> my ($res, $sent_pw) = $r->get_basic_auth_pw; >> if ($r->user =~ m/^(\QDOMAIN\\\E)/) >> { >> my @user = split(/\\/,$r->user); >> $r->user($user[1]); >> print "User: ", $r->user; >> return Apache2::OK; >> } >> } >> 1; > > > If you have any idea, please let me know > > Regards > > >