File: functions.php3

package info (click to toggle)
freeradius 2.0.4%2Bdfsg-6
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 14,884 kB
  • ctags: 9,109
  • sloc: ansic: 73,328; sh: 12,392; php: 6,679; perl: 3,075; makefile: 1,316; sql: 1,197; python: 171; tcl: 35; sed: 23
file content (35 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php3"))
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php3");
else{
	echo "<b>Could not include SQL library</b><br>\n";
	exit();
}
require_once('../lib/xlat.php3');

function connect2db($config)
{
	$link=@da_sql_pconnect($config);

	return $link;
}

function get_user_info($link,$user,$config)
{
	if ($link && $config[sql_use_user_info_table] == 'true'){
		$user = da_sql_escape_string($user);
		$res=@da_sql_query($link,$config,
		"SELECT name FROM $config[sql_user_info_table] WHERE username = '$user';");
		if ($res){
			$row = @da_sql_fetch_array($res,$config);
			if ($row)
				return $row[name];
		}
	}
}

function closedb($link,$config)
{
	return 1;
}
?>