From: kkalev Date: Thu, 8 Jul 2004 11:48:18 +0000 (+0000) Subject: * Use require_once instead of require when including xlat.php3 X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=631754d1c364416c7288e81b0c2560574114dc0b;p=freeradius-dialup-admin.git * Use require_once instead of require when including xlat.php3 * Add debug statements in sql connect functions --- diff --git a/Changelog b/Changelog index 5fb5d4a..e6880e4 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,8 @@ Ver 1.72: * Escape special characters in the sql password. This closes bug #96 * Do an xlat for general_accounting_attrs_file and general_user_edit_attrs_file. That way we can have different mappings for each administrator. +* Use require_once instead of require when including xlat.php3 +* Add debug statements in sql connect functions Ver 1.70: * Add the /bin postgresql compatibility patch from Guy Fraser * Add ldap_userdn as a configuration directive. If set we use that for diff --git a/htdocs/clear_opensessions.php3 b/htdocs/clear_opensessions.php3 index 30254ff..21b5d14 100644 --- a/htdocs/clear_opensessions.php3 +++ b/htdocs/clear_opensessions.php3 @@ -1,6 +1,6 @@ diff --git a/htdocs/user_finger.php3 b/htdocs/user_finger.php3 index 2439111..f9da841 100644 --- a/htdocs/user_finger.php3 +++ b/htdocs/user_finger.php3 @@ -86,7 +86,8 @@ if ($link){ "SELECT DISTINCT username,acctstarttime,framedipaddress,callingstationid FROM $config[sql_accounting_table] WHERE acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query - GROUP BY username ORDER BY acctstarttime;"); + GROUP BY username,acctstarttime,framedipaddress,callingstationid + ORDER BY acctstarttime;"); if ($search){ $now = time(); while($row = @da_sql_fetch_array($search,$config)){ diff --git a/htdocs/user_stats.php3 b/htdocs/user_stats.php3 index dfbb2bb..041cf51 100644 --- a/htdocs/user_stats.php3 +++ b/htdocs/user_stats.php3 @@ -2,7 +2,7 @@ require('../conf/config.php3'); require('../lib/functions.php3'); require('../lib/sql/nas_list.php3'); -require('../lib/xlat.php3'); +require_once('../lib/xlat.php3'); ?> DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @mysql_connect("$server:$config[sql_port]",$SQL_user,$SQL_passwd); } @@ -28,6 +32,8 @@ function da_sql_connect($config) if ($config[sql_connect_timeout] != 0) @ini_set('mysql.connect_timeout',$config[sql_connect_timeout]); + if ($config[sql_debug] == 'true') + print "DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @mysql_connect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd); } @@ -45,6 +51,8 @@ function da_sql_pconnect($config) if ($config[sql_connect_timeout] != 0) @ini_set('mysql.connect_timeout',$config[sql_connect_timeout]); + if ($config[sql_debug] == 'true') + print "DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @mysql_pconnect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd); } diff --git a/lib/sql/drivers/pg/functions.php3 b/lib/sql/drivers/pg/functions.php3 index ec20319..f3cfc62 100644 --- a/lib/sql/drivers/pg/functions.php3 +++ b/lib/sql/drivers/pg/functions.php3 @@ -10,6 +10,8 @@ function da_sql_host_connect($server,$config) $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } + if ($config[sql_debug] == 'true') + print "DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @pg_connect("host=$server port=$config[sql_port] dbname=$config[sql_database] user=$SQL_user password=$SQL_passwd"); @@ -26,6 +28,8 @@ function da_sql_connect($config) $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } + if ($config[sql_debug] == 'true') + print "DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @pg_connect("host=$config[sql_server] port=$config[sql_port] dbname=$config[sql_database] user=$SQL_user password=$SQL_passwd"); @@ -42,6 +46,8 @@ function da_sql_pconnect($config) $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } + if ($config[sql_debug] == 'true') + print "DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @pg_pconnect("host=$config[sql_server] port=$config[sql_port] dbname=$config[sql_database] user=$SQL_user password=$SQL_passwd"); diff --git a/lib/sql/functions.php3 b/lib/sql/functions.php3 index d42a6eb..7d6b613 100644 --- a/lib/sql/functions.php3 +++ b/lib/sql/functions.php3 @@ -5,7 +5,7 @@ else{ echo "Could not include SQL library
\n"; exit(); } -require('../lib/xlat.php3'); +require_once('../lib/xlat.php3'); function connect2db($config) {