(RADIATOR) Compiling a perl script
Hugh Irvine
hugh at open.com.au
Mon Jan 10 08:31:24 CST 2005
Hello Erik -
Radiator automatically compiles your hook code at run time - you don't
have to do anything special.
regards
Hugh
On 10 Jan 2005, at 20:18, Erik Wirring LE34 Trimble Center Danmark
wrote:
> Hello
>
> I have no knowlegds of perl, therefor this very basal question:
> How do a compile a perl script??
> I have written this perl scprit, but it seems that I need to have it
> compiled for Radiator to be able to use it as a PostAuthHook function:
>
> # -*- mode: Perl -*-
> # runCafeLogin
> #
> # PostAuthHook to run php script cafelogin.php
> # Cafelogin.php takes two args: username and
> rejectreason/'Access-Accept'
> # basically it creates a new nonsens password, set expiration to 5
> minutes from now and sends the password by SMS to the user.
> # however 3 rejections closes the login account.
> #
> # Author: Erik Wirring (ew at le34.dk)
> # Copyright (C) 2005 Landinspektørfirmaet LE34 A/S
> #
>
> sub
> {
> my $p = ${$_[0]};
> my $rp = ${$_[1]};
> my $handled = $_[2];
> my $reason = $_[3];
>
> my $username = $p->get_attr('User-Name');
> my $code = $p->code;
>
> return unless $code eq 'Access-Request';
>
> my $Pid;
> my $executable = 'C:\\php\\php.exe';
>
> if ($handled == $MAIN::REJECT)
> {
> my $Args = 'cafelogin.php ' . $username . ' ' . $reason;
> }
> else
> {
> my $Args = 'cafelogin.php ' . $username . ' Access-Accept';
> }
>
> Win32::Spawn( $executable, $Args, $Pid );
>
> if ($Pid)
> {
> print "Process started with PID ", $Pid , "\n";
> }
> else
> {
> print "Unable to start process: ", Win32::FormatMessage(
> Win32::GetLastError() ), "\n";
> }
> }
>
> Med venlig hilsen
>
> Erik Wirring
> Udviklingschef
> Landinspektør
>
> Email: EW at LE34.Dk
> Direkte tlf: 77 332 257
> Mobil tlf: 51 314 257
>
> Landinspektørfirmaet LE34
> Energivej 34
> 2750 Ballerup
> Tlf. 77 332 233
> Fax. 77 332 299
> Http://www.LE34.Dk
> Http://GPSnet.dk Danmarks Elektroniske Referencenet
>
> --
> 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:
Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive
(www.open.com.au/archives/radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, 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.
NB:
Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive
(www.open.com.au/archives/radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, 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