fix when gets loaded.

This commit is contained in:
Isaac Connor 2018-07-24 10:40:18 -04:00
parent 8c35d4d1b0
commit caa8adae5e
1 changed files with 6 additions and 4 deletions

View File

@ -69,10 +69,12 @@ class AppController extends Controller {
if ( $zmOptApi != '1' ) {
throw new UnauthorizedException(__('API Disabled'));
return;
} else {
global $user;
$user = $this->Session->read('user');
}
}
# For use throughout the app. If not logged in, this will be null.
global $user;
$user = $this->Session->read('user');
// We need to reject methods that are not authenticated
// besides login and logout
if ( strcasecmp($this->params->action, 'login') &&