Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
1805 clement.si 1
<?php
2
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
3
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
4
else{
5
	echo "<b>Could not include SQL library</b><br>\n";
6
	exit();
7
}
8
require_once('../lib/xlat.php');
9
 
10
function connect2db($config)
11
{
12
	$link=da_sql_pconnect($config);
13
 
14
	return $link;
15
}
16
 
17
function get_user_info($link,$user,$config)
18
{
19
	if ($link && $config['sql_use_user_info_table'] == 'true'){
20
		$user = da_sql_escape_string($link, $user);
21
		$res=da_sql_query($link,$config,
22
		"SELECT name FROM $config[sql_user_info_table] WHERE username = '$user';");
23
		if ($res){
24
			$row = da_sql_fetch_array($res,$config);
25
			if ($row)
26
				return $row['name'];
27
		}
28
	}
29
}
30
 
31
function closedb($link,$config)
32
{
33
	return 1;
34
}
35
?>