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-Name'} . "/" . $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; } }