Hi Monks,
I have no knowledge of perl, so please forgive...
I've been asked to rebuild a RADIUS server. The guys at FreeRadius.org have really helped me get it up and running. However, my next issue is getting this perl script to run.
Where do I start in tracking down this error:
Can't locate object method "new" via package "LWP::UserAgent" (perhaps you forgot to load "LWP::UserAgent"?) at /etc/raddb/sjpl.pl line 94.
here is the offending code in line 94
my $ua = LWP::UserAgent->new;
here is all the code added to the default Radius script
sub authenticate {
# my $logfile = "/var/log/patron/sign-on.log";
my $logfile = "/dev/null";
my $testfile = "/etc/raddb/test.text";
my $date = `/bin/date`;
chomp $date;
my $url = "https://10.151.4.3:54620/PATRONAPI/" . $RAD_REQUEST{'User-N
+ame'} . "/" . $RAD_REQUEST{'User-Password'} . "/pintest";
my $ua = LWP::UserAgent->new;
my $output1 = $ua->get($url);
my $output = $output1->as_string;
# For debugging purposes only
# &log_request_attributes;
if ($output =~ /RETCOD=0/) {
`echo "$date : SUCCESS via SSL $RAD_REQUEST{'User-Name
+'} - $RAD_REQUEST{'User-Password'}" >> $logfile`;
$RAD_REPLY{'Reply-Message'} = "Success";
return RLM_MODULE_OK;
} else {
`echo "$date : FAIL via SSL $RAD_REQUEST{'User-Name'}
+- $RAD_REQUEST{'User-Password'}" >> $logfile`;
$RAD_REPLY{'Reply-Message'} = "Denied access by RADIUS
+";
return RLM_MODULE_REJECT;
}
}
Thanks for any help.