mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-07-08 17:24:25 +03:00
Rework session handling; add CSRF tokens and autologin
This commit is contained in:
parent
922642005d
commit
e8f071f67c
6 changed files with 295 additions and 93 deletions
|
@ -20,6 +20,9 @@ $allowzoneadd = FALSE; # Allow normal users to add zones
|
|||
|
||||
$authdb = "../etc/pdns.users.sqlite3";
|
||||
|
||||
# Set a random generated secret to enable auto-login and long living csrf tokens
|
||||
// $secret = '...';
|
||||
|
||||
$templates = array();
|
||||
/*
|
||||
$templates[] = array(
|
||||
|
@ -57,5 +60,3 @@ if (!file_exists($authdb)) {
|
|||
$salt = bin2hex(openssl_random_pseudo_bytes(16));
|
||||
$db->exec("INSERT INTO users (emailaddress, password, isadmin) VALUES ('admin', '".crypt("admin", '$6$'.$salt)."', 1)");
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue