added a security file for hashing and the likes, as well as a setup file to keep track of table creations until I actually set that up
This commit is contained in:
parent
0fc08647c0
commit
8d3a822965
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
function hash_string($input, $rounds = 5) {
|
||||
$salt = "";
|
||||
$salt_chars = array_merge(range('A','Z'), range('a','z'), range(0,9));
|
||||
for($i=0; $i < 22; $i++) {
|
||||
$salt .= $salt_chars[array_rand($salt_chars)];
|
||||
}
|
||||
return crypt($input, sprintf('$2y$%02d$', $rounds) . $salt);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
$USERS_SQL = "CREATE TABLE user ( id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
||||
username VARCHAR(32) NOT NULL,
|
||||
password VARCHAR(64) NOT NULL,
|
||||
admin BOOL NOT NULL,
|
||||
registered DATE NOT NULL,
|
||||
last_login DATE,
|
||||
PRIMARY KEY (id))";
|
||||
?>
|
Loading…
Reference in New Issue