help need with mysql statement in freeradius

Ivan Kalik tnt at kalik.net
Sat May 17 19:56:38 CEST 2008


Put the log line before return.

Ivan Kalik
Kalik Informatika ISP


Dana 17/5/2008, "Bishal" <bishal at baayu.com.np> piše:

>
>Hi all,
>
>     After many trial and errors my perl modules is working great. Thanks
>IVan, Alan and all of who helped me a lot. Well I am not programmer but
>search in google and you guys helped me a lot.
> One thing is I am not able to log my custom message of perl modules in
>radius.log. Is it possible to show the custom log message in radius.log
>
>sub authorize{
>  if ( $mac == 1 && $RAD_CHECK{'Calling-Station-Id'} eq ""){
>                my $sql2 = $dbh->prepare("INSERT INTO radcheck
>(id,username,attribute,op,value)
>VALUES('','$RAD_REQUEST{'User-Name'}','Calling
>-Station-Id','+=','$RAD_REQUEST{'Calling-Station-Id'}')");
>                $rowcount = $sql2->execute();
>                #or die "Cannot execute SQL Statement: $DBI::errstr\n";
>               $RAD_REPLY{'Reply-Message'} = "Mac Address Successfully
>updated in database $RAD_REQUEST{'Calling-Station-Id'}";
>               return RLM_MODULE_OK;
>
>               # Do some logging.
>       &radiusd::radlog(1,"rlm_perl:: NEW MAC updated in database.");
>}
>
>
>
>
>>request (ie. mobile). Same applies to $sql3. Also I would use == instead
>>of += as the operator there.
>
>I am using += operator because it helps me to store multiple CID in
>database and also after using this operator it logs the correct
>information in radius.log like why user are being reject. Before I was
>using == but it only gives Login incorrect.
>
>
>>
>>-
>>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>>
>>
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>




More information about the Freeradius-Users mailing list