Need to always include auth.php, as it has functions like canView

pull/3669/merge
Isaac Connor 2023-02-27 17:02:23 -05:00
parent 2e58ea1a42
commit d75364ff53
1 changed files with 2 additions and 3 deletions

View File

@ -66,11 +66,10 @@ class AppController extends Controller {
# For use throughout the app. If not logged in, this will be null. # For use throughout the app. If not logged in, this will be null.
global $user; global $user;
# This will auto-login if username=&password= are set, or auth=
require_once __DIR__ .'/../../../includes/auth.php';
if ( ZM_OPT_USE_AUTH ) { if ( ZM_OPT_USE_AUTH ) {
# This will auto-login if username=&password= are set, or auth=
require_once __DIR__ .'/../../../includes/auth.php';
if ( ZM_OPT_USE_LEGACY_API_AUTH or !strcasecmp($this->params->action, 'login') ) { if ( ZM_OPT_USE_LEGACY_API_AUTH or !strcasecmp($this->params->action, 'login') ) {
# This is here because historically we allowed user=&pass= in the api. web-ui auth uses username=&password= # This is here because historically we allowed user=&pass= in the api. web-ui auth uses username=&password=
$username = $this->request->query('user') ? $this->request->query('user') : $this->request->data('user'); $username = $this->request->query('user') ? $this->request->query('user') : $this->request->data('user');