R: rlm_sql

Carlo Prestopino c.prestopino at waitalia.com
Fri Feb 3 13:56:38 CET 2006


Yes, it's ok.

I've simply made a mistake in cut/paste operations.

The corret one is as follows

 

CREATE FUNCTION `mac_check`(utente VARCHAR(20),mac VARCHAR(30)) RETURNS
varchar(50)

    DETERMINISTIC

BEGIN

IF (SELECT (SELECT MAX((Attribute='Calling-Station-Id')) from radcheck WHERE
UserName=user))

THEN

            #INSERT into radpostauth (id, user, pass, reply, date) values
('', utente, passwd,reply_packet, NOW());

            RETURN 'record already present';

END IF;

            INSERT INTO radcheck (UserName,Attribute,op,Value) VALUES
(utente,'Calling-Station-Id',':=', mac);

            RETURN 'record inserted';

END

 

The five arguments one is because I tried to change the content of
postauth_query with a function that have to perform two actions:

-          INSERT into radcheck (needed to perform MAC control)

-          INSERT into radpostauth (original behaviour of postauth_query)

 

Regards,

Carlo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20060203/db9203af/attachment.html>


More information about the Freeradius-Devel mailing list