Fix regression: ajax calls require authentication with public access

This commit is contained in:
Bartek Fabiszewski 2017-05-09 21:54:43 +02:00
parent 8b65b905ce
commit b62b0b9b29
2 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,7 @@ if ($force_login) {
$user = new uUser();
$user->getFromSession();
if (!$user->isValid && (uConfig::$require_authentication || defined('headless'))) {
if (!$user->isValid && (uConfig::$require_authentication || defined('client'))) {
/* authentication */
$login = (isset($_REQUEST['user']) ? $_REQUEST['user'] : NULL);
$pass = (isset($_REQUEST['pass']) ? $_REQUEST['pass'] : NULL);

View File

@ -29,6 +29,7 @@ function setError(&$response, $message) {
}
define("headless", true);
define("client", true);
require_once(dirname(__DIR__) . "/auth.php"); // sets $user
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;