LogoLogo
SourceSupportTraining
v3.x
v3.x
  • Introduction
  • Intro
    • Introduction
      • What's New With 3.7.0
      • What's New With 3.6.0
      • What's New With 3.5.0
      • What's New With 3.1.0
      • What's New With 3.0.0
        • Architecture
        • Administrator
        • Themes
        • Front End
        • Upgrading to 3.0.0
      • About This Book
      • Author
  • Getting Started
    • Installation
      • System Requirements
      • CommandBox Installation
      • Source Installation
      • WAR Installation
      • Express Installation
      • Existing ColdBox Application
      • Upgrading ContentBox
      • Docker
    • Quick Guide
  • Usage
    • Using ContentBox
      • Content
        • Publish Content
          • Blog
          • Sitemap
          • Content Editing Tips
            • Editor Features
            • Dynamic Variable Output
            • Markdown Support
            • Scheduled Content
        • Consume Content
          • Content Store
          • Categories
          • Media Manager
          • Menu Manager
      • Comments
        • Inbox
        • Settings
      • Look & Feel
        • Active Theme
        • Global HTML
        • Themes
        • Widgets
          • Inserting a Simple Widget
      • Modules
        • Installing Modules
        • Managing Modules
      • Users
        • Manage
        • Permissions
        • Roles
      • Tools
        • Import
        • Export
        • Static Site Generation
      • System
        • Auth Logs
        • Geek Settings
        • Settings
          • Site Options
          • Admin Options
          • Security Options
          • Login Options
          • Content Options
          • Editor Options
          • Media Manager Options
          • Gravatars
          • Notifications
          • Mail Server
          • Search Options
          • Login Options
        • Security Rules
        • Updates
  • Developing
    • Developing For ContentBox
      • Front-End Development
        • File Structure
        • Theme Development
          • Theme Settings
          • Theme UDFs
          • Theme Templates
          • Theme Layouts
          • Theme Views
          • Theme SEO Functionality
        • The Content Store
        • Customizing Views
        • Customizing Layouts
        • Managing Assets
        • Customizing Navigation
        • Global Variables
        • Template Variables
      • Back-End Development
        • Overriding ContentBox Settings
        • Modules
          • Installing a Module
          • Using a Module
          • Module Locations and Conventions
          • Build a Module
          • Scaffold a Module
          • Theme your Module
          • Build an Admin Module
          • Adding Admin Menus to your Module
          • Adding Meta to your Modules
        • Widgets
          • Simple Widget
          • Widgets with Arguments
          • Multiple Render Function Widgets
        • JS and CSS Assets
        • Interceptors
        • Accessing Logged in User
        • Customizing the Admin
        • Staying on the Upgrade Path
Powered by GitBook
On this page
  • What is available with the Current Logged in User?
  • Additional Author Content

Was this helpful?

Edit on Git
Export as PDF
  1. Developing
  2. Developing For ContentBox
  3. Back-End Development

Accessing Logged in User

Whether you are in a blog post, page, or a front end module ( anything using the Theme ), ContentBox makes it easy to work with the currently logged in User. In ContentBox, a user is called an Author. You can use these terms interchangeably.

During the PrepareUIRequest, that runs whenever we setup the ContentBox core, Theme etc, ContentBox gets the currently logged in user and stores it in the PRC ( Private Request Collection )`

To access the user, you can use this variable

prc.oCurrentAuthor

You can dump this variable out, but I would limit the number of rows deep you go, as this object has objects which has objects, and can give you a heap space error.

<cfdump var="#prc.oCurrentAuthor#" top=3> or writeDump( var=prc.oCurrentAuthor, top=3 );

What is available with the Current Logged in User?

  • Author First Name prc.oCurrentAuthor.getFirstName()

  • Author LastName prc.oCurrentAuthor.getLastName()

  • Author Email prc.oCurrentAuthor.getEmail()

  • Author Username prc.oCurrentAuthor.getUserame()

  • Author Created Date prc.oCurrentAuthor.getCreatedDate()

  • Author Modified Date prc.oCurrentAuthor.getModifiedDate()

  • Author Last Login Date prc.oCurrentAuthor.getLastLogin()

  • Author Biography prc.oCurrentAuthor.getFirstName()

  • Author Preferences prc.oCurrentAuthor.getFirstName()

  • Author Role prc.oCurrentAuthor.getRole().getName()

Additional Author Content

prc.oCurrentAuthor.entries() returns an Array of entries / blog posts

prc.oCurrentAuthor.getNumberOfEntries() returns a count of entries / blog posts

prc.oCurrentAuthor.pages() returns an Array of pages

prc.oCurrentAuthor.getNumberOfEntries() returns a count of entries / blog posts

prc.oCurrentAuthor.getPermissions() returns an Array of A La Carte Permissions

prc.oCurrentAuthor.getPermissionsList() returns an string containing a list of A La Carte Permissions

Last updated 7 years ago

Was this helpful?