From: pnixon Date: Thu, 24 Mar 2005 11:09:13 +0000 (+0000) Subject: Insert a uniqueid into AcctSessionId field also, as both Postgresql and Oracle have... X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=198a065eff850a30db326962ad1d1ce3491def9e;p=freeradius-dialup-admin.git Insert a uniqueid into AcctSessionId field also, as both Postgresql and Oracle have this field set to NUT NULL. (How did this code ever work with PG??) --- diff --git a/bin/log_badlogins b/bin/log_badlogins index 960a08e..80bb090 100755 --- a/bin/log_badlogins +++ b/bin/log_badlogins @@ -195,7 +195,7 @@ for(;;){ $uniqueid = $ctx->hexdigest; print TMP "ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';\n" if ($sql_type eq 'oracle'); #DEBUG# print "INSERT INTO $sql_accounting_table (UserName,AcctUniqueId,NASIPAddress,NASPortId,AcctStartTime,AcctStopTime,AcctSessionTime,AcctInputOctets,AcctOutputOctets,CallingStationId,AcctTerminateCause) VALUES ('$user','$uniqueid','$addr','$port','$time','$time','0','0','0','$caller','$cause');\n"; - print TMP "INSERT INTO $sql_accounting_table (UserName,AcctUniqueId,NASIPAddress,NASPortId,AcctStartTime,AcctStopTime,AcctSessionTime,AcctInputOctets,AcctOutputOctets,CallingStationId,AcctTerminateCause) VALUES ('$user','$uniqueid','$addr','$port','$time','$time','0','0','0','$caller','$cause');\n"; + print TMP "INSERT INTO $sql_accounting_table (UserName,AcctSessionId,AcctUniqueId,NASIPAddress,NASPortId,AcctStartTime,AcctStopTime,AcctSessionTime,AcctInputOctets,AcctOutputOctets,CallingStationId,AcctTerminateCause) VALUES ('$user','$uniqueid','$uniqueid','$addr','$port','$time','$time','0','0','0','$caller','$cause');\n"; close TMP; $command = "$sqlcmd -h$server $opt -u$sql_username $pass $sql_database <$tmpfile.$server" if ($sql_type eq 'mysql'); $command = "$sqlcmd -U $sql_username -f $tmpfile.$server $sql_database" if ($sql_type eq 'pg');