<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
my apology. It was a copy/paste typo:<br><br>sub authorize {<br> print "TEST1\n";<br> # For debugging purposes only<br># &log_request_attributes;<br><br> # Here's where your authorization code comes<br> # You can call another function from here:<br> &test_call;<br><br> return RLM_MODULE_OK;<br>}<br><br># Function to handle authenticate<br>sub authenticate {<br> print "TEST2\n";<br> # For debugging purposes only<br># &log_request_attributes;<br><br> if ($RAD_REQUEST{'User-Name'} =~ /^baduser/i) {<br> # Reject user and tell him why<br> $RAD_REPLY{'Reply-Message'} = "Denied access by rlm_perl function";<br> return RLM_MODULE_REJECT;<br> } else {<br> # Accept user and set some attribute<br> $RAD_REPLY{'h323-credit-amount'} = "100";<br> return RLM_MODULE_OK;<br> }<br>}<br><br><br><br><br><div>> Date: Fri, 30 Sep 2011 17:36:32 +0200<br>> From: aland@deployingradius.com<br>> To: freeradius-users@lists.freeradius.org<br>> Subject: Re: "authentication" sub in perl<br>> <br>> Alex rsm wrote:<br>> > I am trying to call an external perl function within "authentication" sub"<br>> > <br>> > - functions are uncommented in modules/perl file<br>> > ...<br>> > func_authenticate = authenticate<br>> > func_authorize = authorize<br>> > ...<br>> <br>> The default example works.<br>> <br>> > - subs are modified in /raddb/example.pl<br>> > sub authenticate{<br>> > print "TEST1\n";<br>> > }<br>> > <br>> > sub authenticate {<br>> > print "TEST2\n";<br>> > /usr/local/etc/raddb/test.pl;<br>> > }<br>> > <br>> > When freeradius receives a REQUEST, only "authenticate" sub is called<br>> > and not "authenticate" sub.<br>> <br>> That makes NO sense at all.<br>> <br>> You have TWO "authenticate" subroutines, and you expect that Perl will<br>> magically call the one you want?<br>> <br>> Computers don't work that way.<br>> <br>> > How can I enable "authenticate" to be called when a REQUEST is arrived?<br>> <br>> Ask a question that makes sense.<br>> <br>> Alan DeKok.<br>> -<br>> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html<br></div> </div></body>
</html>