1 |
<?php |
<?php |
2 |
/********************************************************** |
/********************************************************** |
3 |
Function Library: validate_mysql.php |
Function Library: validate_mysql.php |
4 |
Original Author: Paul Bramscher <brams006@tc.umn.edu> |
Original Author: Paul Bramscher <brams006@umn.edu> |
5 |
Last Modified: 09.30.2003 by Paul Bramscher |
Last Modified: 03.11.2004 by Paul Bramscher |
6 |
*********************************************************** |
*********************************************************** |
7 |
Comments: |
Comments: |
8 |
This library handles initial login of the user to LibData. |
This library handles initial login of the user to LibData. |
10 |
it's been pulled out of other libraries. |
it's been pulled out of other libraries. |
11 |
*********************************************************** |
*********************************************************** |
12 |
Table of Contents: |
Table of Contents: |
|
|
|
13 |
validateUser |
validateUser |
|
|
|
14 |
**********************************************************/ |
**********************************************************/ |
15 |
|
|
16 |
|
|
17 |
|
|
18 |
/********************************************************** |
/********************************************************** |
19 |
Function: validateUser($con, $pass, $user) |
Function: validateUser($pass, $user) |
20 |
Author: Paul Bramscher |
Author: Paul Bramscher |
21 |
Last Modified: 09.30.2003 |
Last Modified: 03.01.2004 |
22 |
*********************************************************** |
*********************************************************** |
23 |
Incoming: |
Incoming: |
24 |
$password Password, 6 char. minimum |
$password Password, 6 char. minimum |
38 |
can't be used. |
can't be used. |
39 |
**********************************************************/ |
**********************************************************/ |
40 |
|
|
41 |
function validateUser($con, $pass, $user){ |
function validateUser($pass, $user){ |
42 |
|
|
43 |
// Assume the user is not valid |
// Assume the user is not valid |
44 |
$validated = 0; |
$validated = 0; |
59 |
. "')"; |
. "')"; |
60 |
|
|
61 |
// Fetch the results |
// Fetch the results |
62 |
$rs = xx_query($sql, $con); |
$rs = xx_tryquery($sql); |
63 |
$row = xx_fetch_array ($rs); |
|
64 |
|
$row = xx_fetch_array ($rs, xx_ASSOC); |
65 |
$last_login = Trim($row["last_login"]); |
$last_login = Trim($row["last_login"]); |
66 |
$last_ip = Trim($row["last_ip"]); |
$last_ip = Trim($row["last_ip"]); |
67 |
$access_id = (int) $row["access_id"]; |
$access_id = (int) $row["access_id"]; |
85 |
. "' WHERE staff.staff_account = '" |
. "' WHERE staff.staff_account = '" |
86 |
. $user |
. $user |
87 |
. "'"; |
. "'"; |
88 |
if (!xx_query ($sql, $con)){ |
xx_tryquery($sql); |
|
sql_err($sql); |
|
|
xx_query ("UNLOCK TABLES", $con); |
|
|
bailout(); |
|
|
} |
|
|
else { |
|
|
xx_query ("UNLOCK TABLES", $con); |
|
|
} |
|
89 |
} |
} |
90 |
|
|
91 |
} // password > 5 characters in length |
} // password > 5 characters in length |
92 |
|
|
93 |
return $validated; |
return $validated; |
94 |
} |
} |
95 |
?> |
?> |