Code cleanup, same results.
-global $User, $editable;
-$User = FALSE;
+call_user_func(function () {
if (isset($_SERVER['PHP_AUTH_USER'])) {
$authinfo = [ $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ];
}
if (isset($_SERVER['PHP_AUTH_USER'])) {
$authinfo = [ $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ];
}
$salt = substr($usertest, 0, 2);
if (crypt($authpass, $salt) != $usertest) return;
$salt = substr($usertest, 0, 2);
if (crypt($authpass, $salt) != $usertest) return;
- $GLOBALS['User'] = $authname;
-}
-
-Auth();
-
-$editable = !empty($User) && $User != 'lid';
+ global $User, $Admin;
+ $User = $authname;
+ $Admin = !empty($User) && $User != 'lid' ? $User : FALSE;
+});
}
require 'auth.inc.php';
}
require 'auth.inc.php';
abort('401 unauthorised', "geen beheersrechten");
if (!$_POST)
abort('401 unauthorised', "geen beheersrechten");
if (!$_POST)
-global $User, $editable;
$curfile = ltrim($_SERVER['SCRIPT_NAME'], '/');
if (is_executable(__DIR__ . '/' . $curfile)) {
// dynamic code is +x
$curfile = ltrim($_SERVER['SCRIPT_NAME'], '/');
if (is_executable(__DIR__ . '/' . $curfile)) {
// dynamic code is +x
$edit = preg_match('/[?]edit$/', $_SERVER['REQUEST_URI']);
if ($edit) {
$edit = preg_match('/[?]edit$/', $_SERVER['REQUEST_URI']);
if ($edit) {
<?php
require 'auth.inc.php';
<?php
require 'auth.inc.php';
require 'logout.php';
exit;
}
require 'logout.php';
exit;
}