(RADIATOR) Compiling a perl script

Erik Wirring LE34 Trimble Center Danmark ew at trimblecenter.dk
Mon Jan 10 08:18:15 CST 2005


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.


More information about the radiator mailing list