From: pnixon Date: Mon, 21 Mar 2005 21:50:12 +0000 (+0000) Subject: Fix the calls to da_sql_limit X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=890208199bd96de99b5770e3e57ba60d4ef369c8;p=freeradius-dialup-admin.git Fix the calls to da_sql_limit --- diff --git a/htdocs/accounting.php3 b/htdocs/accounting.php3 index 137d05a..0c6a357 100644 --- a/htdocs/accounting.php3 +++ b/htdocs/accounting.php3 @@ -238,9 +238,9 @@ unset($sql_extra_query); if ($config[sql_accounting_extra_query] != '') $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); $sql_extra_query = da_sql_escape_string($sql_extra_query); -$query="SELECT da_sql_limit($maxresults,0,$config) $query_view FROM $config[sql_accounting_table] - $where $sql_extra_query da_sql_limit($maxresults,1,$config) - ORDER BY $order da_sql_limit($maxresults,2,$config);"; +$query="SELECT " . da_sql_limit($maxresults,0,$config) . " $query_view FROM $config[sql_accounting_table] + $where $sql_extra_query " . da_sql_limit($maxresults,1,$config) . + " ORDER BY $order " . da_sql_limit($maxresults,2,$config) . ";"; echo << diff --git a/htdocs/badusers.php3 b/htdocs/badusers.php3 index 9afe582..26af131 100644 --- a/htdocs/badusers.php3 +++ b/htdocs/badusers.php3 @@ -145,10 +145,10 @@ if ($config[general_restrict_badusers_access] == 'yes'){ $link = @da_sql_pconnect($config); if ($link){ $search = @da_sql_query($link,$config, - "SELECT da_sql_limit($limit,0,$config) * FROM $config[sql_badusers_table] + "SELECT " . da_sql_limit($limit,0,$config) . " * FROM $config[sql_badusers_table] WHERE username $usercheck $extra_query AND incidentdate <= '$now_str' - AND incidentdate >= '$prev_str' da_sql_limit($limit,1,$config) - ORDER BY incidentdate $order da_sql_limit($limit,2,$config);"); + AND incidentdate >= '$prev_str' " . da_sql_limit($limit,1,$config) . + "ORDER BY incidentdate $order " . da_sql_limit($limit,2,$config) . " ;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $num++; diff --git a/htdocs/failed_logins.php3 b/htdocs/failed_logins.php3 index 8214265..6387886 100644 --- a/htdocs/failed_logins.php3 +++ b/htdocs/failed_logins.php3 @@ -115,13 +115,13 @@ if ($config[sql_accounting_extra_query] != ''){ $link = @da_sql_pconnect($config); if ($link){ $search = @da_sql_query($link,$config, - "SELECT da_sql_limit($limit,0,$config) acctstoptime,username,nasipaddress,nasportid,acctterminatecause,callingstationid + "SELECT " . da_sql_limit($limit,0,$config) . " acctstoptime,username,nasipaddress,nasportid,acctterminatecause,callingstationid FROM $config[sql_accounting_table] WHERE acctstoptime <= '$now_str' AND acctstoptime >= '$prev_str' AND (acctterminatecause LIKE 'Login-Incorrect%' OR acctterminatecause LIKE 'Invalid-User%' OR - acctterminatecause LIKE 'Multiple-Logins%') $callerid_str $server_str $sql_extra_query da_sql_limit($limit,1,$config) - ORDER BY acctstoptime $order da_sql_limit($limit,2,$config);"); + acctterminatecause LIKE 'Multiple-Logins%') $callerid_str $server_str $sql_extra_query " . da_sql_limit($limit,1,$config) . + " ORDER BY acctstoptime $order " . da_sql_limit($limit,2,$config) . " ;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $num++; diff --git a/htdocs/user_accounting.php3 b/htdocs/user_accounting.php3 index 3f1c8ce..f362519 100644 --- a/htdocs/user_accounting.php3 +++ b/htdocs/user_accounting.php3 @@ -102,10 +102,10 @@ if ($config[sql_accounting_extra_query] != '') $link = @da_sql_pconnect($config); if ($link){ $search = @da_sql_query($link,$config, - "SELECT da_sql_limit($limit,0,$config) * FROM $config[sql_accounting_table] + "SELECT " . da_sql_limit($limit,0,$config) . " * FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstarttime <= '$now_str' - AND acctstarttime >= '$prev_str' $sql_extra_query da_sql_limit($limit,1,$config) - ORDER BY acctstarttime $order da_sql_limit($limit,2,$config);"); + AND acctstarttime >= '$prev_str' $sql_extra_query " . da_sql_limit($limit,1,$config) . + " ORDER BY acctstarttime $order " . da_sql_limit($limit,2,$config). " ;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $tr_color='white'; diff --git a/htdocs/user_stats.php3 b/htdocs/user_stats.php3 index d277032..556e1fe 100644 --- a/htdocs/user_stats.php3 +++ b/htdocs/user_stats.php3 @@ -110,9 +110,9 @@ EOM; $link = @da_sql_pconnect($config); if ($link){ $search = @da_sql_query($link,$config, - "SELECT da_sql_limit($limit,0,$config) * FROM $config[sql_total_accounting_table] - WHERE acctdate >= '$start' AND acctdate <= '$stop' $server_str $login_str $sql_extra_query da_sql_limit($limit,1,$config) - ORDER BY $order_attr $order da_sql_limit($limit,2,$config);"); + "SELECT " . da_sql_limit($limit,0,$config) . " * FROM $config[sql_total_accounting_table] + WHERE acctdate >= '$start' AND acctdate <= '$stop' $server_str $login_str $sql_extra_query " . da_sql_limit($limit,1,$config) + . " ORDER BY $order_attr $order " . da_sql_limit($limit,2,$config) . " ;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){