Improve the feature that allows staff to preview content before it is visible but requiring that staff members are logged in.
- [Instructor] In an earlier chapter, we created a feature…that will allow admins to be able to preview content…just as the public would see it,…but before the content was made visible to the public.…And, at the time, if you will remember,…we put a note in there that we wanted to come back…to this topic once we understood user authentication,…so that we could actually make sure that the previewing…was authorized by someone actually being logged in.…Now that we understand user authentication,…we can revisit that topic.…The place where we added that preview code…is in index.php, inside the public directory,…This is the main page for displaying content to the public…and you can see that we're checking here to see…whether or not preview has been set…and whether it's been set to true.…
And if it has,…then we're going to allow the user to preview the content.…Let's take a look at that.…Over here in my staff area, I'm going to find one of my pages…that is set to be not visible.…Going to view it and then I'll preview it.…
- Creating a content management system
- Building dynamic content navigation
- Using context and function options for conditional behavior
- Hiding content from the public view
- Insecure direct object reference
- Allowing HTML in dynamic content
- Previewing content in the public context
- Working with cookies and sessions
- Storing status messages in the session
- Secure user authentication (login/logout)
- Regulating page access
- Nesting related resources
- Managing an ordered list automatically
Skill Level Beginner
1. Create a Content Management System
2. Build Dynamic Content Navigation
3. Use Context and Options
4. Cookies and Sessions
5. Regulate Page Access
6. Nesting Related Resources
Next steps1m 15s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.