checkval and != op

Christian Zoffoli czoffoli at xmerlin.org
Mon Jun 21 23:29:16 CEST 2010


Il 21/06/2010 20:26, Alan DeKok ha scritto:
> Christian Zoffoli wrote:
[many]
>   Have you read the documentation as I suggested?
> 
>   No, not really.  That's why my answers don't help.

probably I don't know many things to find my mistakes


now I've fixed my problem in this way

---
update control {
	Tmp-String-0 = "%{sql: SELECT groupname FROM radusergroup WHERE
username='%{request:User-Name}'}"
}


if ( "%{control:Tmp-String-0}" != "" ) {

	update control {
		Tmp-String-1 = "%{sql: SELECT value FROM radgroupcheck WHERE
groupname='%{control:Tmp-String-0}' AND op='!=' AND
value='%{request:Calling-Station-Id}' }"
	}

	if ( "%{control:Tmp-String-1}" != "" ) {
		if ( "%{request:Calling-Station-Id}" == "%{control:Tmp-String-1}" ) {
			reject
		}
	}

	update control {
		Tmp-String-2 = "%{sql: SELECT value FROM radgroupcheck WHERE
groupname='%{control:Tmp-String-0}' AND op=':=' AND
value='%{request:Calling-Station-Id}' }"
	}

	if ( "%{control:Tmp-String-2}" != "" ) {
		if ( "%{request:Calling-Station-Id}" != "%{control:Tmp-String-2}" ) {
			reject
		}
	}
}
---


surely is not the right way ...but I don't know a better one.

rlm_sql already do the query I use to populate Tmp-String-0 is there a
way to re-use such value ? ...I've not find an answer


Best regards,
Christian



More information about the Freeradius-Users mailing list