(RADIATOR) writing my postauthhook
Hugh Irvine
hugh at open.com.au
Mon Jun 27 08:09:40 CDT 2005
Hello Rosario -
You should probably declare the variable as you have for your other
variables.
regards
Hugh
On 25 Jun 2005, at 10:06, Rosario Pingaro wrote:
> Yes, I fixed the problem and now I'm going on to continue my
> homework.........
>
> I got another problem: I have a sub in my postauthhook file that is
> working fine from command line but when i start radiusd (3.13) I
> got the follwing error:
>
> Sat Jun 25 15:57:22 2005: ERR: Compilation error in PostAuthHook:
> Bareword "aPrefissi" not allowed while "strict subs" in use at
> (eval 33) line 123.
>
> This is the sub:
> sub CercaPrefisso {
> my $lunghezza;
> my $parpref;
> my $MySQLTabPrefissi;
> my @MySQLRigaPrefissi;
> my $nPrefissi;
>
>
> $lunghezza = 3;
> do {
> $parpref = substr(@_[0],0,$lunghezza);
> $MySQLTabPrefissi = $dbh1-> prepare( qq{
> SELECT count(*) AS aPrefissi , max(Prefisso) AS
> MaxPrefisso FROM Prefissi
> WHERE left(Prefisso,'$lunghezza') = '$parpref';
> });
> $MySQLTabPrefissi -> execute()or die "Failed to connect
> $DBI::errstr\n";
> @MySQLRigaPrefissi = $MySQLTabPrefissi -> fetchrow_array();
> $nPrefissi = @MySQLRigaPrefissi[aPrefissi];
> $lunghezza++;
> } while($nPrefissi>1);
> if ($nPrefissi=1) {
> return(@MySQLRigaPrefissi[1]);
> } else {
> return("");
> }
> }
>
> How to avoid this?
>
> Thanks
> Rosario
>
>
> ----- Original Message ----- From: "Frank Danielson"
> <fdanielson at csky.com>
> To: "Rosario Pingaro" <rpingar at nesec.it>; <radiator at open.com.au>
> Sent: Friday, June 24, 2005 9:51 AM
> Subject: RE: (RADIATOR) writing my postauthhook
>
>
>
>> I believe that SessionTimeout should be an integer value. 4502.5
>> will need
>> to be rounded off to an integer like 4503 or 4502.
>>
>> Frank Danielson
>> Infrastructure Architect
>>
>> ClearSky Mobile Media
>> 56 E. Pine St.
>> Orlando, FL 32801
>> USA
>>
>> fdanielson at csky.com
>>
>> -----Original Message-----
>> From: Rosario Pingaro [mailto:rpingar at nesec.it]
>> Sent: Friday, June 24, 2005 9:21 AM
>> To: radiator at open.com.au
>> Subject: (RADIATOR) writing my postauthhook
>>
>>
>> I am writing my postauthhook to handle a prepaid service.
>>
>> But I get an error when try to set the Session-Timeout value.
>> This is the error:
>> Fri Jun 24 15:06:08 2005: ERR: There is no value named 4502.5 for
>> attribute
>> Session-Timeout. Using 0.
>>
>>
>> This is my pl file:
>> sub
>> {
>> my $p = ${$_[0]};
>> my $rp = ${$_[1]};
>> my $result = ${$_[2]};
>>
>> my $credit;
>> my $sessiont;
>> my $user;
>> my $route;
>>
>>
>> $credit = $rp -> get_attr('cisco-h323-credit-amount');
>> $user = $p-> get_attr('Calling-Station-Id');
>> $route= $p-> get_attr('Called-Station-Id');
>>
>> if ($p->code eq 'Access-Request') {
>> &main::log($main::LOG_DEBUG, "CREDITO = $credit");
>> &main::log($main::LOG_DEBUG, "UTENTE = $user");
>> &main::log($main::LOG_DEBUG, "CHIAMATO = $route");
>> $rp -> delete_attr('cisco-h323-credit-amount');
>>
>>
>> #trasformazione di prova
>> $sessiont=$credit*5;
>>
>> $rp-> change_attr('Session-Timeout', $sessiont);
>>
>> }
>> return;
>> }
>>
>>
>> what is the problem?
>>
>> thanks
>> Rosario
>>
>> --
>> Archive at http://www.open.com.au/archives/radiator/
>> Announcements on radiator-announce at open.com.au
>> To unsubscribe, email 'majordomo at open.com.au' with
>> 'unsubscribe radiator' in the body of the message.
>>
>>
>
>
> --
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
NB: I am travelling this week, so there may be delays in our
correspondence.
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.
--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list