Back to Littlefoot Manual

User

Load user from current session

$sessionUser = (new User)->fromSession()

Check if logged in user has 'admin' acl

$isAdmin = (new User)->fromSession()->hasAccess('admin')

LF Installer

This is how the lf installer creates the admin user and auto-logs them in

// Add admin user
(new User)
->setAccess('admin')
->setUser($aUser)
->setDisplay_name(ucfirst($aUser))
->setPass($aPass)
->setStatus('valid')
->save()
->toSession(); // and auto login as that user
blog comments powered by Disqus