-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthClass.php
More file actions
executable file
·66 lines (44 loc) · 1.41 KB
/
Copy pathauthClass.php
File metadata and controls
executable file
·66 lines (44 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
Licence-Terms
===============
This project is protected by Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported licence
Please read the online version of this licence here:
http://creativecommons.org/licenses/by-nc-sa/3.0/
An offline copy is in the root folder of this project by the name "licence.pdf"
This licence is to keep the commercial fishes off the waters. Don't be disheartened. I am always an email away :)
Mail me at: prashant.dwivedi@outlook.com
*/
?>
<?php
class AuthClass {
private $userName;
private $isLoggedIn;
private $table;
private $userIdField;
private $pwdField;
private $authCookieField;
public function cleanCookie($cookie)
{ return cleanString($cookie);
}
public function __construct($conn, $tableName, $userIdField, $sessionCookieField)
{ if(!$conn || !$tableName || !$userIdField || !$sessionCookieField)
return FALSE;
}
public function signup($conn, $table, $username, $email, $pwd)
{ $res = $conn->query('INSERT INTO '.$table. ' ')
}
public function isLoggedIn()
{ if(isset($_COOKIE['authToken']) && isset($_COOKIE['authHandle']))
{ $auth = new array( 'authHandle' => $_COOKIE['authHandle'],
'authToken' => $_COOKIE['authToken'];
);
return $auth;
}
return FALSE;
}
public function checkDatabase($conn)
{ $res = $conn->query('SELECT * FROM authClass where handle="'.$handle.'" and ')
}
}
?>