mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-07-08 17:24:25 +03:00
Move configurationchecks to misc.php
This commit is contained in:
parent
2939dbfca8
commit
6dcd923cff
2 changed files with 29 additions and 20 deletions
|
@ -51,23 +51,3 @@ $defaults['primaryns'] = 'unconfigured.primaryns'; # The value of the first
|
|||
$defaults['secondaryns'] = 'unconfigured.secondaryns'; # The value of the second NS-record
|
||||
$defaults['ttl'] = 3600; # Default TTL for records
|
||||
$defaults['priority'] = 0; # Default for priority in records
|
||||
|
||||
$blocklogin = FALSE;
|
||||
|
||||
if (!preg_match('/^(xapikey|userpass|auto)$/', $authmethod)) {
|
||||
$errormsg = "The value for $authmethod is incorrect in your config";
|
||||
$blocklogin = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* No need to change stuf below */
|
||||
$defaults['defaulttype'] = ucfirst(strtolower($defaults['defaulttype']));
|
||||
|
||||
if (!file_exists($authdb)) {
|
||||
is_dir(dirname($authdb)) || mkdir(dirname($authdb));
|
||||
$db = new SQLite3($authdb, SQLITE3_OPEN_CREATE|SQLITE3_OPEN_READWRITE);
|
||||
$createsql = file_get_contents('includes/scheme.sql');
|
||||
$db->exec($createsql);
|
||||
$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