Subversion Repositories ALCASAR

Rev

Rev 907 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 907 Rev 1805
Line 5... Line 5...
5
else{
5
else{
6
	echo "<b>Could not include SQL library</b><br>\n";
6
	echo "<b>Could not include SQL library</b><br>\n";
7
	exit();
7
	exit();
8
}
8
}
9
 
9
 
10
if ($action == 'checkpass'){
10
if (isset($action) && $action == 'checkpass'){
11
	$link = @da_sql_pconnect($config);
11
	$link = da_sql_pconnect($config);
12
	if ($link){
12
	if ($link){
13
		$res = @da_sql_query($link,$config,
13
		$res = da_sql_query($link,$config,
14
			"SELECT attribute,value FROM $config[sql_check_table] WHERE username = '$login'
14
			"SELECT attribute,value FROM $config[sql_check_table] WHERE username = '$login'
15
			AND attribute = '$config[sql_password_attribute]';");
15
			AND attribute = '$config[sql_password_attribute]';");
16
		if ($res){
16
		if ($res){
17
			$row = @da_sql_fetch_array($res,$config);
17
			$row = da_sql_fetch_array($res,$config);
18
			if (is_file("../lib/crypt/$config[general_encryption_method].php")){
18
			if (is_file("../lib/crypt/$config[general_encryption_method].php")){
19
				include("../lib/crypt/$config[general_encryption_method].php");
19
				include("../lib/crypt/$config[general_encryption_method].php");
20
				$enc_passwd = $row[value];
20
				$enc_passwd = $row['value'];
21
				$passwd = da_encrypt($passwd,$enc_passwd);
21
				$passwd = da_encrypt($passwd,$enc_passwd);
22
				if ($passwd == $enc_passwd)
22
				if ($passwd == $enc_passwd)
23
					$msg = '<font color=blue><b>YES It is that</b></font>';
23
					$msg = '<font color=blue><b>YES It is that</b></font>';
24
				else
24
				else
25
					$msg = '<font color=red><b>NO It is wrong</b></font>';
25
					$msg = '<font color=red><b>NO It is wrong</b></font>';