Added (Check Duplicates Before Adding New User)
parent
6339774759
commit
139af13643
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
// Define default config values
|
||||||
|
$defaultConfig = [
|
||||||
|
'chap_secrets_path' => '/etc/ppp/chap-secrets',
|
||||||
|
'admin_username' => 'admin',
|
||||||
|
'admin_password' => password_hash('change@me', PASSWORD_DEFAULT),
|
||||||
|
];
|
||||||
|
|
||||||
|
// Create config.php if it doesn't exist
|
||||||
|
if (!file_exists('config.php')) {
|
||||||
|
file_put_contents('config.php', '<?php return ' . var_export($defaultConfig, true) . ';');
|
||||||
|
}
|
12
index.php
12
index.php
|
@ -1,16 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
include 'header.php';
|
||||||
session_start();
|
session_start();
|
||||||
// Define default config values
|
|
||||||
$defaultConfig = [
|
|
||||||
'chap_secrets_path' => '/etc/ppp/chap-secrets',
|
|
||||||
'admin_username' => 'admin',
|
|
||||||
'admin_password' => password_hash('change@me', PASSWORD_DEFAULT),
|
|
||||||
];
|
|
||||||
|
|
||||||
// Create config.php if it doesn't exist
|
|
||||||
if (!file_exists('config.php')) {
|
|
||||||
file_put_contents('config.php', '<?php return ' . var_export($defaultConfig, true) . ';');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
|
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
|
||||||
header('Location: login.php');
|
header('Location: login.php');
|
||||||
|
|
Loading…
Reference in New Issue