-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheader.php
More file actions
31 lines (28 loc) · 840 Bytes
/
header.php
File metadata and controls
31 lines (28 loc) · 840 Bytes
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
<?php
require_once("rb.php");
require_once("config.php");
R::setup("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);
session_start();
function strip_slashes_recursive($mixed){
if(is_string($mixed))
return stripslashes($mixed);
if(is_array($mixed))
foreach($mixed as $i=>$value)
$mixed[$i]=strip_slashes_recursive($value);
return $mixed;
}
function hasher($p){
$salt="";
for($i=0;$i<16;$i++)
$salt.=chr(rand(ord('@'),ord('~'))); //create a random 16 char string from ascii @ to ~
return crypt($p,'$5$rounds=5000$'.$salt.'$'); //$5 = SHA_256
}
function check_hash($p,$h){
return $h==crypt($p,$h);
}
if (get_magic_quotes_gpc()){ //!! ideally disable the magic
$_GET=strip_slashes_recursive($_GET);
$_POST=strip_slashes_recursive($_POST);
$_COOKIE=strip_slashes_recursive($_COOKIE);
}
?>