Subversion Repositories ALCASAR

Rev

Rev 1805 | Rev 2384 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
325 richard 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
}
1805 clement.si 8
$link = da_sql_pconnect($config);
325 richard 9
if ($link){
1805 clement.si 10
	$res = da_sql_query($link,$config,
325 richard 11
		"DELETE FROM $config[sql_reply_table] WHERE username = '$login';");
12
	if ($res){
1805 clement.si 13
		$res = da_sql_query($link,$config,
325 richard 14
			"DELETE FROM $config[sql_check_table] WHERE username = '$login';");
15
		if ($res){
1805 clement.si 16
			$res = da_sql_query($link,$config,
325 richard 17
				"DELETE FROM $config[sql_usergroup_table] WHERE username = '$login';");
18
			if (!$res)
19
				echo "<b>Error deleting user $login from user group table: " . da_sql_error($link,$config) . "</b><br>\n";
1805 clement.si 20
			if ($config['sql_use_user_info_table'] == 'true'){
21
				$res = da_sql_query($link,$config,
325 richard 22
				"DELETE FROM $config[sql_user_info_table] WHERE username = '$login';");
23
				if ($res)
2226 richard 24
					echo "<b>$l_user $login $l_removed</b><br>\n";
325 richard 25
				else
26
					echo "<b>Error deleting user $login from user info table: " . da_sql_error($link,$config) . "</b><br>\n";
27
			}
28
		}
29
		else
30
			echo "<b>Error deleting user $login from check table: " . da_sql_error($link,$config) . "</b><br>\n";
31
	}
32
	else
33
		echo "<b>Error deleting user $login from reply table: " . da_sql_error($link,$config) . "</b><br>\n";
34
}
35
else
36
	echo "<b>Could not connect to SQL database</b><br>\n";
37
?>