userfrosting / UserFrosting

Modern PHP user login and management framework
https://www.userfrosting.com
Other
1.63k stars 366 forks source link

More content examples #358

Closed jenolan closed 7 years ago

jenolan commented 9 years ago

Did a bit of a search and could not find how to have visitor access, for general sites login/registration is after people have a look around ... for example a personal blog allow read-only access and people only register if they want to post etc....

Could you cook an example of the front-end being visible, user profile after rego etc ?

Thanks, Larry

alexweissman commented 9 years ago

Do you just want to make something publicly accessible? If so, you don't need to do anything for new routes that you create. They will be public by default.

If you want to take one of the premade pages and make it public, you can just remove the call to checkAccess in the controller code.

If you are still having trouble, join us in chat and we'll try to help.

jenolan commented 9 years ago

I drilled down to the home page and eventually worked out that the 'must login' was just how the initial page was setup. Probably sounds uber simple minded but some sample content as the default installed home page might be nice so that it is obvious that public access is there.

Still looking at the lay of the land as I had progressed a fair way with some other components and was about to start user fiddling when I found this app ;-)

Larry

tyl3r commented 9 years ago

Im trying to make a "normal website" using Userfrosting as the optional register/login system and after reading the documentation, is a little bit confusing to understand how it works, like @jenolan i think a little bit of front-end examples will be a very good start for people like me, maybe adding new sections in the menu of "home.html" will be a good help, something like:

restricted.html -> Some restricted Lorem ipsum only for logged users about.html -> Some Lorem ipsum for all visitors users.html -> Restricted list of all users from DB contact.html -> A contact form

As a complete noob in MVC/Slim/Twig all examples like this will be very welcome, for now i can't imagine creating and using new tables in database without the understanding of this new way of working.

Sorry for my english and my noob approach.

alexweissman commented 9 years ago

Alright, let me see what I can do. I think the key here is to think in terms of routes, rather than .html or .php files.

Routes can (and by default are), publicly accessible. If you look at the route for /dashboard, for example: https://github.com/alexweissman/UserFrosting/blob/master/public/index.php#L28

The only thing that makes this route "restricted" is the call to $app->user->checkAccess('uri_dashboard'). If that wasn't done, this would just behave like a normal, public page.

alexweissman commented 7 years ago

I think this will be better covered with v4 and the corresponding new website, https://learn.userfrosting.com.