Trying to use thePostAuthHook function ot have Radiator generate some
custom logs to give details of all attempted logins. Current PostAuthHook
shown below;

PostAuthHook sub {      my $filename = "/usr/local/radius/logs/testlog"; \

                        my $time = time; \
                        my $ctime = localtime($time); \
                        my $nas_ip = $_[0]->get_attr('NAS-IP-Address'); \
                        my $phone = $_[0]->get_attr('Called-Station-Id'); \
                        my $user = $_[0]->get_attr('User-Name'); \
                        my $r = "NULL"; \
                        $nas_ip = "POP3 mail" \
                                if $nas_ip eq "196.14.80.129";\
                        $r = "DENY" \
                                if $_[2] == $main::REJECT; \
                        $r = "ACCEPT" \
                                if $_[2] == $main::ACCEPT;\
                        open(LOG, ">>$filename");\
                        print LOG "$ctime: UserName \"$user\": Dialed $phone
- $nas_ip - $r\n";      \
                        close(LOG); }

No compilation errors are reported, however when a request is processed the
log file reports the following error message;

Thu Jun  3 10:30:56 1999: ERR: Error in PostAuthHook(): Can't call method
"get_attr" on unblessed reference at (eval 189) line 1.

Radiator version - 2.13.1
Patched - patches-2.13.1.tar.gz - June 3 1999
Any suggestions on how to overcome this would be greatly appreciated..

Regards

Ian Hughes

+----------------------------------------------------------------------+
  Ian Hughes - Tech Support/System Admin.
  Hunterlink Pty. Ltd. (Australia)
  1st Floor, 805 Hunter Street
  Dangar, NSW, 2309 Australia
  Phone: +61 2 4969 0122  Fax: +61 2 4969 0133
  E-Mail: [EMAIL PROTECTED]
+----------------------------------------------------------------------+
  If things get any worse, I'll have to ask you to stop helping me.
+----------------------------------------------------------------------+



===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to