bzr branch
http://gegoxaren.bato24.eu/bzr/extremedating/trunk
12.1.1
by Gustav Hatvigsson
Added a feild to the Useres database. |
1 |
<?php
|
2 |
include "php/db.php"; |
|
52.1.2
by Gustav Hatvigsson
Seperated out the salt into its own file. |
3 |
include "php/salt.php"; |
12.1.1
by Gustav Hatvigsson
Added a feild to the Useres database. |
4 |
|
52.1.2
by Gustav Hatvigsson
Seperated out the salt into its own file. |
5 |
$password = sha1($_POST['password'].$pwd_salt); |
26
by Daniel Johansson
Fixed sessions for logins |
6 |
$username = $_POST['username']; |
12.1.1
by Gustav Hatvigsson
Added a feild to the Useres database. |
7 |
|
26
by Daniel Johansson
Fixed sessions for logins |
8 |
if(isset($_SESSION ['userName'])) { |
15
by Daniel Johansson
Fixed stuffz |
9 |
echo "You can not login whilest you are logedin..."; |
12.1.1
by Gustav Hatvigsson
Added a feild to the Useres database. |
10 |
} else { |
11 |
||
12 |
$query = "SELECT * FROM Users |
|
15
by Daniel Johansson
Fixed stuffz |
13 |
WHERE loginName = '{$username}';"; |
12.1.1
by Gustav Hatvigsson
Added a feild to the Useres database. |
14 |
$userinfo = $db->query($query); |
12.1.3
by Gustav Hatvigsson
fixed a fow errors. |
15 |
$fetch = $userinfo->fetchAll(); |
16 |
if ($fetch[0]['shadow'] == $password) { |
|
12.1.1
by Gustav Hatvigsson
Added a feild to the Useres database. |
17 |
session_start(); |
15
by Daniel Johansson
Fixed stuffz |
18 |
$_SESSION['userName'] = $username; |
19 |
$_SESSION['userType'] = $fetch[0]['userType']; |
|
12.1.1
by Gustav Hatvigsson
Added a feild to the Useres database. |
20 |
} else { |
21 |
echo "Wrong password or user name"; |
|
22 |
}
|
|
23 |
sleep(.5); |
|
24 |
header("Location:./index.php"); |
|
25 |
||
26 |
}
|
|
27 |
?>
|