mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-22 15:40:22 +00:00
16 lines
350 B
PHP
Executable file
16 lines
350 B
PHP
Executable file
<?php
|
|
|
|
if (RASPI_AUTH_ENABLED) {
|
|
$user = $_SERVER['PHP_AUTH_USER'] ?? '';
|
|
$pass = $_SERVER['PHP_AUTH_PW'] ?? '';
|
|
|
|
$auth = new \RaspAP\Auth\HTTPAuth;
|
|
|
|
if (!$auth->isLogged()) {
|
|
if ($auth->login($user, $pass)) {
|
|
$config = $auth->getAuthConfig();
|
|
} else {
|
|
$auth->authenticate();
|
|
}
|
|
}
|
|
}
|