Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Richard Feinburg
Richard Feinburg
2,970 Points

Customer login to download files?

My company wants to setup a page that their sales reps can login to a section page on the site and then download and/or read private content that the public can't see unless they login to the site. I'm trying out Customer Area plugin and It seem like it's what I need but I don't like the fact that sales reps have to login into the wp-admin. Would like to be about for them to login within a section page and the information will pop up without knowing they are using wordpress.

Below is the link to the page I'm setting up and the link below that is the plugin I'm using. If you know a better plugin to use let me know. Thanks!

http://rsadhesives.com/team-rsi-sales-tools/

http://customer-area.marvinlabs.com/

6 Answers

Jeremy Germenis
Jeremy Germenis
29,854 Points

In your hosting control panel you can set a username/password for a directory or file that will display a login window. This would bypass the wordpress shenanigans. How to add one depends on the server type, linux or windows, but it is a basic control panel function and is easy to do.

Patrick Cooney
Patrick Cooney
12,216 Points

Good luck. That's all I can say. I looked for something like this a couple years back and there was nothing. It was hard to even find a full tutorial on building something like that as a standalone. I managed to hack something together (mostly cut and paste with some fill in the blank) from a combination of multiple tutorials but it wasn't pretty (since I didn't know PHP at the time). Honestly, your best bet is to do some of the PHP tutorials and build your own standalone area. If you'd like, once I get home from work, I can check if I still have the files. I can't guarantee they're secure, because at the time I didn't know PHP, but they did work.

Sukhraj Grewal
Sukhraj Grewal
10,554 Points

Wouldn't be easy if you create a page with your content and password protect it and give your sales team the password. To password protect a page , when you edit/create page on right in publish box you will see visibility click edit and set password. This way they won't have to login they just need the password and url to view and they won't know its a wordpress.

Hope this helps

Julian Price
Julian Price
11,760 Points

What about just using wp-login which will default to user if allowing registering to the public to comment on post. If you are doing this you may want to look at the user role capabilities in the codex to display based on a role displaying info for page publish box to private

Richard Feinburg
Richard Feinburg
2,970 Points

I decided to setup a a wordpress style login but without secure system. It's only to files.

Matt Campbell
Matt Campbell
9,767 Points

Easiest way would be to use User Role Editor. If it's the plugin I'm thinking of, it allows creation of user roles so you could have customer and rep as two new roles.

Then, just put a conditional somewhere to hide the menu item if user is customer, show if rep Again, another conditional for failsafe on the root page of the new section saying is customer, redirect back to home with a message, if rep, show content.

You could take it a step further and put a checkbox in your admin area so that when creating a new post, you can check if it's only for reps. Then you can compare this data with user role and if it's true, show, if false, redirect with message. If you wanted absolute control but it's rather unnecessary.